diff --git a/owl-bot-staging/Asset/v1/proto/src/GPBMetadata/Google/Cloud/Asset/V1/AssetService.php b/owl-bot-staging/Asset/v1/proto/src/GPBMetadata/Google/Cloud/Asset/V1/AssetService.php new file mode 100644 index 000000000000..bd88fdc28086 Binary files /dev/null and b/owl-bot-staging/Asset/v1/proto/src/GPBMetadata/Google/Cloud/Asset/V1/AssetService.php differ diff --git a/owl-bot-staging/Asset/v1/proto/src/GPBMetadata/Google/Cloud/Asset/V1/Assets.php b/owl-bot-staging/Asset/v1/proto/src/GPBMetadata/Google/Cloud/Asset/V1/Assets.php new file mode 100644 index 000000000000..37483f121749 Binary files /dev/null and b/owl-bot-staging/Asset/v1/proto/src/GPBMetadata/Google/Cloud/Asset/V1/Assets.php differ diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyLongrunningMetadata.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyLongrunningMetadata.php new file mode 100644 index 000000000000..7e2b1c3d693d --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyLongrunningMetadata.php @@ -0,0 +1,78 @@ +google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + */ +class AnalyzeIamPolicyLongrunningMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyLongrunningRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyLongrunningRequest.php new file mode 100644 index 000000000000..df8dc40e3a58 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyLongrunningRequest.php @@ -0,0 +1,208 @@ +google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + */ +class AnalyzeIamPolicyLongrunningRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The request query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $analysis_query = null; + /** + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * doc. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + * + * Generated from protobuf field string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $saved_analysis_query = ''; + /** + * Required. Output configuration indicating where the results will be output + * to. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery $analysis_query + * Required. The request query. + * @type string $saved_analysis_query + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * doc. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig $output_config + * Required. Output configuration indicating where the results will be output + * to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The request query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery|null + */ + public function getAnalysisQuery() + { + return $this->analysis_query; + } + + public function hasAnalysisQuery() + { + return isset($this->analysis_query); + } + + public function clearAnalysisQuery() + { + unset($this->analysis_query); + } + + /** + * Required. The request query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery $var + * @return $this + */ + public function setAnalysisQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery::class); + $this->analysis_query = $var; + + return $this; + } + + /** + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * doc. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + * + * Generated from protobuf field string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSavedAnalysisQuery() + { + return $this->saved_analysis_query; + } + + /** + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * doc. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + * + * Generated from protobuf field string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSavedAnalysisQuery($var) + { + GPBUtil::checkString($var, True); + $this->saved_analysis_query = $var; + + return $this; + } + + /** + * Required. Output configuration indicating where the results will be output + * to. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. Output configuration indicating where the results will be output + * to. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig::class); + $this->output_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyLongrunningResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyLongrunningResponse.php new file mode 100644 index 000000000000..332d687c4cf8 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyLongrunningResponse.php @@ -0,0 +1,34 @@ +google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + */ +class AnalyzeIamPolicyLongrunningResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyRequest.php new file mode 100644 index 000000000000..1bf78c22c826 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyRequest.php @@ -0,0 +1,236 @@ +google.cloud.asset.v1.AnalyzeIamPolicyRequest + */ +class AnalyzeIamPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The request query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $analysis_query = null; + /** + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * page. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + * + * Generated from protobuf field string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $saved_analysis_query = ''; + /** + * Optional. Amount of time executable has to complete. See JSON + * representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + * If this field is set with a value less than the RPC deadline, and the + * execution of your query hasn't finished in the specified + * execution timeout, you will get a response with partial result. + * Otherwise, your query's execution will continue until the RPC deadline. + * If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + * Default is empty. + * + * Generated from protobuf field .google.protobuf.Duration execution_timeout = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $execution_timeout = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery $analysis_query + * Required. The request query. + * @type string $saved_analysis_query + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * page. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + * @type \Google\Protobuf\Duration $execution_timeout + * Optional. Amount of time executable has to complete. See JSON + * representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + * If this field is set with a value less than the RPC deadline, and the + * execution of your query hasn't finished in the specified + * execution timeout, you will get a response with partial result. + * Otherwise, your query's execution will continue until the RPC deadline. + * If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + * Default is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The request query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery|null + */ + public function getAnalysisQuery() + { + return $this->analysis_query; + } + + public function hasAnalysisQuery() + { + return isset($this->analysis_query); + } + + public function clearAnalysisQuery() + { + unset($this->analysis_query); + } + + /** + * Required. The request query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery $var + * @return $this + */ + public function setAnalysisQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery::class); + $this->analysis_query = $var; + + return $this; + } + + /** + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * page. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + * + * Generated from protobuf field string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSavedAnalysisQuery() + { + return $this->saved_analysis_query; + } + + /** + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * page. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + * + * Generated from protobuf field string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSavedAnalysisQuery($var) + { + GPBUtil::checkString($var, True); + $this->saved_analysis_query = $var; + + return $this; + } + + /** + * Optional. Amount of time executable has to complete. See JSON + * representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + * If this field is set with a value less than the RPC deadline, and the + * execution of your query hasn't finished in the specified + * execution timeout, you will get a response with partial result. + * Otherwise, your query's execution will continue until the RPC deadline. + * If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + * Default is empty. + * + * Generated from protobuf field .google.protobuf.Duration execution_timeout = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getExecutionTimeout() + { + return $this->execution_timeout; + } + + public function hasExecutionTimeout() + { + return isset($this->execution_timeout); + } + + public function clearExecutionTimeout() + { + unset($this->execution_timeout); + } + + /** + * Optional. Amount of time executable has to complete. See JSON + * representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + * If this field is set with a value less than the RPC deadline, and the + * execution of your query hasn't finished in the specified + * execution timeout, you will get a response with partial result. + * Otherwise, your query's execution will continue until the RPC deadline. + * If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + * Default is empty. + * + * Generated from protobuf field .google.protobuf.Duration execution_timeout = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setExecutionTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->execution_timeout = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyResponse.php new file mode 100644 index 000000000000..af85a4885579 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyResponse.php @@ -0,0 +1,170 @@ +google.cloud.asset.v1.AnalyzeIamPolicyResponse + */ +class AnalyzeIamPolicyResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The main analysis that matches the original request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis main_analysis = 1; + */ + protected $main_analysis = null; + /** + * The service account impersonation analysis if + * [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is + * enabled. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis service_account_impersonation_analysis = 2; + */ + private $service_account_impersonation_analysis; + /** + * Represents whether all entries in the + * [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] + * and + * [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] + * have been fully explored to answer the query in the request. + * + * Generated from protobuf field bool fully_explored = 3; + */ + protected $fully_explored = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis $main_analysis + * The main analysis that matches the original request. + * @type array<\Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis>|\Google\Protobuf\Internal\RepeatedField $service_account_impersonation_analysis + * The service account impersonation analysis if + * [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is + * enabled. + * @type bool $fully_explored + * Represents whether all entries in the + * [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] + * and + * [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] + * have been fully explored to answer the query in the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The main analysis that matches the original request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis main_analysis = 1; + * @return \Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis|null + */ + public function getMainAnalysis() + { + return $this->main_analysis; + } + + public function hasMainAnalysis() + { + return isset($this->main_analysis); + } + + public function clearMainAnalysis() + { + unset($this->main_analysis); + } + + /** + * The main analysis that matches the original request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis main_analysis = 1; + * @param \Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis $var + * @return $this + */ + public function setMainAnalysis($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis::class); + $this->main_analysis = $var; + + return $this; + } + + /** + * The service account impersonation analysis if + * [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is + * enabled. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis service_account_impersonation_analysis = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceAccountImpersonationAnalysis() + { + return $this->service_account_impersonation_analysis; + } + + /** + * The service account impersonation analysis if + * [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is + * enabled. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis service_account_impersonation_analysis = 2; + * @param array<\Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceAccountImpersonationAnalysis($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis::class); + $this->service_account_impersonation_analysis = $arr; + + return $this; + } + + /** + * Represents whether all entries in the + * [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] + * and + * [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] + * have been fully explored to answer the query in the request. + * + * Generated from protobuf field bool fully_explored = 3; + * @return bool + */ + public function getFullyExplored() + { + return $this->fully_explored; + } + + /** + * Represents whether all entries in the + * [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] + * and + * [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] + * have been fully explored to answer the query in the request. + * + * Generated from protobuf field bool fully_explored = 3; + * @param bool $var + * @return $this + */ + public function setFullyExplored($var) + { + GPBUtil::checkBool($var); + $this->fully_explored = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyResponse/IamPolicyAnalysis.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyResponse/IamPolicyAnalysis.php new file mode 100644 index 000000000000..843316999d92 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeIamPolicyResponse/IamPolicyAnalysis.php @@ -0,0 +1,198 @@ +google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + */ +class IamPolicyAnalysis extends \Google\Protobuf\Internal\Message +{ + /** + * The analysis query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1; + */ + protected $analysis_query = null; + /** + * A list of + * [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] + * that matches the analysis query, or empty if no result is found. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult analysis_results = 2; + */ + private $analysis_results; + /** + * Represents whether all entries in the + * [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] + * have been fully explored to answer the query. + * + * Generated from protobuf field bool fully_explored = 3; + */ + protected $fully_explored = false; + /** + * A list of non-critical errors happened during the query handling. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisState non_critical_errors = 5; + */ + private $non_critical_errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery $analysis_query + * The analysis query. + * @type array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult>|\Google\Protobuf\Internal\RepeatedField $analysis_results + * A list of + * [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] + * that matches the analysis query, or empty if no result is found. + * @type bool $fully_explored + * Represents whether all entries in the + * [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] + * have been fully explored to answer the query. + * @type array<\Google\Cloud\Asset\V1\IamPolicyAnalysisState>|\Google\Protobuf\Internal\RepeatedField $non_critical_errors + * A list of non-critical errors happened during the query handling. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The analysis query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery|null + */ + public function getAnalysisQuery() + { + return $this->analysis_query; + } + + public function hasAnalysisQuery() + { + return isset($this->analysis_query); + } + + public function clearAnalysisQuery() + { + unset($this->analysis_query); + } + + /** + * The analysis query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery $var + * @return $this + */ + public function setAnalysisQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery::class); + $this->analysis_query = $var; + + return $this; + } + + /** + * A list of + * [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] + * that matches the analysis query, or empty if no result is found. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult analysis_results = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnalysisResults() + { + return $this->analysis_results; + } + + /** + * A list of + * [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] + * that matches the analysis query, or empty if no result is found. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult analysis_results = 2; + * @param array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnalysisResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult::class); + $this->analysis_results = $arr; + + return $this; + } + + /** + * Represents whether all entries in the + * [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] + * have been fully explored to answer the query. + * + * Generated from protobuf field bool fully_explored = 3; + * @return bool + */ + public function getFullyExplored() + { + return $this->fully_explored; + } + + /** + * Represents whether all entries in the + * [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] + * have been fully explored to answer the query. + * + * Generated from protobuf field bool fully_explored = 3; + * @param bool $var + * @return $this + */ + public function setFullyExplored($var) + { + GPBUtil::checkBool($var); + $this->fully_explored = $var; + + return $this; + } + + /** + * A list of non-critical errors happened during the query handling. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisState non_critical_errors = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNonCriticalErrors() + { + return $this->non_critical_errors; + } + + /** + * A list of non-critical errors happened during the query handling. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisState non_critical_errors = 5; + * @param array<\Google\Cloud\Asset\V1\IamPolicyAnalysisState>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNonCriticalErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\IamPolicyAnalysisState::class); + $this->non_critical_errors = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IamPolicyAnalysis::class, \Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse_IamPolicyAnalysis::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeMoveRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeMoveRequest.php new file mode 100644 index 000000000000..f96f7886a4a7 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeMoveRequest.php @@ -0,0 +1,167 @@ +google.cloud.asset.v1.AnalyzeMoveRequest + */ +class AnalyzeMoveRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource to perform the analysis against. + * Only Google Cloud projects are supported as of today. Hence, this can only + * be a project ID (such as "projects/my-project-id") or a project number + * (such as "projects/12345"). + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $resource = ''; + /** + * Required. Name of the Google Cloud folder or organization to reparent the + * target resource. The analysis will be performed against hypothetically + * moving the resource to this specified desitination parent. This can only be + * a folder number (such as "folders/123") or an organization number (such as + * "organizations/123"). + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $destination_parent = ''; + /** + * Analysis view indicating what information should be included in the + * analysis response. If unspecified, the default view is FULL. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView view = 3; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * Required. Name of the resource to perform the analysis against. + * Only Google Cloud projects are supported as of today. Hence, this can only + * be a project ID (such as "projects/my-project-id") or a project number + * (such as "projects/12345"). + * @type string $destination_parent + * Required. Name of the Google Cloud folder or organization to reparent the + * target resource. The analysis will be performed against hypothetically + * moving the resource to this specified desitination parent. This can only be + * a folder number (such as "folders/123") or an organization number (such as + * "organizations/123"). + * @type int $view + * Analysis view indicating what information should be included in the + * analysis response. If unspecified, the default view is FULL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource to perform the analysis against. + * Only Google Cloud projects are supported as of today. Hence, this can only + * be a project ID (such as "projects/my-project-id") or a project number + * (such as "projects/12345"). + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Required. Name of the resource to perform the analysis against. + * Only Google Cloud projects are supported as of today. Hence, this can only + * be a project ID (such as "projects/my-project-id") or a project number + * (such as "projects/12345"). + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * Required. Name of the Google Cloud folder or organization to reparent the + * target resource. The analysis will be performed against hypothetically + * moving the resource to this specified desitination parent. This can only be + * a folder number (such as "folders/123") or an organization number (such as + * "organizations/123"). + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDestinationParent() + { + return $this->destination_parent; + } + + /** + * Required. Name of the Google Cloud folder or organization to reparent the + * target resource. The analysis will be performed against hypothetically + * moving the resource to this specified desitination parent. This can only be + * a folder number (such as "folders/123") or an organization number (such as + * "organizations/123"). + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDestinationParent($var) + { + GPBUtil::checkString($var, True); + $this->destination_parent = $var; + + return $this; + } + + /** + * Analysis view indicating what information should be included in the + * analysis response. If unspecified, the default view is FULL. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView view = 3; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Analysis view indicating what information should be included in the + * analysis response. If unspecified, the default view is FULL. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView view = 3; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Asset\V1\AnalyzeMoveRequest\AnalysisView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeMoveRequest/AnalysisView.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeMoveRequest/AnalysisView.php new file mode 100644 index 000000000000..312e0a876f42 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeMoveRequest/AnalysisView.php @@ -0,0 +1,67 @@ +google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView + */ +class AnalysisView +{ + /** + * The default/unset value. + * The API will default to the FULL view. + * + * Generated from protobuf enum ANALYSIS_VIEW_UNSPECIFIED = 0; + */ + const ANALYSIS_VIEW_UNSPECIFIED = 0; + /** + * Full analysis including all level of impacts of the specified resource + * move. + * + * Generated from protobuf enum FULL = 1; + */ + const FULL = 1; + /** + * Basic analysis only including blockers which will prevent the specified + * resource move at runtime. + * + * Generated from protobuf enum BASIC = 2; + */ + const BASIC = 2; + + private static $valueToName = [ + self::ANALYSIS_VIEW_UNSPECIFIED => 'ANALYSIS_VIEW_UNSPECIFIED', + self::FULL => 'FULL', + self::BASIC => 'BASIC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnalysisView::class, \Google\Cloud\Asset\V1\AnalyzeMoveRequest_AnalysisView::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeMoveResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeMoveResponse.php new file mode 100644 index 000000000000..3ca62f6f7935 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeMoveResponse.php @@ -0,0 +1,71 @@ +google.cloud.asset.v1.AnalyzeMoveResponse + */ +class AnalyzeMoveResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of analyses returned from performing the intended resource move + * analysis. The analysis is grouped by different Google Cloud services. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.MoveAnalysis move_analysis = 1; + */ + private $move_analysis; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\MoveAnalysis>|\Google\Protobuf\Internal\RepeatedField $move_analysis + * The list of analyses returned from performing the intended resource move + * analysis. The analysis is grouped by different Google Cloud services. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The list of analyses returned from performing the intended resource move + * analysis. The analysis is grouped by different Google Cloud services. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.MoveAnalysis move_analysis = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMoveAnalysis() + { + return $this->move_analysis; + } + + /** + * The list of analyses returned from performing the intended resource move + * analysis. The analysis is grouped by different Google Cloud services. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.MoveAnalysis move_analysis = 1; + * @param array<\Google\Cloud\Asset\V1\MoveAnalysis>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMoveAnalysis($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\MoveAnalysis::class); + $this->move_analysis = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPoliciesRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPoliciesRequest.php new file mode 100644 index 000000000000..c32dc2c817c1 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPoliciesRequest.php @@ -0,0 +1,306 @@ +google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + */ +class AnalyzeOrgPoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope = ''; + /** + * Required. The name of the constraint to analyze organization policies for. + * The response only contains analyzed organization policies for the provided + * constraint. + * + * Generated from protobuf field string constraint = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $constraint = ''; + /** + * The expression to filter + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. + * Filtering is currently available for bare literal values and the following + * fields: + * * consolidated_policy.attached_resource + * * consolidated_policy.rules.enforce + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the Organization Policy results attached to "folders/001". + * + * Generated from protobuf field string filter = 3; + */ + protected $filter = ''; + /** + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results] + * will contain 20 items with a maximum of 200. + * + * Generated from protobuf field optional int32 page_size = 4; + */ + protected $page_size = null; + /** + * The pagination token to retrieve the next page. + * + * Generated from protobuf field string page_token = 5; + */ + protected $page_token = ''; + + /** + * @param string $scope Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param string $constraint Required. The name of the constraint to analyze organization policies for. + * The response only contains analyzed organization policies for the provided + * constraint. + * @param string $filter The expression to filter + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. + * Filtering is currently available for bare literal values and the following + * fields: + * * consolidated_policy.attached_resource + * * consolidated_policy.rules.enforce + * + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the Organization Policy results attached to "folders/001". + * + * @return \Google\Cloud\Asset\V1\AnalyzeOrgPoliciesRequest + * + * @experimental + */ + public static function build(string $scope, string $constraint, string $filter): self + { + return (new self()) + ->setScope($scope) + ->setConstraint($constraint) + ->setFilter($filter); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @type string $constraint + * Required. The name of the constraint to analyze organization policies for. + * The response only contains analyzed organization policies for the provided + * constraint. + * @type string $filter + * The expression to filter + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. + * Filtering is currently available for bare literal values and the following + * fields: + * * consolidated_policy.attached_resource + * * consolidated_policy.rules.enforce + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the Organization Policy results attached to "folders/001". + * @type int $page_size + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results] + * will contain 20 items with a maximum of 200. + * @type string $page_token + * The pagination token to retrieve the next page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + + /** + * Required. The name of the constraint to analyze organization policies for. + * The response only contains analyzed organization policies for the provided + * constraint. + * + * Generated from protobuf field string constraint = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getConstraint() + { + return $this->constraint; + } + + /** + * Required. The name of the constraint to analyze organization policies for. + * The response only contains analyzed organization policies for the provided + * constraint. + * + * Generated from protobuf field string constraint = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setConstraint($var) + { + GPBUtil::checkString($var, True); + $this->constraint = $var; + + return $this; + } + + /** + * The expression to filter + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. + * Filtering is currently available for bare literal values and the following + * fields: + * * consolidated_policy.attached_resource + * * consolidated_policy.rules.enforce + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the Organization Policy results attached to "folders/001". + * + * Generated from protobuf field string filter = 3; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The expression to filter + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. + * Filtering is currently available for bare literal values and the following + * fields: + * * consolidated_policy.attached_resource + * * consolidated_policy.rules.enforce + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the Organization Policy results attached to "folders/001". + * + * Generated from protobuf field string filter = 3; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results] + * will contain 20 items with a maximum of 200. + * + * Generated from protobuf field optional int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return isset($this->page_size) ? $this->page_size : 0; + } + + public function hasPageSize() + { + return isset($this->page_size); + } + + public function clearPageSize() + { + unset($this->page_size); + } + + /** + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results] + * will contain 20 items with a maximum of 200. + * + * Generated from protobuf field optional int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The pagination token to retrieve the next page. + * + * Generated from protobuf field string page_token = 5; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The pagination token to retrieve the next page. + * + * Generated from protobuf field string page_token = 5; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPoliciesResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPoliciesResponse.php new file mode 100644 index 000000000000..f04dfde17d23 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPoliciesResponse.php @@ -0,0 +1,162 @@ +google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + */ +class AnalyzeOrgPoliciesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The organization policies under the + * [AnalyzeOrgPoliciesRequest.scope][google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.scope] + * with the + * [AnalyzeOrgPoliciesRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.constraint]. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult org_policy_results = 1; + */ + private $org_policy_results; + /** + * The definition of the constraint in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint constraint = 2; + */ + protected $constraint = null; + /** + * The page token to fetch the next page for + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. + * + * Generated from protobuf field string next_page_token = 3; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\AnalyzeOrgPoliciesResponse\OrgPolicyResult>|\Google\Protobuf\Internal\RepeatedField $org_policy_results + * The organization policies under the + * [AnalyzeOrgPoliciesRequest.scope][google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.scope] + * with the + * [AnalyzeOrgPoliciesRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.constraint]. + * @type \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint $constraint + * The definition of the constraint in the request. + * @type string $next_page_token + * The page token to fetch the next page for + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The organization policies under the + * [AnalyzeOrgPoliciesRequest.scope][google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.scope] + * with the + * [AnalyzeOrgPoliciesRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.constraint]. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult org_policy_results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOrgPolicyResults() + { + return $this->org_policy_results; + } + + /** + * The organization policies under the + * [AnalyzeOrgPoliciesRequest.scope][google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.scope] + * with the + * [AnalyzeOrgPoliciesRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.constraint]. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult org_policy_results = 1; + * @param array<\Google\Cloud\Asset\V1\AnalyzeOrgPoliciesResponse\OrgPolicyResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOrgPolicyResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\AnalyzeOrgPoliciesResponse\OrgPolicyResult::class); + $this->org_policy_results = $arr; + + return $this; + } + + /** + * The definition of the constraint in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint constraint = 2; + * @return \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint|null + */ + public function getConstraint() + { + return $this->constraint; + } + + public function hasConstraint() + { + return isset($this->constraint); + } + + public function clearConstraint() + { + unset($this->constraint); + } + + /** + * The definition of the constraint in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint constraint = 2; + * @param \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint $var + * @return $this + */ + public function setConstraint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint::class); + $this->constraint = $var; + + return $this; + } + + /** + * The page token to fetch the next page for + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. + * + * Generated from protobuf field string next_page_token = 3; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The page token to fetch the next page for + * [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. + * + * Generated from protobuf field string next_page_token = 3; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPoliciesResponse/OrgPolicyResult.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPoliciesResponse/OrgPolicyResult.php new file mode 100644 index 000000000000..68b3e783edcd --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPoliciesResponse/OrgPolicyResult.php @@ -0,0 +1,272 @@ +google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + */ +class OrgPolicyResult extends \Google\Protobuf\Internal\Message +{ + /** + * The consolidated organization policy for the analyzed resource. The + * consolidated organization policy is computed by merging and evaluating + * [AnalyzeOrgPoliciesResponse.policy_bundle][]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicy consolidated_policy = 1; + */ + protected $consolidated_policy = null; + /** + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][]. + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy policy_bundle = 2; + */ + private $policy_bundle; + /** + * The project that this consolidated policy belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the consolidated + * policy belongs to a project. + * + * Generated from protobuf field string project = 3; + */ + protected $project = ''; + /** + * The folder(s) that this consolidated policy belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the consolidated + * policy belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 4; + */ + private $folders; + /** + * The organization that this consolidated policy belongs to, in the format + * of organizations/{ORGANIZATION_NUMBER}. This field is available when the + * consolidated policy belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 5; + */ + protected $organization = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\AnalyzerOrgPolicy $consolidated_policy + * The consolidated organization policy for the analyzed resource. The + * consolidated organization policy is computed by merging and evaluating + * [AnalyzeOrgPoliciesResponse.policy_bundle][]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * @type array<\Google\Cloud\Asset\V1\AnalyzerOrgPolicy>|\Google\Protobuf\Internal\RepeatedField $policy_bundle + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][]. + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * @type string $project + * The project that this consolidated policy belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the consolidated + * policy belongs to a project. + * @type array|\Google\Protobuf\Internal\RepeatedField $folders + * The folder(s) that this consolidated policy belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the consolidated + * policy belongs (directly or cascadingly) to one or more folders. + * @type string $organization + * The organization that this consolidated policy belongs to, in the format + * of organizations/{ORGANIZATION_NUMBER}. This field is available when the + * consolidated policy belongs (directly or cascadingly) to an organization. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The consolidated organization policy for the analyzed resource. The + * consolidated organization policy is computed by merging and evaluating + * [AnalyzeOrgPoliciesResponse.policy_bundle][]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicy consolidated_policy = 1; + * @return \Google\Cloud\Asset\V1\AnalyzerOrgPolicy|null + */ + public function getConsolidatedPolicy() + { + return $this->consolidated_policy; + } + + public function hasConsolidatedPolicy() + { + return isset($this->consolidated_policy); + } + + public function clearConsolidatedPolicy() + { + unset($this->consolidated_policy); + } + + /** + * The consolidated organization policy for the analyzed resource. The + * consolidated organization policy is computed by merging and evaluating + * [AnalyzeOrgPoliciesResponse.policy_bundle][]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicy consolidated_policy = 1; + * @param \Google\Cloud\Asset\V1\AnalyzerOrgPolicy $var + * @return $this + */ + public function setConsolidatedPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicy::class); + $this->consolidated_policy = $var; + + return $this; + } + + /** + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][]. + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy policy_bundle = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPolicyBundle() + { + return $this->policy_bundle; + } + + /** + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][]. + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy policy_bundle = 2; + * @param array<\Google\Cloud\Asset\V1\AnalyzerOrgPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPolicyBundle($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\AnalyzerOrgPolicy::class); + $this->policy_bundle = $arr; + + return $this; + } + + /** + * The project that this consolidated policy belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the consolidated + * policy belongs to a project. + * + * Generated from protobuf field string project = 3; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * The project that this consolidated policy belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the consolidated + * policy belongs to a project. + * + * Generated from protobuf field string project = 3; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The folder(s) that this consolidated policy belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the consolidated + * policy belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFolders() + { + return $this->folders; + } + + /** + * The folder(s) that this consolidated policy belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the consolidated + * policy belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFolders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->folders = $arr; + + return $this; + } + + /** + * The organization that this consolidated policy belongs to, in the format + * of organizations/{ORGANIZATION_NUMBER}. This field is available when the + * consolidated policy belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 5; + * @return string + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * The organization that this consolidated policy belongs to, in the format + * of organizations/{ORGANIZATION_NUMBER}. This field is available when the + * consolidated policy belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 5; + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OrgPolicyResult::class, \Google\Cloud\Asset\V1\AnalyzeOrgPoliciesResponse_OrgPolicyResult::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsRequest.php new file mode 100644 index 000000000000..ed466722b73c --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsRequest.php @@ -0,0 +1,392 @@ +google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + */ +class AnalyzeOrgPolicyGovernedAssetsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output assets will + * also be limited to the ones governed by those in-scope organization + * policies. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope = ''; + /** + * Required. The name of the constraint to analyze governed assets for. The + * analysis only contains analyzed organization policies for the provided + * constraint. + * + * Generated from protobuf field string constraint = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $constraint = ''; + /** + * The expression to filter + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets]. + * For governed resources, filtering is currently available for bare literal + * values and the following fields: + * * governed_resource.project + * * governed_resource.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_resource.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_resource.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_resource.project="projects/12345678"` + * will return all the governed resources under "projects/12345678", + * including the project itself if applicable. + * For governed IAM policies, filtering is currently available for bare + * literal values and the following fields: + * * governed_iam_policy.project + * * governed_iam_policy.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_iam_policy.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_iam_policy.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_iam_policy.folders:"folders/12345678"` + * will return all the governed IAM policies under "folders/001". + * + * Generated from protobuf field string filter = 3; + */ + protected $filter = ''; + /** + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets] + * will contain 100 items with a maximum of 200. + * + * Generated from protobuf field optional int32 page_size = 4; + */ + protected $page_size = null; + /** + * The pagination token to retrieve the next page. + * + * Generated from protobuf field string page_token = 5; + */ + protected $page_token = ''; + + /** + * @param string $scope Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output assets will + * also be limited to the ones governed by those in-scope organization + * policies. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param string $constraint Required. The name of the constraint to analyze governed assets for. The + * analysis only contains analyzed organization policies for the provided + * constraint. + * @param string $filter The expression to filter + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets]. + * + * For governed resources, filtering is currently available for bare literal + * values and the following fields: + * * governed_resource.project + * * governed_resource.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_resource.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_resource.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_resource.project="projects/12345678"` + * will return all the governed resources under "projects/12345678", + * including the project itself if applicable. + * + * For governed IAM policies, filtering is currently available for bare + * literal values and the following fields: + * * governed_iam_policy.project + * * governed_iam_policy.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_iam_policy.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_iam_policy.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_iam_policy.folders:"folders/12345678"` + * will return all the governed IAM policies under "folders/001". + * + * @return \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsRequest + * + * @experimental + */ + public static function build(string $scope, string $constraint, string $filter): self + { + return (new self()) + ->setScope($scope) + ->setConstraint($constraint) + ->setFilter($filter); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output assets will + * also be limited to the ones governed by those in-scope organization + * policies. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @type string $constraint + * Required. The name of the constraint to analyze governed assets for. The + * analysis only contains analyzed organization policies for the provided + * constraint. + * @type string $filter + * The expression to filter + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets]. + * For governed resources, filtering is currently available for bare literal + * values and the following fields: + * * governed_resource.project + * * governed_resource.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_resource.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_resource.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_resource.project="projects/12345678"` + * will return all the governed resources under "projects/12345678", + * including the project itself if applicable. + * For governed IAM policies, filtering is currently available for bare + * literal values and the following fields: + * * governed_iam_policy.project + * * governed_iam_policy.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_iam_policy.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_iam_policy.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_iam_policy.folders:"folders/12345678"` + * will return all the governed IAM policies under "folders/001". + * @type int $page_size + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets] + * will contain 100 items with a maximum of 200. + * @type string $page_token + * The pagination token to retrieve the next page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output assets will + * also be limited to the ones governed by those in-scope organization + * policies. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output assets will + * also be limited to the ones governed by those in-scope organization + * policies. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + + /** + * Required. The name of the constraint to analyze governed assets for. The + * analysis only contains analyzed organization policies for the provided + * constraint. + * + * Generated from protobuf field string constraint = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getConstraint() + { + return $this->constraint; + } + + /** + * Required. The name of the constraint to analyze governed assets for. The + * analysis only contains analyzed organization policies for the provided + * constraint. + * + * Generated from protobuf field string constraint = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setConstraint($var) + { + GPBUtil::checkString($var, True); + $this->constraint = $var; + + return $this; + } + + /** + * The expression to filter + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets]. + * For governed resources, filtering is currently available for bare literal + * values and the following fields: + * * governed_resource.project + * * governed_resource.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_resource.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_resource.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_resource.project="projects/12345678"` + * will return all the governed resources under "projects/12345678", + * including the project itself if applicable. + * For governed IAM policies, filtering is currently available for bare + * literal values and the following fields: + * * governed_iam_policy.project + * * governed_iam_policy.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_iam_policy.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_iam_policy.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_iam_policy.folders:"folders/12345678"` + * will return all the governed IAM policies under "folders/001". + * + * Generated from protobuf field string filter = 3; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The expression to filter + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets]. + * For governed resources, filtering is currently available for bare literal + * values and the following fields: + * * governed_resource.project + * * governed_resource.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_resource.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_resource.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_resource.project="projects/12345678"` + * will return all the governed resources under "projects/12345678", + * including the project itself if applicable. + * For governed IAM policies, filtering is currently available for bare + * literal values and the following fields: + * * governed_iam_policy.project + * * governed_iam_policy.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_iam_policy.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_iam_policy.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_iam_policy.folders:"folders/12345678"` + * will return all the governed IAM policies under "folders/001". + * + * Generated from protobuf field string filter = 3; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets] + * will contain 100 items with a maximum of 200. + * + * Generated from protobuf field optional int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return isset($this->page_size) ? $this->page_size : 0; + } + + public function hasPageSize() + { + return isset($this->page_size); + } + + public function clearPageSize() + { + unset($this->page_size); + } + + /** + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets] + * will contain 100 items with a maximum of 200. + * + * Generated from protobuf field optional int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The pagination token to retrieve the next page. + * + * Generated from protobuf field string page_token = 5; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The pagination token to retrieve the next page. + * + * Generated from protobuf field string page_token = 5; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse.php new file mode 100644 index 000000000000..afe94d18cbcf --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse.php @@ -0,0 +1,150 @@ +google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + */ +class AnalyzeOrgPolicyGovernedAssetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of the analyzed governed assets. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset governed_assets = 1; + */ + private $governed_assets; + /** + * The definition of the constraint in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint constraint = 2; + */ + protected $constraint = null; + /** + * The page token to fetch the next page for + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets]. + * + * Generated from protobuf field string next_page_token = 3; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse\GovernedAsset>|\Google\Protobuf\Internal\RepeatedField $governed_assets + * The list of the analyzed governed assets. + * @type \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint $constraint + * The definition of the constraint in the request. + * @type string $next_page_token + * The page token to fetch the next page for + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The list of the analyzed governed assets. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset governed_assets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGovernedAssets() + { + return $this->governed_assets; + } + + /** + * The list of the analyzed governed assets. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset governed_assets = 1; + * @param array<\Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse\GovernedAsset>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGovernedAssets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse\GovernedAsset::class); + $this->governed_assets = $arr; + + return $this; + } + + /** + * The definition of the constraint in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint constraint = 2; + * @return \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint|null + */ + public function getConstraint() + { + return $this->constraint; + } + + public function hasConstraint() + { + return isset($this->constraint); + } + + public function clearConstraint() + { + unset($this->constraint); + } + + /** + * The definition of the constraint in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint constraint = 2; + * @param \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint $var + * @return $this + */ + public function setConstraint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint::class); + $this->constraint = $var; + + return $this; + } + + /** + * The page token to fetch the next page for + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets]. + * + * Generated from protobuf field string next_page_token = 3; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The page token to fetch the next page for + * [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets]. + * + * Generated from protobuf field string next_page_token = 3; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse/GovernedAsset.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse/GovernedAsset.php new file mode 100644 index 000000000000..495a1be1b76a --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse/GovernedAsset.php @@ -0,0 +1,235 @@ +google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + */ +class GovernedAsset extends \Google\Protobuf\Internal\Message +{ + /** + * The consolidated policy for the analyzed asset. The consolidated + * policy is computed by merging and evaluating + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policy_bundle][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policy_bundle]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicy consolidated_policy = 3; + */ + protected $consolidated_policy = null; + /** + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][] + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy policy_bundle = 4; + */ + private $policy_bundle; + protected $governed_asset; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse\GovernedResource $governed_resource + * A Google Cloud resource governed by the organization + * policies of the + * [AnalyzeOrgPolicyGovernedAssetsRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.constraint]. + * @type \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse\GovernedIamPolicy $governed_iam_policy + * An IAM policy governed by the organization + * policies of the + * [AnalyzeOrgPolicyGovernedAssetsRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.constraint]. + * @type \Google\Cloud\Asset\V1\AnalyzerOrgPolicy $consolidated_policy + * The consolidated policy for the analyzed asset. The consolidated + * policy is computed by merging and evaluating + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policy_bundle][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policy_bundle]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * @type array<\Google\Cloud\Asset\V1\AnalyzerOrgPolicy>|\Google\Protobuf\Internal\RepeatedField $policy_bundle + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][] + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * A Google Cloud resource governed by the organization + * policies of the + * [AnalyzeOrgPolicyGovernedAssetsRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.constraint]. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource governed_resource = 1; + * @return \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse\GovernedResource|null + */ + public function getGovernedResource() + { + return $this->readOneof(1); + } + + public function hasGovernedResource() + { + return $this->hasOneof(1); + } + + /** + * A Google Cloud resource governed by the organization + * policies of the + * [AnalyzeOrgPolicyGovernedAssetsRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.constraint]. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource governed_resource = 1; + * @param \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse\GovernedResource $var + * @return $this + */ + public function setGovernedResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse\GovernedResource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * An IAM policy governed by the organization + * policies of the + * [AnalyzeOrgPolicyGovernedAssetsRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.constraint]. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy governed_iam_policy = 2; + * @return \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse\GovernedIamPolicy|null + */ + public function getGovernedIamPolicy() + { + return $this->readOneof(2); + } + + public function hasGovernedIamPolicy() + { + return $this->hasOneof(2); + } + + /** + * An IAM policy governed by the organization + * policies of the + * [AnalyzeOrgPolicyGovernedAssetsRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.constraint]. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy governed_iam_policy = 2; + * @param \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse\GovernedIamPolicy $var + * @return $this + */ + public function setGovernedIamPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse\GovernedIamPolicy::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The consolidated policy for the analyzed asset. The consolidated + * policy is computed by merging and evaluating + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policy_bundle][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policy_bundle]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicy consolidated_policy = 3; + * @return \Google\Cloud\Asset\V1\AnalyzerOrgPolicy|null + */ + public function getConsolidatedPolicy() + { + return $this->consolidated_policy; + } + + public function hasConsolidatedPolicy() + { + return isset($this->consolidated_policy); + } + + public function clearConsolidatedPolicy() + { + unset($this->consolidated_policy); + } + + /** + * The consolidated policy for the analyzed asset. The consolidated + * policy is computed by merging and evaluating + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policy_bundle][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policy_bundle]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicy consolidated_policy = 3; + * @param \Google\Cloud\Asset\V1\AnalyzerOrgPolicy $var + * @return $this + */ + public function setConsolidatedPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicy::class); + $this->consolidated_policy = $var; + + return $this; + } + + /** + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][] + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy policy_bundle = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPolicyBundle() + { + return $this->policy_bundle; + } + + /** + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][] + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy policy_bundle = 4; + * @param array<\Google\Cloud\Asset\V1\AnalyzerOrgPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPolicyBundle($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\AnalyzerOrgPolicy::class); + $this->policy_bundle = $arr; + + return $this; + } + + /** + * @return string + */ + public function getGovernedAsset() + { + return $this->whichOneof("governed_asset"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GovernedAsset::class, \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse_GovernedAsset::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse/GovernedIamPolicy.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse/GovernedIamPolicy.php new file mode 100644 index 000000000000..32ee6c4a50a6 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse/GovernedIamPolicy.php @@ -0,0 +1,319 @@ +google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + */ +class GovernedIamPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The full resource name of the resource on which this IAM policy is set. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * + * Generated from protobuf field string attached_resource = 1; + */ + protected $attached_resource = ''; + /** + * The IAM policy directly set on the given resource. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 2; + */ + protected $policy = null; + /** + * The project that this IAM policy belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the IAM policy + * belongs to a project. + * + * Generated from protobuf field string project = 5; + */ + protected $project = ''; + /** + * The folder(s) that this IAM policy belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the IAM policy + * belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 6; + */ + private $folders; + /** + * The organization that this IAM policy belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * IAM policy belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 7; + */ + protected $organization = ''; + /** + * The asset type of the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.attached_resource][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.attached_resource]. + * Example: + * `cloudresourcemanager.googleapis.com/Project` + * See [Cloud Asset Inventory Supported Asset + * Types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for all supported asset types. + * + * Generated from protobuf field string asset_type = 8; + */ + protected $asset_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attached_resource + * The full resource name of the resource on which this IAM policy is set. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * @type \Google\Cloud\Iam\V1\Policy $policy + * The IAM policy directly set on the given resource. + * @type string $project + * The project that this IAM policy belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the IAM policy + * belongs to a project. + * @type array|\Google\Protobuf\Internal\RepeatedField $folders + * The folder(s) that this IAM policy belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the IAM policy + * belongs (directly or cascadingly) to one or more folders. + * @type string $organization + * The organization that this IAM policy belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * IAM policy belongs (directly or cascadingly) to an organization. + * @type string $asset_type + * The asset type of the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.attached_resource][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.attached_resource]. + * Example: + * `cloudresourcemanager.googleapis.com/Project` + * See [Cloud Asset Inventory Supported Asset + * Types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for all supported asset types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The full resource name of the resource on which this IAM policy is set. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * + * Generated from protobuf field string attached_resource = 1; + * @return string + */ + public function getAttachedResource() + { + return $this->attached_resource; + } + + /** + * The full resource name of the resource on which this IAM policy is set. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * + * Generated from protobuf field string attached_resource = 1; + * @param string $var + * @return $this + */ + public function setAttachedResource($var) + { + GPBUtil::checkString($var, True); + $this->attached_resource = $var; + + return $this; + } + + /** + * The IAM policy directly set on the given resource. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 2; + * @return \Google\Cloud\Iam\V1\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * The IAM policy directly set on the given resource. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 2; + * @param \Google\Cloud\Iam\V1\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Policy::class); + $this->policy = $var; + + return $this; + } + + /** + * The project that this IAM policy belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the IAM policy + * belongs to a project. + * + * Generated from protobuf field string project = 5; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * The project that this IAM policy belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the IAM policy + * belongs to a project. + * + * Generated from protobuf field string project = 5; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The folder(s) that this IAM policy belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the IAM policy + * belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFolders() + { + return $this->folders; + } + + /** + * The folder(s) that this IAM policy belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the IAM policy + * belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFolders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->folders = $arr; + + return $this; + } + + /** + * The organization that this IAM policy belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * IAM policy belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 7; + * @return string + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * The organization that this IAM policy belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * IAM policy belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 7; + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + + /** + * The asset type of the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.attached_resource][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.attached_resource]. + * Example: + * `cloudresourcemanager.googleapis.com/Project` + * See [Cloud Asset Inventory Supported Asset + * Types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for all supported asset types. + * + * Generated from protobuf field string asset_type = 8; + * @return string + */ + public function getAssetType() + { + return $this->asset_type; + } + + /** + * The asset type of the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.attached_resource][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.attached_resource]. + * Example: + * `cloudresourcemanager.googleapis.com/Project` + * See [Cloud Asset Inventory Supported Asset + * Types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for all supported asset types. + * + * Generated from protobuf field string asset_type = 8; + * @param string $var + * @return $this + */ + public function setAssetType($var) + { + GPBUtil::checkString($var, True); + $this->asset_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GovernedIamPolicy::class, \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse_GovernedIamPolicy::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse/GovernedResource.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse/GovernedResource.php new file mode 100644 index 000000000000..2b9b9a6bad21 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedAssetsResponse/GovernedResource.php @@ -0,0 +1,343 @@ +google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + */ +class GovernedResource extends \Google\Protobuf\Internal\Message +{ + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the Google Cloud resource. + * + * Generated from protobuf field string full_resource_name = 1; + */ + protected $full_resource_name = ''; + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the parent of + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name]. + * + * Generated from protobuf field string parent = 2; + */ + protected $parent = ''; + /** + * The project that this resource belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * + * Generated from protobuf field string project = 5; + */ + protected $project = ''; + /** + * The folder(s) that this resource belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 6; + */ + private $folders; + /** + * The organization that this resource belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 7; + */ + protected $organization = ''; + /** + * The asset type of the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name] + * Example: + * `cloudresourcemanager.googleapis.com/Project` + * See [Cloud Asset Inventory Supported Asset + * Types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for all supported asset types. + * + * Generated from protobuf field string asset_type = 8; + */ + protected $asset_type = ''; + /** + * The effective tags on this resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.EffectiveTagDetails effective_tags = 9; + */ + private $effective_tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $full_resource_name + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the Google Cloud resource. + * @type string $parent + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the parent of + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name]. + * @type string $project + * The project that this resource belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * @type array|\Google\Protobuf\Internal\RepeatedField $folders + * The folder(s) that this resource belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs (directly or cascadingly) to one or more folders. + * @type string $organization + * The organization that this resource belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs (directly or cascadingly) to an organization. + * @type string $asset_type + * The asset type of the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name] + * Example: + * `cloudresourcemanager.googleapis.com/Project` + * See [Cloud Asset Inventory Supported Asset + * Types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for all supported asset types. + * @type array<\Google\Cloud\Asset\V1\EffectiveTagDetails>|\Google\Protobuf\Internal\RepeatedField $effective_tags + * The effective tags on this resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the Google Cloud resource. + * + * Generated from protobuf field string full_resource_name = 1; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the Google Cloud resource. + * + * Generated from protobuf field string full_resource_name = 1; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the parent of + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name]. + * + * Generated from protobuf field string parent = 2; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the parent of + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name]. + * + * Generated from protobuf field string parent = 2; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The project that this resource belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * + * Generated from protobuf field string project = 5; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * The project that this resource belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * + * Generated from protobuf field string project = 5; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The folder(s) that this resource belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFolders() + { + return $this->folders; + } + + /** + * The folder(s) that this resource belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFolders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->folders = $arr; + + return $this; + } + + /** + * The organization that this resource belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 7; + * @return string + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * The organization that this resource belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 7; + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + + /** + * The asset type of the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name] + * Example: + * `cloudresourcemanager.googleapis.com/Project` + * See [Cloud Asset Inventory Supported Asset + * Types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for all supported asset types. + * + * Generated from protobuf field string asset_type = 8; + * @return string + */ + public function getAssetType() + { + return $this->asset_type; + } + + /** + * The asset type of the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name] + * Example: + * `cloudresourcemanager.googleapis.com/Project` + * See [Cloud Asset Inventory Supported Asset + * Types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for all supported asset types. + * + * Generated from protobuf field string asset_type = 8; + * @param string $var + * @return $this + */ + public function setAssetType($var) + { + GPBUtil::checkString($var, True); + $this->asset_type = $var; + + return $this; + } + + /** + * The effective tags on this resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.EffectiveTagDetails effective_tags = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectiveTags() + { + return $this->effective_tags; + } + + /** + * The effective tags on this resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.EffectiveTagDetails effective_tags = 9; + * @param array<\Google\Cloud\Asset\V1\EffectiveTagDetails>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectiveTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\EffectiveTagDetails::class); + $this->effective_tags = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GovernedResource::class, \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse_GovernedResource::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedContainersRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedContainersRequest.php new file mode 100644 index 000000000000..41e61f85b196 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedContainersRequest.php @@ -0,0 +1,316 @@ +google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + */ +class AnalyzeOrgPolicyGovernedContainersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output containers will + * also be limited to the ones governed by those in-scope organization + * policies. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope = ''; + /** + * Required. The name of the constraint to analyze governed containers for. + * The analysis only contains organization policies for the provided + * constraint. + * + * Generated from protobuf field string constraint = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $constraint = ''; + /** + * The expression to filter + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. + * Filtering is currently available for bare literal values and the following + * fields: + * * parent + * * consolidated_policy.rules.enforce + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * parent="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the containers under "folders/001". + * + * Generated from protobuf field string filter = 3; + */ + protected $filter = ''; + /** + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers] + * will contain 100 items with a maximum of 200. + * + * Generated from protobuf field optional int32 page_size = 4; + */ + protected $page_size = null; + /** + * The pagination token to retrieve the next page. + * + * Generated from protobuf field string page_token = 5; + */ + protected $page_token = ''; + + /** + * @param string $scope Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output containers will + * also be limited to the ones governed by those in-scope organization + * policies. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param string $constraint Required. The name of the constraint to analyze governed containers for. + * The analysis only contains organization policies for the provided + * constraint. + * @param string $filter The expression to filter + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. + * Filtering is currently available for bare literal values and the following + * fields: + * * parent + * * consolidated_policy.rules.enforce + * + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * parent="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the containers under "folders/001". + * + * @return \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedContainersRequest + * + * @experimental + */ + public static function build(string $scope, string $constraint, string $filter): self + { + return (new self()) + ->setScope($scope) + ->setConstraint($constraint) + ->setFilter($filter); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output containers will + * also be limited to the ones governed by those in-scope organization + * policies. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @type string $constraint + * Required. The name of the constraint to analyze governed containers for. + * The analysis only contains organization policies for the provided + * constraint. + * @type string $filter + * The expression to filter + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. + * Filtering is currently available for bare literal values and the following + * fields: + * * parent + * * consolidated_policy.rules.enforce + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * parent="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the containers under "folders/001". + * @type int $page_size + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers] + * will contain 100 items with a maximum of 200. + * @type string $page_token + * The pagination token to retrieve the next page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output containers will + * also be limited to the ones governed by those in-scope organization + * policies. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output containers will + * also be limited to the ones governed by those in-scope organization + * policies. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + + /** + * Required. The name of the constraint to analyze governed containers for. + * The analysis only contains organization policies for the provided + * constraint. + * + * Generated from protobuf field string constraint = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getConstraint() + { + return $this->constraint; + } + + /** + * Required. The name of the constraint to analyze governed containers for. + * The analysis only contains organization policies for the provided + * constraint. + * + * Generated from protobuf field string constraint = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setConstraint($var) + { + GPBUtil::checkString($var, True); + $this->constraint = $var; + + return $this; + } + + /** + * The expression to filter + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. + * Filtering is currently available for bare literal values and the following + * fields: + * * parent + * * consolidated_policy.rules.enforce + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * parent="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the containers under "folders/001". + * + * Generated from protobuf field string filter = 3; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The expression to filter + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. + * Filtering is currently available for bare literal values and the following + * fields: + * * parent + * * consolidated_policy.rules.enforce + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * parent="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the containers under "folders/001". + * + * Generated from protobuf field string filter = 3; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers] + * will contain 100 items with a maximum of 200. + * + * Generated from protobuf field optional int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return isset($this->page_size) ? $this->page_size : 0; + } + + public function hasPageSize() + { + return isset($this->page_size); + } + + public function clearPageSize() + { + unset($this->page_size); + } + + /** + * The maximum number of items to return per page. If unspecified, + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers] + * will contain 100 items with a maximum of 200. + * + * Generated from protobuf field optional int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The pagination token to retrieve the next page. + * + * Generated from protobuf field string page_token = 5; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The pagination token to retrieve the next page. + * + * Generated from protobuf field string page_token = 5; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedContainersResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedContainersResponse.php new file mode 100644 index 000000000000..795d1e14a8aa --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedContainersResponse.php @@ -0,0 +1,150 @@ +google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + */ +class AnalyzeOrgPolicyGovernedContainersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of the analyzed governed containers. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer governed_containers = 1; + */ + private $governed_containers; + /** + * The definition of the constraint in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint constraint = 2; + */ + protected $constraint = null; + /** + * The page token to fetch the next page for + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. + * + * Generated from protobuf field string next_page_token = 3; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedContainersResponse\GovernedContainer>|\Google\Protobuf\Internal\RepeatedField $governed_containers + * The list of the analyzed governed containers. + * @type \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint $constraint + * The definition of the constraint in the request. + * @type string $next_page_token + * The page token to fetch the next page for + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The list of the analyzed governed containers. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer governed_containers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGovernedContainers() + { + return $this->governed_containers; + } + + /** + * The list of the analyzed governed containers. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer governed_containers = 1; + * @param array<\Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedContainersResponse\GovernedContainer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGovernedContainers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedContainersResponse\GovernedContainer::class); + $this->governed_containers = $arr; + + return $this; + } + + /** + * The definition of the constraint in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint constraint = 2; + * @return \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint|null + */ + public function getConstraint() + { + return $this->constraint; + } + + public function hasConstraint() + { + return isset($this->constraint); + } + + public function clearConstraint() + { + unset($this->constraint); + } + + /** + * The definition of the constraint in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint constraint = 2; + * @param \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint $var + * @return $this + */ + public function setConstraint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint::class); + $this->constraint = $var; + + return $this; + } + + /** + * The page token to fetch the next page for + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. + * + * Generated from protobuf field string next_page_token = 3; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The page token to fetch the next page for + * [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. + * + * Generated from protobuf field string next_page_token = 3; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedContainersResponse/GovernedContainer.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedContainersResponse/GovernedContainer.php new file mode 100644 index 000000000000..117e289991fa --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzeOrgPolicyGovernedContainersResponse/GovernedContainer.php @@ -0,0 +1,396 @@ +google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + */ +class GovernedContainer extends \Google\Protobuf\Internal\Message +{ + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource. + * + * Generated from protobuf field string full_resource_name = 1; + */ + protected $full_resource_name = ''; + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the parent of + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name]. + * + * Generated from protobuf field string parent = 2; + */ + protected $parent = ''; + /** + * The consolidated organization policy for the analyzed resource. The + * consolidated organization policy is computed by merging and evaluating + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicy consolidated_policy = 3; + */ + protected $consolidated_policy = null; + /** + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][]. + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy policy_bundle = 4; + */ + private $policy_bundle; + /** + * The project that this resource belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * + * Generated from protobuf field string project = 5; + */ + protected $project = ''; + /** + * The folder(s) that this resource belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 6; + */ + private $folders; + /** + * The organization that this resource belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 7; + */ + protected $organization = ''; + /** + * The effective tags on this resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.EffectiveTagDetails effective_tags = 8; + */ + private $effective_tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $full_resource_name + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource. + * @type string $parent + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the parent of + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name]. + * @type \Google\Cloud\Asset\V1\AnalyzerOrgPolicy $consolidated_policy + * The consolidated organization policy for the analyzed resource. The + * consolidated organization policy is computed by merging and evaluating + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * @type array<\Google\Cloud\Asset\V1\AnalyzerOrgPolicy>|\Google\Protobuf\Internal\RepeatedField $policy_bundle + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][]. + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * @type string $project + * The project that this resource belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * @type array|\Google\Protobuf\Internal\RepeatedField $folders + * The folder(s) that this resource belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs (directly or cascadingly) to one or more folders. + * @type string $organization + * The organization that this resource belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs (directly or cascadingly) to an organization. + * @type array<\Google\Cloud\Asset\V1\EffectiveTagDetails>|\Google\Protobuf\Internal\RepeatedField $effective_tags + * The effective tags on this resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource. + * + * Generated from protobuf field string full_resource_name = 1; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource. + * + * Generated from protobuf field string full_resource_name = 1; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the parent of + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name]. + * + * Generated from protobuf field string parent = 2; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * the parent of + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name]. + * + * Generated from protobuf field string parent = 2; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The consolidated organization policy for the analyzed resource. The + * consolidated organization policy is computed by merging and evaluating + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicy consolidated_policy = 3; + * @return \Google\Cloud\Asset\V1\AnalyzerOrgPolicy|null + */ + public function getConsolidatedPolicy() + { + return $this->consolidated_policy; + } + + public function hasConsolidatedPolicy() + { + return isset($this->consolidated_policy); + } + + public function clearConsolidatedPolicy() + { + unset($this->consolidated_policy); + } + + /** + * The consolidated organization policy for the analyzed resource. The + * consolidated organization policy is computed by merging and evaluating + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle]. + * The evaluation will respect the organization policy [hierarchy + * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicy consolidated_policy = 3; + * @param \Google\Cloud\Asset\V1\AnalyzerOrgPolicy $var + * @return $this + */ + public function setConsolidatedPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicy::class); + $this->consolidated_policy = $var; + + return $this; + } + + /** + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][]. + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy policy_bundle = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPolicyBundle() + { + return $this->policy_bundle; + } + + /** + * The ordered list of all organization policies from the + * [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][]. + * to the scope specified in the request. + * If the constraint is defined with default policy, it will also appear in + * the list. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy policy_bundle = 4; + * @param array<\Google\Cloud\Asset\V1\AnalyzerOrgPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPolicyBundle($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\AnalyzerOrgPolicy::class); + $this->policy_bundle = $arr; + + return $this; + } + + /** + * The project that this resource belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * + * Generated from protobuf field string project = 5; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * The project that this resource belongs to, in the format of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * + * Generated from protobuf field string project = 5; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The folder(s) that this resource belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFolders() + { + return $this->folders; + } + + /** + * The folder(s) that this resource belongs to, in the format of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs (directly or cascadingly) to one or more folders. + * + * Generated from protobuf field repeated string folders = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFolders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->folders = $arr; + + return $this; + } + + /** + * The organization that this resource belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 7; + * @return string + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * The organization that this resource belongs to, in the format of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs (directly or cascadingly) to an organization. + * + * Generated from protobuf field string organization = 7; + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + + /** + * The effective tags on this resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.EffectiveTagDetails effective_tags = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectiveTags() + { + return $this->effective_tags; + } + + /** + * The effective tags on this resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.EffectiveTagDetails effective_tags = 8; + * @param array<\Google\Cloud\Asset\V1\EffectiveTagDetails>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectiveTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\EffectiveTagDetails::class); + $this->effective_tags = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GovernedContainer::class, \Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedContainersResponse_GovernedContainer::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicy.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicy.php new file mode 100644 index 000000000000..228e2f55bc0a --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicy.php @@ -0,0 +1,278 @@ +google.cloud.asset.v1.AnalyzerOrgPolicy + */ +class AnalyzerOrgPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource where this organization policy is + * set. + * Notice that some type of constraints are defined with default policy. This + * field will be empty for them. + * + * Generated from protobuf field string attached_resource = 1; + */ + protected $attached_resource = ''; + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource where this organization policy + * applies to. + * For any user defined org policies, this field has the same value as + * the [attached_resource] field. Only for default policy, this field has + * the different value. + * + * Generated from protobuf field string applied_resource = 5; + */ + protected $applied_resource = ''; + /** + * List of rules for this organization policy. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy.Rule rules = 2; + */ + private $rules; + /** + * If `inherit_from_parent` is true, Rules set higher up in the + * hierarchy (up to the closest root) are inherited and present in the + * effective policy. If it is false, then no rules are inherited, and this + * policy becomes the effective root for evaluation. + * + * Generated from protobuf field bool inherit_from_parent = 3; + */ + protected $inherit_from_parent = false; + /** + * Ignores policies set above this resource and restores the default behavior + * of the constraint at this resource. + * This field can be set in policies for either list or boolean + * constraints. If set, `rules` must be empty and `inherit_from_parent` + * must be set to false. + * + * Generated from protobuf field bool reset = 4; + */ + protected $reset = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attached_resource + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource where this organization policy is + * set. + * Notice that some type of constraints are defined with default policy. This + * field will be empty for them. + * @type string $applied_resource + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource where this organization policy + * applies to. + * For any user defined org policies, this field has the same value as + * the [attached_resource] field. Only for default policy, this field has + * the different value. + * @type array<\Google\Cloud\Asset\V1\AnalyzerOrgPolicy\Rule>|\Google\Protobuf\Internal\RepeatedField $rules + * List of rules for this organization policy. + * @type bool $inherit_from_parent + * If `inherit_from_parent` is true, Rules set higher up in the + * hierarchy (up to the closest root) are inherited and present in the + * effective policy. If it is false, then no rules are inherited, and this + * policy becomes the effective root for evaluation. + * @type bool $reset + * Ignores policies set above this resource and restores the default behavior + * of the constraint at this resource. + * This field can be set in policies for either list or boolean + * constraints. If set, `rules` must be empty and `inherit_from_parent` + * must be set to false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource where this organization policy is + * set. + * Notice that some type of constraints are defined with default policy. This + * field will be empty for them. + * + * Generated from protobuf field string attached_resource = 1; + * @return string + */ + public function getAttachedResource() + { + return $this->attached_resource; + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource where this organization policy is + * set. + * Notice that some type of constraints are defined with default policy. This + * field will be empty for them. + * + * Generated from protobuf field string attached_resource = 1; + * @param string $var + * @return $this + */ + public function setAttachedResource($var) + { + GPBUtil::checkString($var, True); + $this->attached_resource = $var; + + return $this; + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource where this organization policy + * applies to. + * For any user defined org policies, this field has the same value as + * the [attached_resource] field. Only for default policy, this field has + * the different value. + * + * Generated from protobuf field string applied_resource = 5; + * @return string + */ + public function getAppliedResource() + { + return $this->applied_resource; + } + + /** + * The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + * an organization/folder/project resource where this organization policy + * applies to. + * For any user defined org policies, this field has the same value as + * the [attached_resource] field. Only for default policy, this field has + * the different value. + * + * Generated from protobuf field string applied_resource = 5; + * @param string $var + * @return $this + */ + public function setAppliedResource($var) + { + GPBUtil::checkString($var, True); + $this->applied_resource = $var; + + return $this; + } + + /** + * List of rules for this organization policy. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy.Rule rules = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * List of rules for this organization policy. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicy.Rule rules = 2; + * @param array<\Google\Cloud\Asset\V1\AnalyzerOrgPolicy\Rule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\AnalyzerOrgPolicy\Rule::class); + $this->rules = $arr; + + return $this; + } + + /** + * If `inherit_from_parent` is true, Rules set higher up in the + * hierarchy (up to the closest root) are inherited and present in the + * effective policy. If it is false, then no rules are inherited, and this + * policy becomes the effective root for evaluation. + * + * Generated from protobuf field bool inherit_from_parent = 3; + * @return bool + */ + public function getInheritFromParent() + { + return $this->inherit_from_parent; + } + + /** + * If `inherit_from_parent` is true, Rules set higher up in the + * hierarchy (up to the closest root) are inherited and present in the + * effective policy. If it is false, then no rules are inherited, and this + * policy becomes the effective root for evaluation. + * + * Generated from protobuf field bool inherit_from_parent = 3; + * @param bool $var + * @return $this + */ + public function setInheritFromParent($var) + { + GPBUtil::checkBool($var); + $this->inherit_from_parent = $var; + + return $this; + } + + /** + * Ignores policies set above this resource and restores the default behavior + * of the constraint at this resource. + * This field can be set in policies for either list or boolean + * constraints. If set, `rules` must be empty and `inherit_from_parent` + * must be set to false. + * + * Generated from protobuf field bool reset = 4; + * @return bool + */ + public function getReset() + { + return $this->reset; + } + + /** + * Ignores policies set above this resource and restores the default behavior + * of the constraint at this resource. + * This field can be set in policies for either list or boolean + * constraints. If set, `rules` must be empty and `inherit_from_parent` + * must be set to false. + * + * Generated from protobuf field bool reset = 4; + * @param bool $var + * @return $this + */ + public function setReset($var) + { + GPBUtil::checkBool($var); + $this->reset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicy/Rule.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicy/Rule.php new file mode 100644 index 000000000000..c1b20c1dffd3 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicy/Rule.php @@ -0,0 +1,331 @@ +google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + */ +class Rule extends \Google\Protobuf\Internal\Message +{ + /** + * The evaluating condition for this rule. + * + * Generated from protobuf field .google.type.Expr condition = 7; + */ + protected $condition = null; + /** + * The condition evaluation result for this rule. + * Only populated if it meets all the following criteria: + * * There is a + * [condition][google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.condition] + * defined for this rule. + * * This rule is within + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.consolidated_policy][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.consolidated_policy], + * or + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.consolidated_policy][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.consolidated_policy] + * when the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset] + * has + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governed_resource][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governed_resource]. + * + * Generated from protobuf field .google.cloud.asset.v1.ConditionEvaluation condition_evaluation = 8; + */ + protected $condition_evaluation = null; + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\AnalyzerOrgPolicy\Rule\StringValues $values + * List of values to be used for this policy rule. This field can be set + * only in policies for list constraints. + * @type bool $allow_all + * Setting this to true means that all values are allowed. This field can + * be set only in Policies for list constraints. + * @type bool $deny_all + * Setting this to true means that all values are denied. This field can + * be set only in Policies for list constraints. + * @type bool $enforce + * If `true`, then the `Policy` is enforced. If `false`, then any + * configuration is acceptable. + * This field can be set only in Policies for boolean constraints. + * @type \Google\Type\Expr $condition + * The evaluating condition for this rule. + * @type \Google\Cloud\Asset\V1\ConditionEvaluation $condition_evaluation + * The condition evaluation result for this rule. + * Only populated if it meets all the following criteria: + * * There is a + * [condition][google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.condition] + * defined for this rule. + * * This rule is within + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.consolidated_policy][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.consolidated_policy], + * or + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.consolidated_policy][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.consolidated_policy] + * when the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset] + * has + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governed_resource][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governed_resource]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * List of values to be used for this policy rule. This field can be set + * only in policies for list constraints. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues values = 3; + * @return \Google\Cloud\Asset\V1\AnalyzerOrgPolicy\Rule\StringValues|null + */ + public function getValues() + { + return $this->readOneof(3); + } + + public function hasValues() + { + return $this->hasOneof(3); + } + + /** + * List of values to be used for this policy rule. This field can be set + * only in policies for list constraints. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues values = 3; + * @param \Google\Cloud\Asset\V1\AnalyzerOrgPolicy\Rule\StringValues $var + * @return $this + */ + public function setValues($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicy\Rule\StringValues::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Setting this to true means that all values are allowed. This field can + * be set only in Policies for list constraints. + * + * Generated from protobuf field bool allow_all = 4; + * @return bool + */ + public function getAllowAll() + { + return $this->readOneof(4); + } + + public function hasAllowAll() + { + return $this->hasOneof(4); + } + + /** + * Setting this to true means that all values are allowed. This field can + * be set only in Policies for list constraints. + * + * Generated from protobuf field bool allow_all = 4; + * @param bool $var + * @return $this + */ + public function setAllowAll($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Setting this to true means that all values are denied. This field can + * be set only in Policies for list constraints. + * + * Generated from protobuf field bool deny_all = 5; + * @return bool + */ + public function getDenyAll() + { + return $this->readOneof(5); + } + + public function hasDenyAll() + { + return $this->hasOneof(5); + } + + /** + * Setting this to true means that all values are denied. This field can + * be set only in Policies for list constraints. + * + * Generated from protobuf field bool deny_all = 5; + * @param bool $var + * @return $this + */ + public function setDenyAll($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * If `true`, then the `Policy` is enforced. If `false`, then any + * configuration is acceptable. + * This field can be set only in Policies for boolean constraints. + * + * Generated from protobuf field bool enforce = 6; + * @return bool + */ + public function getEnforce() + { + return $this->readOneof(6); + } + + public function hasEnforce() + { + return $this->hasOneof(6); + } + + /** + * If `true`, then the `Policy` is enforced. If `false`, then any + * configuration is acceptable. + * This field can be set only in Policies for boolean constraints. + * + * Generated from protobuf field bool enforce = 6; + * @param bool $var + * @return $this + */ + public function setEnforce($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The evaluating condition for this rule. + * + * Generated from protobuf field .google.type.Expr condition = 7; + * @return \Google\Type\Expr|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * The evaluating condition for this rule. + * + * Generated from protobuf field .google.type.Expr condition = 7; + * @param \Google\Type\Expr $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Type\Expr::class); + $this->condition = $var; + + return $this; + } + + /** + * The condition evaluation result for this rule. + * Only populated if it meets all the following criteria: + * * There is a + * [condition][google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.condition] + * defined for this rule. + * * This rule is within + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.consolidated_policy][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.consolidated_policy], + * or + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.consolidated_policy][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.consolidated_policy] + * when the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset] + * has + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governed_resource][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governed_resource]. + * + * Generated from protobuf field .google.cloud.asset.v1.ConditionEvaluation condition_evaluation = 8; + * @return \Google\Cloud\Asset\V1\ConditionEvaluation|null + */ + public function getConditionEvaluation() + { + return $this->condition_evaluation; + } + + public function hasConditionEvaluation() + { + return isset($this->condition_evaluation); + } + + public function clearConditionEvaluation() + { + unset($this->condition_evaluation); + } + + /** + * The condition evaluation result for this rule. + * Only populated if it meets all the following criteria: + * * There is a + * [condition][google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.condition] + * defined for this rule. + * * This rule is within + * [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.consolidated_policy][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.consolidated_policy], + * or + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.consolidated_policy][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.consolidated_policy] + * when the + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset] + * has + * [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governed_resource][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governed_resource]. + * + * Generated from protobuf field .google.cloud.asset.v1.ConditionEvaluation condition_evaluation = 8; + * @param \Google\Cloud\Asset\V1\ConditionEvaluation $var + * @return $this + */ + public function setConditionEvaluation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\ConditionEvaluation::class); + $this->condition_evaluation = $var; + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Rule::class, \Google\Cloud\Asset\V1\AnalyzerOrgPolicy_Rule::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicy/Rule/StringValues.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicy/Rule/StringValues.php new file mode 100644 index 000000000000..fd511b380d55 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicy/Rule/StringValues.php @@ -0,0 +1,104 @@ +google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + */ +class StringValues extends \Google\Protobuf\Internal\Message +{ + /** + * List of values allowed at this resource. + * + * Generated from protobuf field repeated string allowed_values = 1; + */ + private $allowed_values; + /** + * List of values denied at this resource. + * + * Generated from protobuf field repeated string denied_values = 2; + */ + private $denied_values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_values + * List of values allowed at this resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $denied_values + * List of values denied at this resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * List of values allowed at this resource. + * + * Generated from protobuf field repeated string allowed_values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedValues() + { + return $this->allowed_values; + } + + /** + * List of values allowed at this resource. + * + * Generated from protobuf field repeated string allowed_values = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_values = $arr; + + return $this; + } + + /** + * List of values denied at this resource. + * + * Generated from protobuf field repeated string denied_values = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDeniedValues() + { + return $this->denied_values; + } + + /** + * List of values denied at this resource. + * + * Generated from protobuf field repeated string denied_values = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDeniedValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->denied_values = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StringValues::class, \Google\Cloud\Asset\V1\AnalyzerOrgPolicy_Rule_StringValues::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint.php new file mode 100644 index 000000000000..74e4349d4a41 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint.php @@ -0,0 +1,108 @@ +google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + */ +class AnalyzerOrgPolicyConstraint extends \Google\Protobuf\Internal\Message +{ + protected $constraint_definition; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint $google_defined_constraint + * The definition of the canned constraint defined by Google. + * @type \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\CustomConstraint $custom_constraint + * The definition of the custom constraint. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The definition of the canned constraint defined by Google. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint google_defined_constraint = 1; + * @return \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint|null + */ + public function getGoogleDefinedConstraint() + { + return $this->readOneof(1); + } + + public function hasGoogleDefinedConstraint() + { + return $this->hasOneof(1); + } + + /** + * The definition of the canned constraint defined by Google. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint google_defined_constraint = 1; + * @param \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint $var + * @return $this + */ + public function setGoogleDefinedConstraint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The definition of the custom constraint. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint custom_constraint = 2; + * @return \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\CustomConstraint|null + */ + public function getCustomConstraint() + { + return $this->readOneof(2); + } + + public function hasCustomConstraint() + { + return $this->hasOneof(2); + } + + /** + * The definition of the custom constraint. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint custom_constraint = 2; + * @param \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\CustomConstraint $var + * @return $this + */ + public function setCustomConstraint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\CustomConstraint::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getConstraintDefinition() + { + return $this->whichOneof("constraint_definition"); + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint.php new file mode 100644 index 000000000000..a10cef66d192 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint.php @@ -0,0 +1,259 @@ +google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + */ +class Constraint extends \Google\Protobuf\Internal\Message +{ + /** + * The unique name of the constraint. Format of the name should be + * * `constraints/{constraint_name}` + * For example, `constraints/compute.disableSerialPortAccess`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The human readable name of the constraint. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Detailed description of what this `Constraint` controls as well as how + * and where it is enforced. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * The evaluation behavior of this constraint in the absence of 'Policy'. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault constraint_default = 4; + */ + protected $constraint_default = 0; + protected $constraint_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the constraint. Format of the name should be + * * `constraints/{constraint_name}` + * For example, `constraints/compute.disableSerialPortAccess`. + * @type string $display_name + * The human readable name of the constraint. + * @type string $description + * Detailed description of what this `Constraint` controls as well as how + * and where it is enforced. + * @type int $constraint_default + * The evaluation behavior of this constraint in the absence of 'Policy'. + * @type \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint\ListConstraint $list_constraint + * Defines this constraint as being a ListConstraint. + * @type \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint\BooleanConstraint $boolean_constraint + * Defines this constraint as being a BooleanConstraint. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The unique name of the constraint. Format of the name should be + * * `constraints/{constraint_name}` + * For example, `constraints/compute.disableSerialPortAccess`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique name of the constraint. Format of the name should be + * * `constraints/{constraint_name}` + * For example, `constraints/compute.disableSerialPortAccess`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The human readable name of the constraint. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The human readable name of the constraint. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Detailed description of what this `Constraint` controls as well as how + * and where it is enforced. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Detailed description of what this `Constraint` controls as well as how + * and where it is enforced. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The evaluation behavior of this constraint in the absence of 'Policy'. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault constraint_default = 4; + * @return int + */ + public function getConstraintDefault() + { + return $this->constraint_default; + } + + /** + * The evaluation behavior of this constraint in the absence of 'Policy'. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault constraint_default = 4; + * @param int $var + * @return $this + */ + public function setConstraintDefault($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint\ConstraintDefault::class); + $this->constraint_default = $var; + + return $this; + } + + /** + * Defines this constraint as being a ListConstraint. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint list_constraint = 5; + * @return \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint\ListConstraint|null + */ + public function getListConstraint() + { + return $this->readOneof(5); + } + + public function hasListConstraint() + { + return $this->hasOneof(5); + } + + /** + * Defines this constraint as being a ListConstraint. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint list_constraint = 5; + * @param \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint\ListConstraint $var + * @return $this + */ + public function setListConstraint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint\ListConstraint::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Defines this constraint as being a BooleanConstraint. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint boolean_constraint = 6; + * @return \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint\BooleanConstraint|null + */ + public function getBooleanConstraint() + { + return $this->readOneof(6); + } + + public function hasBooleanConstraint() + { + return $this->hasOneof(6); + } + + /** + * Defines this constraint as being a BooleanConstraint. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint boolean_constraint = 6; + * @param \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint\BooleanConstraint $var + * @return $this + */ + public function setBooleanConstraint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\Constraint\BooleanConstraint::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getConstraintType() + { + return $this->whichOneof("constraint_type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Constraint::class, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint_Constraint::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint/BooleanConstraint.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint/BooleanConstraint.php new file mode 100644 index 000000000000..71cc4c750987 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint/BooleanConstraint.php @@ -0,0 +1,39 @@ +google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint + */ +class BooleanConstraint extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BooleanConstraint::class, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint_Constraint_BooleanConstraint::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint/ConstraintDefault.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint/ConstraintDefault.php new file mode 100644 index 000000000000..d3b8fae6657d --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint/ConstraintDefault.php @@ -0,0 +1,68 @@ +google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault + */ +class ConstraintDefault +{ + /** + * This is only used for distinguishing unset values and should never be + * used. + * + * Generated from protobuf enum CONSTRAINT_DEFAULT_UNSPECIFIED = 0; + */ + const CONSTRAINT_DEFAULT_UNSPECIFIED = 0; + /** + * Indicate that all values are allowed for list constraints. + * Indicate that enforcement is off for boolean constraints. + * + * Generated from protobuf enum ALLOW = 1; + */ + const ALLOW = 1; + /** + * Indicate that all values are denied for list constraints. + * Indicate that enforcement is on for boolean constraints. + * + * Generated from protobuf enum DENY = 2; + */ + const DENY = 2; + + private static $valueToName = [ + self::CONSTRAINT_DEFAULT_UNSPECIFIED => 'CONSTRAINT_DEFAULT_UNSPECIFIED', + self::ALLOW => 'ALLOW', + self::DENY => 'DENY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConstraintDefault::class, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint_Constraint_ConstraintDefault::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint/ListConstraint.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint/ListConstraint.php new file mode 100644 index 000000000000..b738aa77ede8 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/Constraint/ListConstraint.php @@ -0,0 +1,125 @@ +google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + */ +class ListConstraint extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether values grouped into categories can be used in + * `Policy.allowed_values` and `Policy.denied_values`. For example, + * `"in:Python"` would match any value in the 'Python' group. + * + * Generated from protobuf field bool supports_in = 1; + */ + protected $supports_in = false; + /** + * Indicates whether subtrees of Cloud Resource Manager resource hierarchy + * can be used in `Policy.allowed_values` and `Policy.denied_values`. For + * example, `"under:folders/123"` would match any resource under the + * 'folders/123' folder. + * + * Generated from protobuf field bool supports_under = 2; + */ + protected $supports_under = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $supports_in + * Indicates whether values grouped into categories can be used in + * `Policy.allowed_values` and `Policy.denied_values`. For example, + * `"in:Python"` would match any value in the 'Python' group. + * @type bool $supports_under + * Indicates whether subtrees of Cloud Resource Manager resource hierarchy + * can be used in `Policy.allowed_values` and `Policy.denied_values`. For + * example, `"under:folders/123"` would match any resource under the + * 'folders/123' folder. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether values grouped into categories can be used in + * `Policy.allowed_values` and `Policy.denied_values`. For example, + * `"in:Python"` would match any value in the 'Python' group. + * + * Generated from protobuf field bool supports_in = 1; + * @return bool + */ + public function getSupportsIn() + { + return $this->supports_in; + } + + /** + * Indicates whether values grouped into categories can be used in + * `Policy.allowed_values` and `Policy.denied_values`. For example, + * `"in:Python"` would match any value in the 'Python' group. + * + * Generated from protobuf field bool supports_in = 1; + * @param bool $var + * @return $this + */ + public function setSupportsIn($var) + { + GPBUtil::checkBool($var); + $this->supports_in = $var; + + return $this; + } + + /** + * Indicates whether subtrees of Cloud Resource Manager resource hierarchy + * can be used in `Policy.allowed_values` and `Policy.denied_values`. For + * example, `"under:folders/123"` would match any resource under the + * 'folders/123' folder. + * + * Generated from protobuf field bool supports_under = 2; + * @return bool + */ + public function getSupportsUnder() + { + return $this->supports_under; + } + + /** + * Indicates whether subtrees of Cloud Resource Manager resource hierarchy + * can be used in `Policy.allowed_values` and `Policy.denied_values`. For + * example, `"under:folders/123"` would match any resource under the + * 'folders/123' folder. + * + * Generated from protobuf field bool supports_under = 2; + * @param bool $var + * @return $this + */ + public function setSupportsUnder($var) + { + GPBUtil::checkBool($var); + $this->supports_under = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ListConstraint::class, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint_Constraint_ListConstraint::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/CustomConstraint.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/CustomConstraint.php new file mode 100644 index 000000000000..555a6cfeca8b --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/CustomConstraint.php @@ -0,0 +1,306 @@ +google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + */ +class CustomConstraint extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the constraint. This is unique within the organization. Format of + * the name should be + * * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` + * Example : + * "organizations/123/customConstraints/custom.createOnlyE2TypeVms" + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The Resource Instance type on which this policy applies to. Format will + * be of the form : "/" Example: + * * `compute.googleapis.com/Instance`. + * + * Generated from protobuf field repeated string resource_types = 2; + */ + private $resource_types; + /** + * All the operations being applied for this constraint. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.MethodType method_types = 3; + */ + private $method_types; + /** + * Organization Policy condition/expression. For example: + * `resource.instanceName.matches("[production|test]_.*_(\d)+")'` or, + * `resource.management.auto_upgrade == true` + * + * Generated from protobuf field string condition = 4; + */ + protected $condition = ''; + /** + * Allow or deny type. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType action_type = 5; + */ + protected $action_type = 0; + /** + * One line display name for the UI. + * + * Generated from protobuf field string display_name = 6; + */ + protected $display_name = ''; + /** + * Detailed information about this custom policy constraint. + * + * Generated from protobuf field string description = 7; + */ + protected $description = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the constraint. This is unique within the organization. Format of + * the name should be + * * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` + * Example : + * "organizations/123/customConstraints/custom.createOnlyE2TypeVms" + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_types + * The Resource Instance type on which this policy applies to. Format will + * be of the form : "/" Example: + * * `compute.googleapis.com/Instance`. + * @type array|\Google\Protobuf\Internal\RepeatedField $method_types + * All the operations being applied for this constraint. + * @type string $condition + * Organization Policy condition/expression. For example: + * `resource.instanceName.matches("[production|test]_.*_(\d)+")'` or, + * `resource.management.auto_upgrade == true` + * @type int $action_type + * Allow or deny type. + * @type string $display_name + * One line display name for the UI. + * @type string $description + * Detailed information about this custom policy constraint. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Name of the constraint. This is unique within the organization. Format of + * the name should be + * * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` + * Example : + * "organizations/123/customConstraints/custom.createOnlyE2TypeVms" + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the constraint. This is unique within the organization. Format of + * the name should be + * * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` + * Example : + * "organizations/123/customConstraints/custom.createOnlyE2TypeVms" + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The Resource Instance type on which this policy applies to. Format will + * be of the form : "/" Example: + * * `compute.googleapis.com/Instance`. + * + * Generated from protobuf field repeated string resource_types = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceTypes() + { + return $this->resource_types; + } + + /** + * The Resource Instance type on which this policy applies to. Format will + * be of the form : "/" Example: + * * `compute.googleapis.com/Instance`. + * + * Generated from protobuf field repeated string resource_types = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_types = $arr; + + return $this; + } + + /** + * All the operations being applied for this constraint. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.MethodType method_types = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMethodTypes() + { + return $this->method_types; + } + + /** + * All the operations being applied for this constraint. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.MethodType method_types = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMethodTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\CustomConstraint\MethodType::class); + $this->method_types = $arr; + + return $this; + } + + /** + * Organization Policy condition/expression. For example: + * `resource.instanceName.matches("[production|test]_.*_(\d)+")'` or, + * `resource.management.auto_upgrade == true` + * + * Generated from protobuf field string condition = 4; + * @return string + */ + public function getCondition() + { + return $this->condition; + } + + /** + * Organization Policy condition/expression. For example: + * `resource.instanceName.matches("[production|test]_.*_(\d)+")'` or, + * `resource.management.auto_upgrade == true` + * + * Generated from protobuf field string condition = 4; + * @param string $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkString($var, True); + $this->condition = $var; + + return $this; + } + + /** + * Allow or deny type. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType action_type = 5; + * @return int + */ + public function getActionType() + { + return $this->action_type; + } + + /** + * Allow or deny type. + * + * Generated from protobuf field .google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType action_type = 5; + * @param int $var + * @return $this + */ + public function setActionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint\CustomConstraint\ActionType::class); + $this->action_type = $var; + + return $this; + } + + /** + * One line display name for the UI. + * + * Generated from protobuf field string display_name = 6; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * One line display name for the UI. + * + * Generated from protobuf field string display_name = 6; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Detailed information about this custom policy constraint. + * + * Generated from protobuf field string description = 7; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Detailed information about this custom policy constraint. + * + * Generated from protobuf field string description = 7; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CustomConstraint::class, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint_CustomConstraint::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/CustomConstraint/ActionType.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/CustomConstraint/ActionType.php new file mode 100644 index 000000000000..6a5930c8ddab --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/CustomConstraint/ActionType.php @@ -0,0 +1,64 @@ +google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType + */ +class ActionType +{ + /** + * Unspecified. Will results in user error. + * + * Generated from protobuf enum ACTION_TYPE_UNSPECIFIED = 0; + */ + const ACTION_TYPE_UNSPECIFIED = 0; + /** + * Allowed action type. + * + * Generated from protobuf enum ALLOW = 1; + */ + const ALLOW = 1; + /** + * Deny action type. + * + * Generated from protobuf enum DENY = 2; + */ + const DENY = 2; + + private static $valueToName = [ + self::ACTION_TYPE_UNSPECIFIED => 'ACTION_TYPE_UNSPECIFIED', + self::ALLOW => 'ALLOW', + self::DENY => 'DENY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ActionType::class, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint_CustomConstraint_ActionType::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/CustomConstraint/MethodType.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/CustomConstraint/MethodType.php new file mode 100644 index 000000000000..05e17c3bd686 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AnalyzerOrgPolicyConstraint/CustomConstraint/MethodType.php @@ -0,0 +1,74 @@ +google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.MethodType + */ +class MethodType +{ + /** + * Unspecified. Will results in user error. + * + * Generated from protobuf enum METHOD_TYPE_UNSPECIFIED = 0; + */ + const METHOD_TYPE_UNSPECIFIED = 0; + /** + * Constraint applied when creating the resource. + * + * Generated from protobuf enum CREATE = 1; + */ + const CREATE = 1; + /** + * Constraint applied when updating the resource. + * + * Generated from protobuf enum UPDATE = 2; + */ + const UPDATE = 2; + /** + * Constraint applied when deleting the resource. + * + * Generated from protobuf enum DELETE = 3; + */ + const DELETE = 3; + + private static $valueToName = [ + self::METHOD_TYPE_UNSPECIFIED => 'METHOD_TYPE_UNSPECIFIED', + self::CREATE => 'CREATE', + self::UPDATE => 'UPDATE', + self::DELETE => 'DELETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MethodType::class, \Google\Cloud\Asset\V1\AnalyzerOrgPolicyConstraint_CustomConstraint_MethodType::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Asset.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Asset.php new file mode 100644 index 000000000000..63d2c319d3d3 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Asset.php @@ -0,0 +1,689 @@ +google.cloud.asset.v1.Asset + */ +class Asset extends \Google\Protobuf\Internal\Message +{ + /** + * The last update timestamp of an asset. update_time is updated when + * create/update/delete operation is performed. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; + */ + protected $update_time = null; + /** + * The full name of the asset. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + * See [Resource + * names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The type of the asset. Example: `compute.googleapis.com/Disk` + * See [Supported asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for more information. + * + * Generated from protobuf field string asset_type = 2; + */ + protected $asset_type = ''; + /** + * A representation of the resource. + * + * Generated from protobuf field .google.cloud.asset.v1.Resource resource = 3; + */ + protected $resource = null; + /** + * A representation of the IAM policy set on a Google Cloud resource. + * There can be a maximum of one IAM policy set on any given resource. + * In addition, IAM policies inherit their granted access scope from any + * policies set on parent resources in the resource hierarchy. Therefore, the + * effectively policy is the union of both the policy set on this resource + * and each policy set on all of the resource's ancestry resource levels in + * the hierarchy. See + * [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) + * for more information. + * + * Generated from protobuf field .google.iam.v1.Policy iam_policy = 4; + */ + protected $iam_policy = null; + /** + * A representation of an [organization + * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). + * There can be more than one organization policy with different constraints + * set on a given resource. + * + * Generated from protobuf field repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + private $org_policy; + /** + * A representation of runtime OS Inventory information. See [this + * topic](https://cloud.google.com/compute/docs/instances/os-inventory-management) + * for more information. + * + * Generated from protobuf field .google.cloud.osconfig.v1.Inventory os_inventory = 12; + */ + protected $os_inventory = null; + /** + * DEPRECATED. This field only presents for the purpose of + * backward-compatibility. The server will never generate responses with this + * field. + * The related assets of the asset of one relationship type. One asset + * only represents one type of relationship. + * + * Generated from protobuf field .google.cloud.asset.v1.RelatedAssets related_assets = 13 [deprecated = true]; + * @deprecated + */ + protected $related_assets = null; + /** + * One related asset of the current asset. + * + * Generated from protobuf field .google.cloud.asset.v1.RelatedAsset related_asset = 15; + */ + protected $related_asset = null; + /** + * The ancestry path of an asset in Google Cloud [resource + * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + * represented as a list of relative resource names. An ancestry path starts + * with the closest ancestor in the hierarchy and ends at root. If the asset + * is a project, folder, or organization, the ancestry path starts from the + * asset itself. + * Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + * + * Generated from protobuf field repeated string ancestors = 10; + */ + private $ancestors; + protected $access_context_policy; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $update_time + * The last update timestamp of an asset. update_time is updated when + * create/update/delete operation is performed. + * @type string $name + * The full name of the asset. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + * See [Resource + * names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * @type string $asset_type + * The type of the asset. Example: `compute.googleapis.com/Disk` + * See [Supported asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for more information. + * @type \Google\Cloud\Asset\V1\Resource $resource + * A representation of the resource. + * @type \Google\Cloud\Iam\V1\Policy $iam_policy + * A representation of the IAM policy set on a Google Cloud resource. + * There can be a maximum of one IAM policy set on any given resource. + * In addition, IAM policies inherit their granted access scope from any + * policies set on parent resources in the resource hierarchy. Therefore, the + * effectively policy is the union of both the policy set on this resource + * and each policy set on all of the resource's ancestry resource levels in + * the hierarchy. See + * [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) + * for more information. + * @type array<\Google\Cloud\OrgPolicy\V1\Policy>|\Google\Protobuf\Internal\RepeatedField $org_policy + * A representation of an [organization + * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). + * There can be more than one organization policy with different constraints + * set on a given resource. + * @type \Google\Identity\AccessContextManager\V1\AccessPolicy $access_policy + * Also refer to the [access policy user + * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + * @type \Google\Identity\AccessContextManager\V1\AccessLevel $access_level + * Also refer to the [access level user + * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). + * @type \Google\Identity\AccessContextManager\V1\ServicePerimeter $service_perimeter + * Also refer to the [service perimeter user + * guide](https://cloud.google.com/vpc-service-controls/docs/overview). + * @type \Google\Cloud\OsConfig\V1\Inventory $os_inventory + * A representation of runtime OS Inventory information. See [this + * topic](https://cloud.google.com/compute/docs/instances/os-inventory-management) + * for more information. + * @type \Google\Cloud\Asset\V1\RelatedAssets $related_assets + * DEPRECATED. This field only presents for the purpose of + * backward-compatibility. The server will never generate responses with this + * field. + * The related assets of the asset of one relationship type. One asset + * only represents one type of relationship. + * @type \Google\Cloud\Asset\V1\RelatedAsset $related_asset + * One related asset of the current asset. + * @type array|\Google\Protobuf\Internal\RepeatedField $ancestors + * The ancestry path of an asset in Google Cloud [resource + * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + * represented as a list of relative resource names. An ancestry path starts + * with the closest ancestor in the hierarchy and ends at root. If the asset + * is a project, folder, or organization, the ancestry path starts from the + * asset itself. + * Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The last update timestamp of an asset. update_time is updated when + * create/update/delete operation is performed. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * The last update timestamp of an asset. update_time is updated when + * create/update/delete operation is performed. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * The full name of the asset. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + * See [Resource + * names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The full name of the asset. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + * See [Resource + * names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The type of the asset. Example: `compute.googleapis.com/Disk` + * See [Supported asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for more information. + * + * Generated from protobuf field string asset_type = 2; + * @return string + */ + public function getAssetType() + { + return $this->asset_type; + } + + /** + * The type of the asset. Example: `compute.googleapis.com/Disk` + * See [Supported asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for more information. + * + * Generated from protobuf field string asset_type = 2; + * @param string $var + * @return $this + */ + public function setAssetType($var) + { + GPBUtil::checkString($var, True); + $this->asset_type = $var; + + return $this; + } + + /** + * A representation of the resource. + * + * Generated from protobuf field .google.cloud.asset.v1.Resource resource = 3; + * @return \Google\Cloud\Asset\V1\Resource|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * A representation of the resource. + * + * Generated from protobuf field .google.cloud.asset.v1.Resource resource = 3; + * @param \Google\Cloud\Asset\V1\Resource $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\Resource::class); + $this->resource = $var; + + return $this; + } + + /** + * A representation of the IAM policy set on a Google Cloud resource. + * There can be a maximum of one IAM policy set on any given resource. + * In addition, IAM policies inherit their granted access scope from any + * policies set on parent resources in the resource hierarchy. Therefore, the + * effectively policy is the union of both the policy set on this resource + * and each policy set on all of the resource's ancestry resource levels in + * the hierarchy. See + * [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) + * for more information. + * + * Generated from protobuf field .google.iam.v1.Policy iam_policy = 4; + * @return \Google\Cloud\Iam\V1\Policy|null + */ + public function getIamPolicy() + { + return $this->iam_policy; + } + + public function hasIamPolicy() + { + return isset($this->iam_policy); + } + + public function clearIamPolicy() + { + unset($this->iam_policy); + } + + /** + * A representation of the IAM policy set on a Google Cloud resource. + * There can be a maximum of one IAM policy set on any given resource. + * In addition, IAM policies inherit their granted access scope from any + * policies set on parent resources in the resource hierarchy. Therefore, the + * effectively policy is the union of both the policy set on this resource + * and each policy set on all of the resource's ancestry resource levels in + * the hierarchy. See + * [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) + * for more information. + * + * Generated from protobuf field .google.iam.v1.Policy iam_policy = 4; + * @param \Google\Cloud\Iam\V1\Policy $var + * @return $this + */ + public function setIamPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Policy::class); + $this->iam_policy = $var; + + return $this; + } + + /** + * A representation of an [organization + * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). + * There can be more than one organization policy with different constraints + * set on a given resource. + * + * Generated from protobuf field repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOrgPolicy() + { + return $this->org_policy; + } + + /** + * A representation of an [organization + * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). + * There can be more than one organization policy with different constraints + * set on a given resource. + * + * Generated from protobuf field repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + * @param array<\Google\Cloud\OrgPolicy\V1\Policy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOrgPolicy($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\OrgPolicy\V1\Policy::class); + $this->org_policy = $arr; + + return $this; + } + + /** + * Also refer to the [access policy user + * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + * + * Generated from protobuf field .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * @return \Google\Identity\AccessContextManager\V1\AccessPolicy|null + */ + public function getAccessPolicy() + { + return $this->readOneof(7); + } + + public function hasAccessPolicy() + { + return $this->hasOneof(7); + } + + /** + * Also refer to the [access policy user + * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + * + * Generated from protobuf field .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * @param \Google\Identity\AccessContextManager\V1\AccessPolicy $var + * @return $this + */ + public function setAccessPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Identity\AccessContextManager\V1\AccessPolicy::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Also refer to the [access level user + * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). + * + * Generated from protobuf field .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * @return \Google\Identity\AccessContextManager\V1\AccessLevel|null + */ + public function getAccessLevel() + { + return $this->readOneof(8); + } + + public function hasAccessLevel() + { + return $this->hasOneof(8); + } + + /** + * Also refer to the [access level user + * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). + * + * Generated from protobuf field .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * @param \Google\Identity\AccessContextManager\V1\AccessLevel $var + * @return $this + */ + public function setAccessLevel($var) + { + GPBUtil::checkMessage($var, \Google\Identity\AccessContextManager\V1\AccessLevel::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Also refer to the [service perimeter user + * guide](https://cloud.google.com/vpc-service-controls/docs/overview). + * + * Generated from protobuf field .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * @return \Google\Identity\AccessContextManager\V1\ServicePerimeter|null + */ + public function getServicePerimeter() + { + return $this->readOneof(9); + } + + public function hasServicePerimeter() + { + return $this->hasOneof(9); + } + + /** + * Also refer to the [service perimeter user + * guide](https://cloud.google.com/vpc-service-controls/docs/overview). + * + * Generated from protobuf field .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * @param \Google\Identity\AccessContextManager\V1\ServicePerimeter $var + * @return $this + */ + public function setServicePerimeter($var) + { + GPBUtil::checkMessage($var, \Google\Identity\AccessContextManager\V1\ServicePerimeter::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * A representation of runtime OS Inventory information. See [this + * topic](https://cloud.google.com/compute/docs/instances/os-inventory-management) + * for more information. + * + * Generated from protobuf field .google.cloud.osconfig.v1.Inventory os_inventory = 12; + * @return \Google\Cloud\OsConfig\V1\Inventory|null + */ + public function getOsInventory() + { + return $this->os_inventory; + } + + public function hasOsInventory() + { + return isset($this->os_inventory); + } + + public function clearOsInventory() + { + unset($this->os_inventory); + } + + /** + * A representation of runtime OS Inventory information. See [this + * topic](https://cloud.google.com/compute/docs/instances/os-inventory-management) + * for more information. + * + * Generated from protobuf field .google.cloud.osconfig.v1.Inventory os_inventory = 12; + * @param \Google\Cloud\OsConfig\V1\Inventory $var + * @return $this + */ + public function setOsInventory($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\Inventory::class); + $this->os_inventory = $var; + + return $this; + } + + /** + * DEPRECATED. This field only presents for the purpose of + * backward-compatibility. The server will never generate responses with this + * field. + * The related assets of the asset of one relationship type. One asset + * only represents one type of relationship. + * + * Generated from protobuf field .google.cloud.asset.v1.RelatedAssets related_assets = 13 [deprecated = true]; + * @return \Google\Cloud\Asset\V1\RelatedAssets|null + * @deprecated + */ + public function getRelatedAssets() + { + @trigger_error('related_assets is deprecated.', E_USER_DEPRECATED); + return $this->related_assets; + } + + public function hasRelatedAssets() + { + @trigger_error('related_assets is deprecated.', E_USER_DEPRECATED); + return isset($this->related_assets); + } + + public function clearRelatedAssets() + { + @trigger_error('related_assets is deprecated.', E_USER_DEPRECATED); + unset($this->related_assets); + } + + /** + * DEPRECATED. This field only presents for the purpose of + * backward-compatibility. The server will never generate responses with this + * field. + * The related assets of the asset of one relationship type. One asset + * only represents one type of relationship. + * + * Generated from protobuf field .google.cloud.asset.v1.RelatedAssets related_assets = 13 [deprecated = true]; + * @param \Google\Cloud\Asset\V1\RelatedAssets $var + * @return $this + * @deprecated + */ + public function setRelatedAssets($var) + { + @trigger_error('related_assets is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\RelatedAssets::class); + $this->related_assets = $var; + + return $this; + } + + /** + * One related asset of the current asset. + * + * Generated from protobuf field .google.cloud.asset.v1.RelatedAsset related_asset = 15; + * @return \Google\Cloud\Asset\V1\RelatedAsset|null + */ + public function getRelatedAsset() + { + return $this->related_asset; + } + + public function hasRelatedAsset() + { + return isset($this->related_asset); + } + + public function clearRelatedAsset() + { + unset($this->related_asset); + } + + /** + * One related asset of the current asset. + * + * Generated from protobuf field .google.cloud.asset.v1.RelatedAsset related_asset = 15; + * @param \Google\Cloud\Asset\V1\RelatedAsset $var + * @return $this + */ + public function setRelatedAsset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\RelatedAsset::class); + $this->related_asset = $var; + + return $this; + } + + /** + * The ancestry path of an asset in Google Cloud [resource + * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + * represented as a list of relative resource names. An ancestry path starts + * with the closest ancestor in the hierarchy and ends at root. If the asset + * is a project, folder, or organization, the ancestry path starts from the + * asset itself. + * Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + * + * Generated from protobuf field repeated string ancestors = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAncestors() + { + return $this->ancestors; + } + + /** + * The ancestry path of an asset in Google Cloud [resource + * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + * represented as a list of relative resource names. An ancestry path starts + * with the closest ancestor in the hierarchy and ends at root. If the asset + * is a project, folder, or organization, the ancestry path starts from the + * asset itself. + * Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + * + * Generated from protobuf field repeated string ancestors = 10; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAncestors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ancestors = $arr; + + return $this; + } + + /** + * @return string + */ + public function getAccessContextPolicy() + { + return $this->whichOneof("access_context_policy"); + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AttachedResource.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AttachedResource.php new file mode 100644 index 000000000000..a32874a4c5a9 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/AttachedResource.php @@ -0,0 +1,126 @@ +google.cloud.asset.v1.AttachedResource + */ +class AttachedResource extends \Google\Protobuf\Internal\Message +{ + /** + * The type of this attached resource. + * Example: `osconfig.googleapis.com/Inventory` + * You can find the supported attached asset types of each resource in this + * table: + * `https://cloud.google.com/asset-inventory/docs/supported-asset-types` + * + * Generated from protobuf field string asset_type = 1; + */ + protected $asset_type = ''; + /** + * Versioned resource representations of this attached resource. This is + * repeated because there could be multiple versions of the attached resource + * representations during version migration. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.VersionedResource versioned_resources = 3; + */ + private $versioned_resources; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $asset_type + * The type of this attached resource. + * Example: `osconfig.googleapis.com/Inventory` + * You can find the supported attached asset types of each resource in this + * table: + * `https://cloud.google.com/asset-inventory/docs/supported-asset-types` + * @type array<\Google\Cloud\Asset\V1\VersionedResource>|\Google\Protobuf\Internal\RepeatedField $versioned_resources + * Versioned resource representations of this attached resource. This is + * repeated because there could be multiple versions of the attached resource + * representations during version migration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The type of this attached resource. + * Example: `osconfig.googleapis.com/Inventory` + * You can find the supported attached asset types of each resource in this + * table: + * `https://cloud.google.com/asset-inventory/docs/supported-asset-types` + * + * Generated from protobuf field string asset_type = 1; + * @return string + */ + public function getAssetType() + { + return $this->asset_type; + } + + /** + * The type of this attached resource. + * Example: `osconfig.googleapis.com/Inventory` + * You can find the supported attached asset types of each resource in this + * table: + * `https://cloud.google.com/asset-inventory/docs/supported-asset-types` + * + * Generated from protobuf field string asset_type = 1; + * @param string $var + * @return $this + */ + public function setAssetType($var) + { + GPBUtil::checkString($var, True); + $this->asset_type = $var; + + return $this; + } + + /** + * Versioned resource representations of this attached resource. This is + * repeated because there could be multiple versions of the attached resource + * representations during version migration. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.VersionedResource versioned_resources = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVersionedResources() + { + return $this->versioned_resources; + } + + /** + * Versioned resource representations of this attached resource. This is + * repeated because there could be multiple versions of the attached resource + * representations during version migration. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.VersionedResource versioned_resources = 3; + * @param array<\Google\Cloud\Asset\V1\VersionedResource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVersionedResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\VersionedResource::class); + $this->versioned_resources = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetAssetsHistoryRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetAssetsHistoryRequest.php new file mode 100644 index 000000000000..1ef54c7719ae --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetAssetsHistoryRequest.php @@ -0,0 +1,321 @@ +google.cloud.asset.v1.BatchGetAssetsHistoryRequest + */ +class BatchGetAssetsHistoryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * A list of the full names of the assets. + * See: https://cloud.google.com/asset-inventory/docs/resource-name-format + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + * + * Generated from protobuf field repeated string asset_names = 2; + */ + private $asset_names; + /** + * Optional. The content type. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $content_type = 0; + /** + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after the current time minus + * 35 days. If end_time is not set, it is default to current timestamp. + * If start_time is not set, the snapshot of the assets at end_time will be + * returned. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + * + * Generated from protobuf field .google.cloud.asset.v1.TimeWindow read_time_window = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $read_time_window = null; + /** + * Optional. A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationships' history on the [asset_names]. It + * returns an error if any of the [relationship_types] doesn't belong to the + * supported relationship types of the [asset_names] or if any of the + * [asset_names]'s types doesn't belong to the source types of the + * [relationship_types]. + * * Otherwise: + * it outputs the supported relationships' history on the [asset_names] or + * returns an error if any of the [asset_names]'s types has no relationship + * support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $relationship_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + * @type array|\Google\Protobuf\Internal\RepeatedField $asset_names + * A list of the full names of the assets. + * See: https://cloud.google.com/asset-inventory/docs/resource-name-format + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + * @type int $content_type + * Optional. The content type. + * @type \Google\Cloud\Asset\V1\TimeWindow $read_time_window + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after the current time minus + * 35 days. If end_time is not set, it is default to current timestamp. + * If start_time is not set, the snapshot of the assets at end_time will be + * returned. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + * @type array|\Google\Protobuf\Internal\RepeatedField $relationship_types + * Optional. A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationships' history on the [asset_names]. It + * returns an error if any of the [relationship_types] doesn't belong to the + * supported relationship types of the [asset_names] or if any of the + * [asset_names]'s types doesn't belong to the source types of the + * [relationship_types]. + * * Otherwise: + * it outputs the supported relationships' history on the [asset_names] or + * returns an error if any of the [asset_names]'s types has no relationship + * support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * A list of the full names of the assets. + * See: https://cloud.google.com/asset-inventory/docs/resource-name-format + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + * + * Generated from protobuf field repeated string asset_names = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssetNames() + { + return $this->asset_names; + } + + /** + * A list of the full names of the assets. + * See: https://cloud.google.com/asset-inventory/docs/resource-name-format + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + * + * Generated from protobuf field repeated string asset_names = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssetNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->asset_names = $arr; + + return $this; + } + + /** + * Optional. The content type. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContentType() + { + return $this->content_type; + } + + /** + * Optional. The content type. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContentType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Asset\V1\ContentType::class); + $this->content_type = $var; + + return $this; + } + + /** + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after the current time minus + * 35 days. If end_time is not set, it is default to current timestamp. + * If start_time is not set, the snapshot of the assets at end_time will be + * returned. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + * + * Generated from protobuf field .google.cloud.asset.v1.TimeWindow read_time_window = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Asset\V1\TimeWindow|null + */ + public function getReadTimeWindow() + { + return $this->read_time_window; + } + + public function hasReadTimeWindow() + { + return isset($this->read_time_window); + } + + public function clearReadTimeWindow() + { + unset($this->read_time_window); + } + + /** + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after the current time minus + * 35 days. If end_time is not set, it is default to current timestamp. + * If start_time is not set, the snapshot of the assets at end_time will be + * returned. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + * + * Generated from protobuf field .google.cloud.asset.v1.TimeWindow read_time_window = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Asset\V1\TimeWindow $var + * @return $this + */ + public function setReadTimeWindow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\TimeWindow::class); + $this->read_time_window = $var; + + return $this; + } + + /** + * Optional. A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationships' history on the [asset_names]. It + * returns an error if any of the [relationship_types] doesn't belong to the + * supported relationship types of the [asset_names] or if any of the + * [asset_names]'s types doesn't belong to the source types of the + * [relationship_types]. + * * Otherwise: + * it outputs the supported relationships' history on the [asset_names] or + * returns an error if any of the [asset_names]'s types has no relationship + * support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelationshipTypes() + { + return $this->relationship_types; + } + + /** + * Optional. A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationships' history on the [asset_names]. It + * returns an error if any of the [relationship_types] doesn't belong to the + * supported relationship types of the [asset_names] or if any of the + * [asset_names]'s types doesn't belong to the source types of the + * [relationship_types]. + * * Otherwise: + * it outputs the supported relationships' history on the [asset_names] or + * returns an error if any of the [asset_names]'s types has no relationship + * support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelationshipTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->relationship_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetAssetsHistoryResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetAssetsHistoryResponse.php new file mode 100644 index 000000000000..e45a02dac321 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetAssetsHistoryResponse.php @@ -0,0 +1,67 @@ +google.cloud.asset.v1.BatchGetAssetsHistoryResponse + */ +class BatchGetAssetsHistoryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of assets with valid time windows. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.TemporalAsset assets = 1; + */ + private $assets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\TemporalAsset>|\Google\Protobuf\Internal\RepeatedField $assets + * A list of assets with valid time windows. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * A list of assets with valid time windows. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.TemporalAsset assets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssets() + { + return $this->assets; + } + + /** + * A list of assets with valid time windows. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.TemporalAsset assets = 1; + * @param array<\Google\Cloud\Asset\V1\TemporalAsset>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\TemporalAsset::class); + $this->assets = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesRequest.php new file mode 100644 index 000000000000..94c69e1ffe68 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesRequest.php @@ -0,0 +1,146 @@ +google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + */ +class BatchGetEffectiveIamPoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Only IAM policies on or below the scope will be returned. + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * To know how to get organization ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * To know how to get folder or project ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $scope = ''; + /** + * Required. The names refer to the [full_resource_names] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * A maximum of 20 resources' effective policies can be retrieved in a batch. + * + * Generated from protobuf field repeated string names = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $scope + * Required. Only IAM policies on or below the scope will be returned. + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * To know how to get organization ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * To know how to get folder or project ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + * @type array|\Google\Protobuf\Internal\RepeatedField $names + * Required. The names refer to the [full_resource_names] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * A maximum of 20 resources' effective policies can be retrieved in a batch. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Only IAM policies on or below the scope will be returned. + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * To know how to get organization ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * To know how to get folder or project ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * Required. Only IAM policies on or below the scope will be returned. + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * To know how to get organization ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * To know how to get folder or project ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + + /** + * Required. The names refer to the [full_resource_names] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * A maximum of 20 resources' effective policies can be retrieved in a batch. + * + * Generated from protobuf field repeated string names = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNames() + { + return $this->names; + } + + /** + * Required. The names refer to the [full_resource_names] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * A maximum of 20 resources' effective policies can be retrieved in a batch. + * + * Generated from protobuf field repeated string names = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->names = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesResponse.php new file mode 100644 index 000000000000..2a4037ca402a --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesResponse.php @@ -0,0 +1,88 @@ +google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + */ +class BatchGetEffectiveIamPoliciesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The effective policies for a batch of resources. Note that the results + * order is the same as the order of + * [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names]. + * When a resource does not have any effective IAM policies, its corresponding + * policy_result will contain empty + * [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies]. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy policy_results = 2; + */ + private $policy_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\BatchGetEffectiveIamPoliciesResponse\EffectiveIamPolicy>|\Google\Protobuf\Internal\RepeatedField $policy_results + * The effective policies for a batch of resources. Note that the results + * order is the same as the order of + * [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names]. + * When a resource does not have any effective IAM policies, its corresponding + * policy_result will contain empty + * [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The effective policies for a batch of resources. Note that the results + * order is the same as the order of + * [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names]. + * When a resource does not have any effective IAM policies, its corresponding + * policy_result will contain empty + * [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies]. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy policy_results = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPolicyResults() + { + return $this->policy_results; + } + + /** + * The effective policies for a batch of resources. Note that the results + * order is the same as the order of + * [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names]. + * When a resource does not have any effective IAM policies, its corresponding + * policy_result will contain empty + * [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies]. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy policy_results = 2; + * @param array<\Google\Cloud\Asset\V1\BatchGetEffectiveIamPoliciesResponse\EffectiveIamPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPolicyResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\BatchGetEffectiveIamPoliciesResponse\EffectiveIamPolicy::class); + $this->policy_results = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesResponse/EffectiveIamPolicy.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesResponse/EffectiveIamPolicy.php new file mode 100644 index 000000000000..770fb8c4db09 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesResponse/EffectiveIamPolicy.php @@ -0,0 +1,196 @@ +google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + */ +class EffectiveIamPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The [full_resource_name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for which the + * [policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies] + * are computed. This is one of the + * [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names] + * the caller provides in the request. + * + * Generated from protobuf field string full_resource_name = 1; + */ + protected $full_resource_name = ''; + /** + * The effective policies for the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + * These policies include the policy set on the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + * and those set on its parents and ancestors up to the + * [BatchGetEffectiveIamPoliciesRequest.scope][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.scope]. + * Note that these policies are not filtered according to the resource type + * of the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + * These policies are hierarchically ordered by + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + * starting from + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + * itself to its parents and ancestors, such that policies[i]'s + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + * is the child of policies[i+1]'s + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource], + * if policies[i+1] exists. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo policies = 2; + */ + private $policies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $full_resource_name + * The [full_resource_name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for which the + * [policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies] + * are computed. This is one of the + * [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names] + * the caller provides in the request. + * @type array<\Google\Cloud\Asset\V1\BatchGetEffectiveIamPoliciesResponse\EffectiveIamPolicy\PolicyInfo>|\Google\Protobuf\Internal\RepeatedField $policies + * The effective policies for the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + * These policies include the policy set on the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + * and those set on its parents and ancestors up to the + * [BatchGetEffectiveIamPoliciesRequest.scope][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.scope]. + * Note that these policies are not filtered according to the resource type + * of the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + * These policies are hierarchically ordered by + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + * starting from + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + * itself to its parents and ancestors, such that policies[i]'s + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + * is the child of policies[i+1]'s + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource], + * if policies[i+1] exists. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The [full_resource_name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for which the + * [policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies] + * are computed. This is one of the + * [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names] + * the caller provides in the request. + * + * Generated from protobuf field string full_resource_name = 1; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * The [full_resource_name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for which the + * [policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies] + * are computed. This is one of the + * [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names] + * the caller provides in the request. + * + * Generated from protobuf field string full_resource_name = 1; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + + /** + * The effective policies for the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + * These policies include the policy set on the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + * and those set on its parents and ancestors up to the + * [BatchGetEffectiveIamPoliciesRequest.scope][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.scope]. + * Note that these policies are not filtered according to the resource type + * of the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + * These policies are hierarchically ordered by + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + * starting from + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + * itself to its parents and ancestors, such that policies[i]'s + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + * is the child of policies[i+1]'s + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource], + * if policies[i+1] exists. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo policies = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPolicies() + { + return $this->policies; + } + + /** + * The effective policies for the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + * These policies include the policy set on the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + * and those set on its parents and ancestors up to the + * [BatchGetEffectiveIamPoliciesRequest.scope][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.scope]. + * Note that these policies are not filtered according to the resource type + * of the + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + * These policies are hierarchically ordered by + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + * starting from + * [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + * itself to its parents and ancestors, such that policies[i]'s + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + * is the child of policies[i+1]'s + * [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource], + * if policies[i+1] exists. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo policies = 2; + * @param array<\Google\Cloud\Asset\V1\BatchGetEffectiveIamPoliciesResponse\EffectiveIamPolicy\PolicyInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\BatchGetEffectiveIamPoliciesResponse\EffectiveIamPolicy\PolicyInfo::class); + $this->policies = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EffectiveIamPolicy::class, \Google\Cloud\Asset\V1\BatchGetEffectiveIamPoliciesResponse_EffectiveIamPolicy::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesResponse/EffectiveIamPolicy/PolicyInfo.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesResponse/EffectiveIamPolicy/PolicyInfo.php new file mode 100644 index 000000000000..90f2ab49efed --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BatchGetEffectiveIamPoliciesResponse/EffectiveIamPolicy/PolicyInfo.php @@ -0,0 +1,126 @@ +google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + */ +class PolicyInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The full resource name the + * [policy][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy] + * is directly attached to. + * + * Generated from protobuf field string attached_resource = 1; + */ + protected $attached_resource = ''; + /** + * The IAM policy that's directly attached to the + * [attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource]. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 2; + */ + protected $policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attached_resource + * The full resource name the + * [policy][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy] + * is directly attached to. + * @type \Google\Cloud\Iam\V1\Policy $policy + * The IAM policy that's directly attached to the + * [attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The full resource name the + * [policy][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy] + * is directly attached to. + * + * Generated from protobuf field string attached_resource = 1; + * @return string + */ + public function getAttachedResource() + { + return $this->attached_resource; + } + + /** + * The full resource name the + * [policy][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy] + * is directly attached to. + * + * Generated from protobuf field string attached_resource = 1; + * @param string $var + * @return $this + */ + public function setAttachedResource($var) + { + GPBUtil::checkString($var, True); + $this->attached_resource = $var; + + return $this; + } + + /** + * The IAM policy that's directly attached to the + * [attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource]. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 2; + * @return \Google\Cloud\Iam\V1\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * The IAM policy that's directly attached to the + * [attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource]. + * + * Generated from protobuf field .google.iam.v1.Policy policy = 2; + * @param \Google\Cloud\Iam\V1\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Policy::class); + $this->policy = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PolicyInfo::class, \Google\Cloud\Asset\V1\BatchGetEffectiveIamPoliciesResponse_EffectiveIamPolicy_PolicyInfo::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BigQueryDestination.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BigQueryDestination.php new file mode 100644 index 000000000000..b8c9f6d1a76c --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/BigQueryDestination.php @@ -0,0 +1,409 @@ +google.cloud.asset.v1.BigQueryDestination + */ +class BigQueryDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The BigQuery dataset in format + * "projects/projectId/datasets/datasetId", to which the snapshot result + * should be exported. If this dataset does not exist, the export call returns + * an INVALID_ARGUMENT error. Setting the `contentType` for `exportAssets` + * determines the + * [schema](/asset-inventory/docs/exporting-to-bigquery#bigquery-schema) + * of the BigQuery table. Setting `separateTablesPerAssetType` to `TRUE` also + * influences the schema. + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset = ''; + /** + * Required. The BigQuery table to which the snapshot result should be + * written. If this table does not exist, a new table with the given name + * will be created. + * + * Generated from protobuf field string table = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table = ''; + /** + * If the destination table already exists and this flag is `TRUE`, the + * table will be overwritten by the contents of assets snapshot. If the flag + * is `FALSE` or unset and the destination table already exists, the export + * call returns an INVALID_ARGUMEMT error. + * + * Generated from protobuf field bool force = 3; + */ + protected $force = false; + /** + * [partition_spec] determines whether to export to partitioned table(s) and + * how to partition the data. + * If [partition_spec] is unset or [partition_spec.partition_key] is unset or + * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to + * non-partitioned table(s). [force] will decide whether to overwrite existing + * table(s). + * If [partition_spec] is specified. First, the snapshot results will be + * written to partitioned table(s) with two additional timestamp columns, + * readTime and requestTime, one of which will be the partition key. Secondly, + * in the case when any destination table already exists, it will first try to + * update existing table's schema as necessary by appending additional + * columns. Then, if [force] is `TRUE`, the corresponding partition will be + * overwritten by the snapshot results (data in different partitions will + * remain intact); if [force] is unset or `FALSE`, it will append the data. An + * error will be returned if the schema update or data appension fails. + * + * Generated from protobuf field .google.cloud.asset.v1.PartitionSpec partition_spec = 4; + */ + protected $partition_spec = null; + /** + * If this flag is `TRUE`, the snapshot results will be written to one or + * multiple tables, each of which contains results of one asset type. The + * [force] and [partition_spec] fields will apply to each of them. + * Field [table] will be concatenated with "_" and the asset type names (see + * https://cloud.google.com/asset-inventory/docs/supported-asset-types for + * supported asset types) to construct per-asset-type table names, in which + * all non-alphanumeric characters like "." and "/" will be substituted by + * "_". Example: if field [table] is "mytable" and snapshot results + * contain "storage.googleapis.com/Bucket" assets, the corresponding table + * name will be "mytable_storage_googleapis_com_Bucket". If any of these + * tables does not exist, a new table with the concatenated name will be + * created. + * When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of + * each table will include RECORD-type columns mapped to the nested fields in + * the Asset.resource.data field of that asset type (up to the 15 nested level + * BigQuery supports + * (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The + * fields in >15 nested levels will be stored in JSON format string as a child + * column of its parent RECORD column. + * If error occurs when exporting to any table, the whole export call will + * return an error but the export results that already succeed will persist. + * Example: if exporting to table_type_A succeeds when exporting to + * table_type_B fails during one export call, the results in table_type_A will + * persist and there will not be partial results persisting in a table. + * + * Generated from protobuf field bool separate_tables_per_asset_type = 5; + */ + protected $separate_tables_per_asset_type = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset + * Required. The BigQuery dataset in format + * "projects/projectId/datasets/datasetId", to which the snapshot result + * should be exported. If this dataset does not exist, the export call returns + * an INVALID_ARGUMENT error. Setting the `contentType` for `exportAssets` + * determines the + * [schema](/asset-inventory/docs/exporting-to-bigquery#bigquery-schema) + * of the BigQuery table. Setting `separateTablesPerAssetType` to `TRUE` also + * influences the schema. + * @type string $table + * Required. The BigQuery table to which the snapshot result should be + * written. If this table does not exist, a new table with the given name + * will be created. + * @type bool $force + * If the destination table already exists and this flag is `TRUE`, the + * table will be overwritten by the contents of assets snapshot. If the flag + * is `FALSE` or unset and the destination table already exists, the export + * call returns an INVALID_ARGUMEMT error. + * @type \Google\Cloud\Asset\V1\PartitionSpec $partition_spec + * [partition_spec] determines whether to export to partitioned table(s) and + * how to partition the data. + * If [partition_spec] is unset or [partition_spec.partition_key] is unset or + * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to + * non-partitioned table(s). [force] will decide whether to overwrite existing + * table(s). + * If [partition_spec] is specified. First, the snapshot results will be + * written to partitioned table(s) with two additional timestamp columns, + * readTime and requestTime, one of which will be the partition key. Secondly, + * in the case when any destination table already exists, it will first try to + * update existing table's schema as necessary by appending additional + * columns. Then, if [force] is `TRUE`, the corresponding partition will be + * overwritten by the snapshot results (data in different partitions will + * remain intact); if [force] is unset or `FALSE`, it will append the data. An + * error will be returned if the schema update or data appension fails. + * @type bool $separate_tables_per_asset_type + * If this flag is `TRUE`, the snapshot results will be written to one or + * multiple tables, each of which contains results of one asset type. The + * [force] and [partition_spec] fields will apply to each of them. + * Field [table] will be concatenated with "_" and the asset type names (see + * https://cloud.google.com/asset-inventory/docs/supported-asset-types for + * supported asset types) to construct per-asset-type table names, in which + * all non-alphanumeric characters like "." and "/" will be substituted by + * "_". Example: if field [table] is "mytable" and snapshot results + * contain "storage.googleapis.com/Bucket" assets, the corresponding table + * name will be "mytable_storage_googleapis_com_Bucket". If any of these + * tables does not exist, a new table with the concatenated name will be + * created. + * When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of + * each table will include RECORD-type columns mapped to the nested fields in + * the Asset.resource.data field of that asset type (up to the 15 nested level + * BigQuery supports + * (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The + * fields in >15 nested levels will be stored in JSON format string as a child + * column of its parent RECORD column. + * If error occurs when exporting to any table, the whole export call will + * return an error but the export results that already succeed will persist. + * Example: if exporting to table_type_A succeeds when exporting to + * table_type_B fails during one export call, the results in table_type_A will + * persist and there will not be partial results persisting in a table. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The BigQuery dataset in format + * "projects/projectId/datasets/datasetId", to which the snapshot result + * should be exported. If this dataset does not exist, the export call returns + * an INVALID_ARGUMENT error. Setting the `contentType` for `exportAssets` + * determines the + * [schema](/asset-inventory/docs/exporting-to-bigquery#bigquery-schema) + * of the BigQuery table. Setting `separateTablesPerAssetType` to `TRUE` also + * influences the schema. + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataset() + { + return $this->dataset; + } + + /** + * Required. The BigQuery dataset in format + * "projects/projectId/datasets/datasetId", to which the snapshot result + * should be exported. If this dataset does not exist, the export call returns + * an INVALID_ARGUMENT error. Setting the `contentType` for `exportAssets` + * determines the + * [schema](/asset-inventory/docs/exporting-to-bigquery#bigquery-schema) + * of the BigQuery table. Setting `separateTablesPerAssetType` to `TRUE` also + * influences the schema. + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkString($var, True); + $this->dataset = $var; + + return $this; + } + + /** + * Required. The BigQuery table to which the snapshot result should be + * written. If this table does not exist, a new table with the given name + * will be created. + * + * Generated from protobuf field string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTable() + { + return $this->table; + } + + /** + * Required. The BigQuery table to which the snapshot result should be + * written. If this table does not exist, a new table with the given name + * will be created. + * + * Generated from protobuf field string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTable($var) + { + GPBUtil::checkString($var, True); + $this->table = $var; + + return $this; + } + + /** + * If the destination table already exists and this flag is `TRUE`, the + * table will be overwritten by the contents of assets snapshot. If the flag + * is `FALSE` or unset and the destination table already exists, the export + * call returns an INVALID_ARGUMEMT error. + * + * Generated from protobuf field bool force = 3; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * If the destination table already exists and this flag is `TRUE`, the + * table will be overwritten by the contents of assets snapshot. If the flag + * is `FALSE` or unset and the destination table already exists, the export + * call returns an INVALID_ARGUMEMT error. + * + * Generated from protobuf field bool force = 3; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + + /** + * [partition_spec] determines whether to export to partitioned table(s) and + * how to partition the data. + * If [partition_spec] is unset or [partition_spec.partition_key] is unset or + * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to + * non-partitioned table(s). [force] will decide whether to overwrite existing + * table(s). + * If [partition_spec] is specified. First, the snapshot results will be + * written to partitioned table(s) with two additional timestamp columns, + * readTime and requestTime, one of which will be the partition key. Secondly, + * in the case when any destination table already exists, it will first try to + * update existing table's schema as necessary by appending additional + * columns. Then, if [force] is `TRUE`, the corresponding partition will be + * overwritten by the snapshot results (data in different partitions will + * remain intact); if [force] is unset or `FALSE`, it will append the data. An + * error will be returned if the schema update or data appension fails. + * + * Generated from protobuf field .google.cloud.asset.v1.PartitionSpec partition_spec = 4; + * @return \Google\Cloud\Asset\V1\PartitionSpec|null + */ + public function getPartitionSpec() + { + return $this->partition_spec; + } + + public function hasPartitionSpec() + { + return isset($this->partition_spec); + } + + public function clearPartitionSpec() + { + unset($this->partition_spec); + } + + /** + * [partition_spec] determines whether to export to partitioned table(s) and + * how to partition the data. + * If [partition_spec] is unset or [partition_spec.partition_key] is unset or + * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to + * non-partitioned table(s). [force] will decide whether to overwrite existing + * table(s). + * If [partition_spec] is specified. First, the snapshot results will be + * written to partitioned table(s) with two additional timestamp columns, + * readTime and requestTime, one of which will be the partition key. Secondly, + * in the case when any destination table already exists, it will first try to + * update existing table's schema as necessary by appending additional + * columns. Then, if [force] is `TRUE`, the corresponding partition will be + * overwritten by the snapshot results (data in different partitions will + * remain intact); if [force] is unset or `FALSE`, it will append the data. An + * error will be returned if the schema update or data appension fails. + * + * Generated from protobuf field .google.cloud.asset.v1.PartitionSpec partition_spec = 4; + * @param \Google\Cloud\Asset\V1\PartitionSpec $var + * @return $this + */ + public function setPartitionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\PartitionSpec::class); + $this->partition_spec = $var; + + return $this; + } + + /** + * If this flag is `TRUE`, the snapshot results will be written to one or + * multiple tables, each of which contains results of one asset type. The + * [force] and [partition_spec] fields will apply to each of them. + * Field [table] will be concatenated with "_" and the asset type names (see + * https://cloud.google.com/asset-inventory/docs/supported-asset-types for + * supported asset types) to construct per-asset-type table names, in which + * all non-alphanumeric characters like "." and "/" will be substituted by + * "_". Example: if field [table] is "mytable" and snapshot results + * contain "storage.googleapis.com/Bucket" assets, the corresponding table + * name will be "mytable_storage_googleapis_com_Bucket". If any of these + * tables does not exist, a new table with the concatenated name will be + * created. + * When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of + * each table will include RECORD-type columns mapped to the nested fields in + * the Asset.resource.data field of that asset type (up to the 15 nested level + * BigQuery supports + * (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The + * fields in >15 nested levels will be stored in JSON format string as a child + * column of its parent RECORD column. + * If error occurs when exporting to any table, the whole export call will + * return an error but the export results that already succeed will persist. + * Example: if exporting to table_type_A succeeds when exporting to + * table_type_B fails during one export call, the results in table_type_A will + * persist and there will not be partial results persisting in a table. + * + * Generated from protobuf field bool separate_tables_per_asset_type = 5; + * @return bool + */ + public function getSeparateTablesPerAssetType() + { + return $this->separate_tables_per_asset_type; + } + + /** + * If this flag is `TRUE`, the snapshot results will be written to one or + * multiple tables, each of which contains results of one asset type. The + * [force] and [partition_spec] fields will apply to each of them. + * Field [table] will be concatenated with "_" and the asset type names (see + * https://cloud.google.com/asset-inventory/docs/supported-asset-types for + * supported asset types) to construct per-asset-type table names, in which + * all non-alphanumeric characters like "." and "/" will be substituted by + * "_". Example: if field [table] is "mytable" and snapshot results + * contain "storage.googleapis.com/Bucket" assets, the corresponding table + * name will be "mytable_storage_googleapis_com_Bucket". If any of these + * tables does not exist, a new table with the concatenated name will be + * created. + * When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of + * each table will include RECORD-type columns mapped to the nested fields in + * the Asset.resource.data field of that asset type (up to the 15 nested level + * BigQuery supports + * (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The + * fields in >15 nested levels will be stored in JSON format string as a child + * column of its parent RECORD column. + * If error occurs when exporting to any table, the whole export call will + * return an error but the export results that already succeed will persist. + * Example: if exporting to table_type_A succeeds when exporting to + * table_type_B fails during one export call, the results in table_type_A will + * persist and there will not be partial results persisting in a table. + * + * Generated from protobuf field bool separate_tables_per_asset_type = 5; + * @param bool $var + * @return $this + */ + public function setSeparateTablesPerAssetType($var) + { + GPBUtil::checkBool($var); + $this->separate_tables_per_asset_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ConditionEvaluation.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ConditionEvaluation.php new file mode 100644 index 000000000000..9aad71afb156 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ConditionEvaluation.php @@ -0,0 +1,67 @@ +google.cloud.asset.v1.ConditionEvaluation + */ +class ConditionEvaluation extends \Google\Protobuf\Internal\Message +{ + /** + * The evaluation result. + * + * Generated from protobuf field .google.cloud.asset.v1.ConditionEvaluation.EvaluationValue evaluation_value = 1; + */ + protected $evaluation_value = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $evaluation_value + * The evaluation result. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The evaluation result. + * + * Generated from protobuf field .google.cloud.asset.v1.ConditionEvaluation.EvaluationValue evaluation_value = 1; + * @return int + */ + public function getEvaluationValue() + { + return $this->evaluation_value; + } + + /** + * The evaluation result. + * + * Generated from protobuf field .google.cloud.asset.v1.ConditionEvaluation.EvaluationValue evaluation_value = 1; + * @param int $var + * @return $this + */ + public function setEvaluationValue($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Asset\V1\ConditionEvaluation\EvaluationValue::class); + $this->evaluation_value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ConditionEvaluation/EvaluationValue.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ConditionEvaluation/EvaluationValue.php new file mode 100644 index 000000000000..87c7b1254131 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ConditionEvaluation/EvaluationValue.php @@ -0,0 +1,73 @@ +google.cloud.asset.v1.ConditionEvaluation.EvaluationValue + */ +class EvaluationValue +{ + /** + * Reserved for future use. + * + * Generated from protobuf enum EVALUATION_VALUE_UNSPECIFIED = 0; + */ + const EVALUATION_VALUE_UNSPECIFIED = 0; + /** + * The evaluation result is `true`. + * + * Generated from protobuf enum TRUE = 1; + */ + const TRUE = 1; + /** + * The evaluation result is `false`. + * + * Generated from protobuf enum FALSE = 2; + */ + const FALSE = 2; + /** + * The evaluation result is `conditional` when the condition expression + * contains variables that are either missing input values or have not been + * supported by Policy Analyzer yet. + * + * Generated from protobuf enum CONDITIONAL = 3; + */ + const CONDITIONAL = 3; + + private static $valueToName = [ + self::EVALUATION_VALUE_UNSPECIFIED => 'EVALUATION_VALUE_UNSPECIFIED', + self::TRUE => 'TRUE', + self::FALSE => 'FALSE', + self::CONDITIONAL => 'CONDITIONAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EvaluationValue::class, \Google\Cloud\Asset\V1\ConditionEvaluation_EvaluationValue::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ContentType.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ContentType.php new file mode 100644 index 000000000000..256ad4bd28e7 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ContentType.php @@ -0,0 +1,89 @@ +google.cloud.asset.v1.ContentType + */ +class ContentType +{ + /** + * Unspecified content type. + * + * Generated from protobuf enum CONTENT_TYPE_UNSPECIFIED = 0; + */ + const CONTENT_TYPE_UNSPECIFIED = 0; + /** + * Resource metadata. + * + * Generated from protobuf enum RESOURCE = 1; + */ + const RESOURCE = 1; + /** + * The actual IAM policy set on a resource. + * + * Generated from protobuf enum IAM_POLICY = 2; + */ + const IAM_POLICY = 2; + /** + * The organization policy set on an asset. + * + * Generated from protobuf enum ORG_POLICY = 4; + */ + const ORG_POLICY = 4; + /** + * The Access Context Manager policy set on an asset. + * + * Generated from protobuf enum ACCESS_POLICY = 5; + */ + const ACCESS_POLICY = 5; + /** + * The runtime OS Inventory information. + * + * Generated from protobuf enum OS_INVENTORY = 6; + */ + const OS_INVENTORY = 6; + /** + * The related resources. + * + * Generated from protobuf enum RELATIONSHIP = 7; + */ + const RELATIONSHIP = 7; + + private static $valueToName = [ + self::CONTENT_TYPE_UNSPECIFIED => 'CONTENT_TYPE_UNSPECIFIED', + self::RESOURCE => 'RESOURCE', + self::IAM_POLICY => 'IAM_POLICY', + self::ORG_POLICY => 'ORG_POLICY', + self::ACCESS_POLICY => 'ACCESS_POLICY', + self::OS_INVENTORY => 'OS_INVENTORY', + self::RELATIONSHIP => 'RELATIONSHIP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/CreateFeedRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/CreateFeedRequest.php new file mode 100644 index 000000000000..b5c6bb66cc52 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/CreateFeedRequest.php @@ -0,0 +1,194 @@ +google.cloud.asset.v1.CreateFeedRequest + */ +class CreateFeedRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * + * Generated from protobuf field string feed_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $feed_id = ''; + /** + * Required. The feed details. The field `name` must be empty and it will be + * generated in the format of: projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * Generated from protobuf field .google.cloud.asset.v1.Feed feed = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $feed = null; + + /** + * @param string $parent Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * + * @return \Google\Cloud\Asset\V1\CreateFeedRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * @type string $feed_id + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * @type \Google\Cloud\Asset\V1\Feed $feed + * Required. The feed details. The field `name` must be empty and it will be + * generated in the format of: projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * + * Generated from protobuf field string feed_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFeedId() + { + return $this->feed_id; + } + + /** + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * + * Generated from protobuf field string feed_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFeedId($var) + { + GPBUtil::checkString($var, True); + $this->feed_id = $var; + + return $this; + } + + /** + * Required. The feed details. The field `name` must be empty and it will be + * generated in the format of: projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * Generated from protobuf field .google.cloud.asset.v1.Feed feed = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Asset\V1\Feed|null + */ + public function getFeed() + { + return $this->feed; + } + + public function hasFeed() + { + return isset($this->feed); + } + + public function clearFeed() + { + unset($this->feed); + } + + /** + * Required. The feed details. The field `name` must be empty and it will be + * generated in the format of: projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * Generated from protobuf field .google.cloud.asset.v1.Feed feed = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Asset\V1\Feed $var + * @return $this + */ + public function setFeed($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\Feed::class); + $this->feed = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/CreateSavedQueryRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/CreateSavedQueryRequest.php new file mode 100644 index 000000000000..147d9204985c --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/CreateSavedQueryRequest.php @@ -0,0 +1,220 @@ +google.cloud.asset.v1.CreateSavedQueryRequest + */ +class CreateSavedQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project/folder/organization where this + * saved_query should be created in. It can only be an organization number + * (such as "organizations/123"), a folder number (such as "folders/123"), a + * project ID (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The saved_query details. The `name` field must be empty as it + * will be generated based on the parent and saved_query_id. + * + * Generated from protobuf field .google.cloud.asset.v1.SavedQuery saved_query = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $saved_query = null; + /** + * Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's + * resource name. + * This value should be 4-63 characters, and valid characters + * are `[a-z][0-9]-`. + * Notice that this field is required in the saved query creation, and the + * `name` field of the `saved_query` will be ignored. + * + * Generated from protobuf field string saved_query_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $saved_query_id = ''; + + /** + * @param string $parent Required. The name of the project/folder/organization where this + * saved_query should be created in. It can only be an organization number + * (such as "organizations/123"), a folder number (such as "folders/123"), a + * project ID (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). Please see + * {@see AssetServiceClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Asset\V1\SavedQuery $savedQuery Required. The saved_query details. The `name` field must be empty as it + * will be generated based on the parent and saved_query_id. + * @param string $savedQueryId Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's + * resource name. + * + * This value should be 4-63 characters, and valid characters + * are `[a-z][0-9]-`. + * + * Notice that this field is required in the saved query creation, and the + * `name` field of the `saved_query` will be ignored. + * + * @return \Google\Cloud\Asset\V1\CreateSavedQueryRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Asset\V1\SavedQuery $savedQuery, string $savedQueryId): self + { + return (new self()) + ->setParent($parent) + ->setSavedQuery($savedQuery) + ->setSavedQueryId($savedQueryId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project/folder/organization where this + * saved_query should be created in. It can only be an organization number + * (such as "organizations/123"), a folder number (such as "folders/123"), a + * project ID (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * @type \Google\Cloud\Asset\V1\SavedQuery $saved_query + * Required. The saved_query details. The `name` field must be empty as it + * will be generated based on the parent and saved_query_id. + * @type string $saved_query_id + * Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's + * resource name. + * This value should be 4-63 characters, and valid characters + * are `[a-z][0-9]-`. + * Notice that this field is required in the saved query creation, and the + * `name` field of the `saved_query` will be ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project/folder/organization where this + * saved_query should be created in. It can only be an organization number + * (such as "organizations/123"), a folder number (such as "folders/123"), a + * project ID (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the project/folder/organization where this + * saved_query should be created in. It can only be an organization number + * (such as "organizations/123"), a folder number (such as "folders/123"), a + * project ID (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The saved_query details. The `name` field must be empty as it + * will be generated based on the parent and saved_query_id. + * + * Generated from protobuf field .google.cloud.asset.v1.SavedQuery saved_query = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Asset\V1\SavedQuery|null + */ + public function getSavedQuery() + { + return $this->saved_query; + } + + public function hasSavedQuery() + { + return isset($this->saved_query); + } + + public function clearSavedQuery() + { + unset($this->saved_query); + } + + /** + * Required. The saved_query details. The `name` field must be empty as it + * will be generated based on the parent and saved_query_id. + * + * Generated from protobuf field .google.cloud.asset.v1.SavedQuery saved_query = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Asset\V1\SavedQuery $var + * @return $this + */ + public function setSavedQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\SavedQuery::class); + $this->saved_query = $var; + + return $this; + } + + /** + * Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's + * resource name. + * This value should be 4-63 characters, and valid characters + * are `[a-z][0-9]-`. + * Notice that this field is required in the saved query creation, and the + * `name` field of the `saved_query` will be ignored. + * + * Generated from protobuf field string saved_query_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSavedQueryId() + { + return $this->saved_query_id; + } + + /** + * Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's + * resource name. + * This value should be 4-63 characters, and valid characters + * are `[a-z][0-9]-`. + * Notice that this field is required in the saved query creation, and the + * `name` field of the `saved_query` will be ignored. + * + * Generated from protobuf field string saved_query_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSavedQueryId($var) + { + GPBUtil::checkString($var, True); + $this->saved_query_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/DeleteFeedRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/DeleteFeedRequest.php new file mode 100644 index 000000000000..b7fef8218e4e --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/DeleteFeedRequest.php @@ -0,0 +1,94 @@ +google.cloud.asset.v1.DeleteFeedRequest + */ +class DeleteFeedRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * Please see {@see AssetServiceClient::feedName()} for help formatting this field. + * + * @return \Google\Cloud\Asset\V1\DeleteFeedRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/DeleteSavedQueryRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/DeleteSavedQueryRequest.php new file mode 100644 index 000000000000..1ed46db0d2ff --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/DeleteSavedQueryRequest.php @@ -0,0 +1,102 @@ +google.cloud.asset.v1.DeleteSavedQueryRequest + */ +class DeleteSavedQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the saved query to delete. It must be in the format + * of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the saved query to delete. It must be in the format + * of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * Please see {@see AssetServiceClient::savedQueryName()} for help formatting this field. + * + * @return \Google\Cloud\Asset\V1\DeleteSavedQueryRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the saved query to delete. It must be in the format + * of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the saved query to delete. It must be in the format + * of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the saved query to delete. It must be in the format + * of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/EffectiveTagDetails.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/EffectiveTagDetails.php new file mode 100644 index 000000000000..bff5d0b20285 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/EffectiveTagDetails.php @@ -0,0 +1,155 @@ +google.cloud.asset.v1.EffectiveTagDetails + */ +class EffectiveTagDetails extends \Google\Protobuf\Internal\Message +{ + /** + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the ancestor from which an [effective_tag][] is inherited, according to + * [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * + * Generated from protobuf field optional string attached_resource = 1; + */ + protected $attached_resource = null; + /** + * The effective tags inherited from the + * [attached_resource][google.cloud.asset.v1.EffectiveTagDetails.attached_resource]. + * Note that tags with the same key but different values may attach to + * resources at a different hierarchy levels. The lower hierarchy tag value + * will overwrite the higher hierarchy tag value of the same tag key. In this + * case, the tag value at the higher hierarchy level will be removed. For more + * information, see [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Tag effective_tags = 2; + */ + private $effective_tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attached_resource + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the ancestor from which an [effective_tag][] is inherited, according to + * [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * @type array<\Google\Cloud\Asset\V1\Tag>|\Google\Protobuf\Internal\RepeatedField $effective_tags + * The effective tags inherited from the + * [attached_resource][google.cloud.asset.v1.EffectiveTagDetails.attached_resource]. + * Note that tags with the same key but different values may attach to + * resources at a different hierarchy levels. The lower hierarchy tag value + * will overwrite the higher hierarchy tag value of the same tag key. In this + * case, the tag value at the higher hierarchy level will be removed. For more + * information, see [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the ancestor from which an [effective_tag][] is inherited, according to + * [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * + * Generated from protobuf field optional string attached_resource = 1; + * @return string + */ + public function getAttachedResource() + { + return isset($this->attached_resource) ? $this->attached_resource : ''; + } + + public function hasAttachedResource() + { + return isset($this->attached_resource); + } + + public function clearAttachedResource() + { + unset($this->attached_resource); + } + + /** + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the ancestor from which an [effective_tag][] is inherited, according to + * [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * + * Generated from protobuf field optional string attached_resource = 1; + * @param string $var + * @return $this + */ + public function setAttachedResource($var) + { + GPBUtil::checkString($var, True); + $this->attached_resource = $var; + + return $this; + } + + /** + * The effective tags inherited from the + * [attached_resource][google.cloud.asset.v1.EffectiveTagDetails.attached_resource]. + * Note that tags with the same key but different values may attach to + * resources at a different hierarchy levels. The lower hierarchy tag value + * will overwrite the higher hierarchy tag value of the same tag key. In this + * case, the tag value at the higher hierarchy level will be removed. For more + * information, see [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Tag effective_tags = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectiveTags() + { + return $this->effective_tags; + } + + /** + * The effective tags inherited from the + * [attached_resource][google.cloud.asset.v1.EffectiveTagDetails.attached_resource]. + * Note that tags with the same key but different values may attach to + * resources at a different hierarchy levels. The lower hierarchy tag value + * will overwrite the higher hierarchy tag value of the same tag key. In this + * case, the tag value at the higher hierarchy level will be removed. For more + * information, see [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Tag effective_tags = 2; + * @param array<\Google\Cloud\Asset\V1\Tag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectiveTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\Tag::class); + $this->effective_tags = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ExportAssetsRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ExportAssetsRequest.php new file mode 100644 index 000000000000..1e1e8ffe1043 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ExportAssetsRequest.php @@ -0,0 +1,401 @@ +google.cloud.asset.v1.ExportAssetsRequest + */ +class ExportAssetsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 2; + */ + protected $read_time = null; + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * + * Generated from protobuf field repeated string asset_types = 3; + */ + private $asset_types; + /** + * Asset content type. If not specified, no content but the asset name will be + * returned. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 4; + */ + protected $content_type = 0; + /** + * Required. Output configuration indicating where the results will be output + * to. + * + * Generated from protobuf field .google.cloud.asset.v1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + /** + * A list of relationship types to export, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 6; + */ + private $relationship_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * @type \Google\Protobuf\Timestamp $read_time + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @type array|\Google\Protobuf\Internal\RepeatedField $asset_types + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @type int $content_type + * Asset content type. If not specified, no content but the asset name will be + * returned. + * @type \Google\Cloud\Asset\V1\OutputConfig $output_config + * Required. Output configuration indicating where the results will be output + * to. + * @type array|\Google\Protobuf\Internal\RepeatedField $relationship_types + * A list of relationship types to export, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * + * Generated from protobuf field repeated string asset_types = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssetTypes() + { + return $this->asset_types; + } + + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * + * Generated from protobuf field repeated string asset_types = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssetTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->asset_types = $arr; + + return $this; + } + + /** + * Asset content type. If not specified, no content but the asset name will be + * returned. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 4; + * @return int + */ + public function getContentType() + { + return $this->content_type; + } + + /** + * Asset content type. If not specified, no content but the asset name will be + * returned. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 4; + * @param int $var + * @return $this + */ + public function setContentType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Asset\V1\ContentType::class); + $this->content_type = $var; + + return $this; + } + + /** + * Required. Output configuration indicating where the results will be output + * to. + * + * Generated from protobuf field .google.cloud.asset.v1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Asset\V1\OutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. Output configuration indicating where the results will be output + * to. + * + * Generated from protobuf field .google.cloud.asset.v1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Asset\V1\OutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\OutputConfig::class); + $this->output_config = $var; + + return $this; + } + + /** + * A list of relationship types to export, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelationshipTypes() + { + return $this->relationship_types; + } + + /** + * A list of relationship types to export, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelationshipTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->relationship_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ExportAssetsResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ExportAssetsResponse.php new file mode 100644 index 000000000000..f331763f8a90 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ExportAssetsResponse.php @@ -0,0 +1,185 @@ +google.cloud.asset.v1.ExportAssetsResponse + */ +class ExportAssetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Time the snapshot was taken. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; + */ + protected $read_time = null; + /** + * Output configuration indicating where the results were output to. + * + * Generated from protobuf field .google.cloud.asset.v1.OutputConfig output_config = 2; + */ + protected $output_config = null; + /** + * Output result indicating where the assets were exported to. For example, a + * set of actual Cloud Storage object URIs where the assets are exported to. + * The URIs can be different from what [output_config] has specified, as the + * service will split the output object into multiple ones once it exceeds a + * single Cloud Storage object limit. + * + * Generated from protobuf field .google.cloud.asset.v1.OutputResult output_result = 3; + */ + protected $output_result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $read_time + * Time the snapshot was taken. + * @type \Google\Cloud\Asset\V1\OutputConfig $output_config + * Output configuration indicating where the results were output to. + * @type \Google\Cloud\Asset\V1\OutputResult $output_result + * Output result indicating where the assets were exported to. For example, a + * set of actual Cloud Storage object URIs where the assets are exported to. + * The URIs can be different from what [output_config] has specified, as the + * service will split the output object into multiple ones once it exceeds a + * single Cloud Storage object limit. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Time the snapshot was taken. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * Time the snapshot was taken. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + + /** + * Output configuration indicating where the results were output to. + * + * Generated from protobuf field .google.cloud.asset.v1.OutputConfig output_config = 2; + * @return \Google\Cloud\Asset\V1\OutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Output configuration indicating where the results were output to. + * + * Generated from protobuf field .google.cloud.asset.v1.OutputConfig output_config = 2; + * @param \Google\Cloud\Asset\V1\OutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\OutputConfig::class); + $this->output_config = $var; + + return $this; + } + + /** + * Output result indicating where the assets were exported to. For example, a + * set of actual Cloud Storage object URIs where the assets are exported to. + * The URIs can be different from what [output_config] has specified, as the + * service will split the output object into multiple ones once it exceeds a + * single Cloud Storage object limit. + * + * Generated from protobuf field .google.cloud.asset.v1.OutputResult output_result = 3; + * @return \Google\Cloud\Asset\V1\OutputResult|null + */ + public function getOutputResult() + { + return $this->output_result; + } + + public function hasOutputResult() + { + return isset($this->output_result); + } + + public function clearOutputResult() + { + unset($this->output_result); + } + + /** + * Output result indicating where the assets were exported to. For example, a + * set of actual Cloud Storage object URIs where the assets are exported to. + * The URIs can be different from what [output_config] has specified, as the + * service will split the output object into multiple ones once it exceeds a + * single Cloud Storage object limit. + * + * Generated from protobuf field .google.cloud.asset.v1.OutputResult output_result = 3; + * @param \Google\Cloud\Asset\V1\OutputResult $var + * @return $this + */ + public function setOutputResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\OutputResult::class); + $this->output_result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Feed.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Feed.php new file mode 100644 index 000000000000..f99fc94745df --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Feed.php @@ -0,0 +1,467 @@ +google.cloud.asset.v1.Feed + */ +class Feed extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The format will be + * projects/{project_number}/feeds/{client-assigned_feed_identifier} or + * folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + * organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + * The client-assigned feed identifier must be unique within the parent + * project/folder/organization. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * A list of the full names of the assets to receive updates. You must specify + * either or both of asset_names and asset_types. Only asset updates matching + * specified asset_names or asset_types are exported to the feed. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * For a list of the full names for supported asset types, see [Resource + * name format](/asset-inventory/docs/resource-name-format). + * + * Generated from protobuf field repeated string asset_names = 2; + */ + private $asset_names; + /** + * A list of types of the assets to receive updates. You must specify either + * or both of asset_names and asset_types. Only asset updates matching + * specified asset_names or asset_types are exported to the feed. + * Example: `"compute.googleapis.com/Disk"` + * For a list of all supported asset types, see + * [Supported asset types](/asset-inventory/docs/supported-asset-types). + * + * Generated from protobuf field repeated string asset_types = 3; + */ + private $asset_types; + /** + * Asset content type. If not specified, no content but the asset name and + * type will be returned. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 4; + */ + protected $content_type = 0; + /** + * Required. Feed output configuration defining where the asset updates are + * published to. + * + * Generated from protobuf field .google.cloud.asset.v1.FeedOutputConfig feed_output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $feed_output_config = null; + /** + * A condition which determines whether an asset update should be published. + * If specified, an asset will be returned only when the expression evaluates + * to true. + * When set, `expression` field in the `Expr` must be a valid [CEL expression] + * (https://github.com/google/cel-spec) on a TemporalAsset with name + * `temporal_asset`. Example: a Feed with expression ("temporal_asset.deleted + * == true") will only publish Asset deletions. Other fields of `Expr` are + * optional. + * See our [user + * guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes-with-condition) + * for detailed instructions. + * + * Generated from protobuf field .google.type.Expr condition = 6; + */ + protected $condition = null; + /** + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationship updates on the [asset_names] or the + * [asset_types]. It returns an error if any of the [relationship_types] + * doesn't belong to the supported relationship types of the [asset_names] or + * [asset_types], or any of the [asset_names] or the [asset_types] doesn't + * belong to the source types of the [relationship_types]. + * * Otherwise: + * it outputs the supported relationships of the types of [asset_names] and + * [asset_types] or returns an error if any of the [asset_names] or the + * [asset_types] has no replationship support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 7; + */ + private $relationship_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The format will be + * projects/{project_number}/feeds/{client-assigned_feed_identifier} or + * folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + * organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + * The client-assigned feed identifier must be unique within the parent + * project/folder/organization. + * @type array|\Google\Protobuf\Internal\RepeatedField $asset_names + * A list of the full names of the assets to receive updates. You must specify + * either or both of asset_names and asset_types. Only asset updates matching + * specified asset_names or asset_types are exported to the feed. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * For a list of the full names for supported asset types, see [Resource + * name format](/asset-inventory/docs/resource-name-format). + * @type array|\Google\Protobuf\Internal\RepeatedField $asset_types + * A list of types of the assets to receive updates. You must specify either + * or both of asset_names and asset_types. Only asset updates matching + * specified asset_names or asset_types are exported to the feed. + * Example: `"compute.googleapis.com/Disk"` + * For a list of all supported asset types, see + * [Supported asset types](/asset-inventory/docs/supported-asset-types). + * @type int $content_type + * Asset content type. If not specified, no content but the asset name and + * type will be returned. + * @type \Google\Cloud\Asset\V1\FeedOutputConfig $feed_output_config + * Required. Feed output configuration defining where the asset updates are + * published to. + * @type \Google\Type\Expr $condition + * A condition which determines whether an asset update should be published. + * If specified, an asset will be returned only when the expression evaluates + * to true. + * When set, `expression` field in the `Expr` must be a valid [CEL expression] + * (https://github.com/google/cel-spec) on a TemporalAsset with name + * `temporal_asset`. Example: a Feed with expression ("temporal_asset.deleted + * == true") will only publish Asset deletions. Other fields of `Expr` are + * optional. + * See our [user + * guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes-with-condition) + * for detailed instructions. + * @type array|\Google\Protobuf\Internal\RepeatedField $relationship_types + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationship updates on the [asset_names] or the + * [asset_types]. It returns an error if any of the [relationship_types] + * doesn't belong to the supported relationship types of the [asset_names] or + * [asset_types], or any of the [asset_names] or the [asset_types] doesn't + * belong to the source types of the [relationship_types]. + * * Otherwise: + * it outputs the supported relationships of the types of [asset_names] and + * [asset_types] or returns an error if any of the [asset_names] or the + * [asset_types] has no replationship support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The format will be + * projects/{project_number}/feeds/{client-assigned_feed_identifier} or + * folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + * organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + * The client-assigned feed identifier must be unique within the parent + * project/folder/organization. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The format will be + * projects/{project_number}/feeds/{client-assigned_feed_identifier} or + * folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + * organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + * The client-assigned feed identifier must be unique within the parent + * project/folder/organization. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A list of the full names of the assets to receive updates. You must specify + * either or both of asset_names and asset_types. Only asset updates matching + * specified asset_names or asset_types are exported to the feed. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * For a list of the full names for supported asset types, see [Resource + * name format](/asset-inventory/docs/resource-name-format). + * + * Generated from protobuf field repeated string asset_names = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssetNames() + { + return $this->asset_names; + } + + /** + * A list of the full names of the assets to receive updates. You must specify + * either or both of asset_names and asset_types. Only asset updates matching + * specified asset_names or asset_types are exported to the feed. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * For a list of the full names for supported asset types, see [Resource + * name format](/asset-inventory/docs/resource-name-format). + * + * Generated from protobuf field repeated string asset_names = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssetNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->asset_names = $arr; + + return $this; + } + + /** + * A list of types of the assets to receive updates. You must specify either + * or both of asset_names and asset_types. Only asset updates matching + * specified asset_names or asset_types are exported to the feed. + * Example: `"compute.googleapis.com/Disk"` + * For a list of all supported asset types, see + * [Supported asset types](/asset-inventory/docs/supported-asset-types). + * + * Generated from protobuf field repeated string asset_types = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssetTypes() + { + return $this->asset_types; + } + + /** + * A list of types of the assets to receive updates. You must specify either + * or both of asset_names and asset_types. Only asset updates matching + * specified asset_names or asset_types are exported to the feed. + * Example: `"compute.googleapis.com/Disk"` + * For a list of all supported asset types, see + * [Supported asset types](/asset-inventory/docs/supported-asset-types). + * + * Generated from protobuf field repeated string asset_types = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssetTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->asset_types = $arr; + + return $this; + } + + /** + * Asset content type. If not specified, no content but the asset name and + * type will be returned. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 4; + * @return int + */ + public function getContentType() + { + return $this->content_type; + } + + /** + * Asset content type. If not specified, no content but the asset name and + * type will be returned. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 4; + * @param int $var + * @return $this + */ + public function setContentType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Asset\V1\ContentType::class); + $this->content_type = $var; + + return $this; + } + + /** + * Required. Feed output configuration defining where the asset updates are + * published to. + * + * Generated from protobuf field .google.cloud.asset.v1.FeedOutputConfig feed_output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Asset\V1\FeedOutputConfig|null + */ + public function getFeedOutputConfig() + { + return $this->feed_output_config; + } + + public function hasFeedOutputConfig() + { + return isset($this->feed_output_config); + } + + public function clearFeedOutputConfig() + { + unset($this->feed_output_config); + } + + /** + * Required. Feed output configuration defining where the asset updates are + * published to. + * + * Generated from protobuf field .google.cloud.asset.v1.FeedOutputConfig feed_output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Asset\V1\FeedOutputConfig $var + * @return $this + */ + public function setFeedOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\FeedOutputConfig::class); + $this->feed_output_config = $var; + + return $this; + } + + /** + * A condition which determines whether an asset update should be published. + * If specified, an asset will be returned only when the expression evaluates + * to true. + * When set, `expression` field in the `Expr` must be a valid [CEL expression] + * (https://github.com/google/cel-spec) on a TemporalAsset with name + * `temporal_asset`. Example: a Feed with expression ("temporal_asset.deleted + * == true") will only publish Asset deletions. Other fields of `Expr` are + * optional. + * See our [user + * guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes-with-condition) + * for detailed instructions. + * + * Generated from protobuf field .google.type.Expr condition = 6; + * @return \Google\Type\Expr|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * A condition which determines whether an asset update should be published. + * If specified, an asset will be returned only when the expression evaluates + * to true. + * When set, `expression` field in the `Expr` must be a valid [CEL expression] + * (https://github.com/google/cel-spec) on a TemporalAsset with name + * `temporal_asset`. Example: a Feed with expression ("temporal_asset.deleted + * == true") will only publish Asset deletions. Other fields of `Expr` are + * optional. + * See our [user + * guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes-with-condition) + * for detailed instructions. + * + * Generated from protobuf field .google.type.Expr condition = 6; + * @param \Google\Type\Expr $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Type\Expr::class); + $this->condition = $var; + + return $this; + } + + /** + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationship updates on the [asset_names] or the + * [asset_types]. It returns an error if any of the [relationship_types] + * doesn't belong to the supported relationship types of the [asset_names] or + * [asset_types], or any of the [asset_names] or the [asset_types] doesn't + * belong to the source types of the [relationship_types]. + * * Otherwise: + * it outputs the supported relationships of the types of [asset_names] and + * [asset_types] or returns an error if any of the [asset_names] or the + * [asset_types] has no replationship support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelationshipTypes() + { + return $this->relationship_types; + } + + /** + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationship updates on the [asset_names] or the + * [asset_types]. It returns an error if any of the [relationship_types] + * doesn't belong to the supported relationship types of the [asset_names] or + * [asset_types], or any of the [asset_names] or the [asset_types] doesn't + * belong to the source types of the [relationship_types]. + * * Otherwise: + * it outputs the supported relationships of the types of [asset_names] and + * [asset_types] or returns an error if any of the [asset_names] or the + * [asset_types] has no replationship support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelationshipTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->relationship_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/FeedOutputConfig.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/FeedOutputConfig.php new file mode 100644 index 000000000000..429c1b3c1749 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/FeedOutputConfig.php @@ -0,0 +1,75 @@ +google.cloud.asset.v1.FeedOutputConfig + */ +class FeedOutputConfig extends \Google\Protobuf\Internal\Message +{ + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\PubsubDestination $pubsub_destination + * Destination on Pub/Sub. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Destination on Pub/Sub. + * + * Generated from protobuf field .google.cloud.asset.v1.PubsubDestination pubsub_destination = 1; + * @return \Google\Cloud\Asset\V1\PubsubDestination|null + */ + public function getPubsubDestination() + { + return $this->readOneof(1); + } + + public function hasPubsubDestination() + { + return $this->hasOneof(1); + } + + /** + * Destination on Pub/Sub. + * + * Generated from protobuf field .google.cloud.asset.v1.PubsubDestination pubsub_destination = 1; + * @param \Google\Cloud\Asset\V1\PubsubDestination $var + * @return $this + */ + public function setPubsubDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\PubsubDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GcsDestination.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GcsDestination.php new file mode 100644 index 000000000000..918f57ddbeb9 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GcsDestination.php @@ -0,0 +1,153 @@ +google.cloud.asset.v1.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + protected $object_uri; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * The URI of the Cloud Storage object. It's the same URI that is used by + * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + * Editing Object + * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + * for more information. + * If the specified Cloud Storage object already exists and there is no + * [hold](https://cloud.google.com/storage/docs/object-holds), it will be + * overwritten with the exported result. + * @type string $uri_prefix + * The URI prefix of all generated Cloud Storage objects. Example: + * "gs://bucket_name/object_name_prefix". Each object URI is in format: + * "gs://bucket_name/object_name_prefix// and only + * contains assets for that type. starts from 0. Example: + * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is + * the first shard of output objects containing all + * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be + * returned if file with the same name "gs://bucket_name/object_name_prefix" + * already exists. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The URI of the Cloud Storage object. It's the same URI that is used by + * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + * Editing Object + * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + * for more information. + * If the specified Cloud Storage object already exists and there is no + * [hold](https://cloud.google.com/storage/docs/object-holds), it will be + * overwritten with the exported result. + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->readOneof(1); + } + + public function hasUri() + { + return $this->hasOneof(1); + } + + /** + * The URI of the Cloud Storage object. It's the same URI that is used by + * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + * Editing Object + * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + * for more information. + * If the specified Cloud Storage object already exists and there is no + * [hold](https://cloud.google.com/storage/docs/object-holds), it will be + * overwritten with the exported result. + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The URI prefix of all generated Cloud Storage objects. Example: + * "gs://bucket_name/object_name_prefix". Each object URI is in format: + * "gs://bucket_name/object_name_prefix// and only + * contains assets for that type. starts from 0. Example: + * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is + * the first shard of output objects containing all + * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be + * returned if file with the same name "gs://bucket_name/object_name_prefix" + * already exists. + * + * Generated from protobuf field string uri_prefix = 2; + * @return string + */ + public function getUriPrefix() + { + return $this->readOneof(2); + } + + public function hasUriPrefix() + { + return $this->hasOneof(2); + } + + /** + * The URI prefix of all generated Cloud Storage objects. Example: + * "gs://bucket_name/object_name_prefix". Each object URI is in format: + * "gs://bucket_name/object_name_prefix// and only + * contains assets for that type. starts from 0. Example: + * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is + * the first shard of output objects containing all + * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be + * returned if file with the same name "gs://bucket_name/object_name_prefix" + * already exists. + * + * Generated from protobuf field string uri_prefix = 2; + * @param string $var + * @return $this + */ + public function setUriPrefix($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getObjectUri() + { + return $this->whichOneof("object_uri"); + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GcsOutputResult.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GcsOutputResult.php new file mode 100644 index 000000000000..0c04c6442dfb --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GcsOutputResult.php @@ -0,0 +1,71 @@ +google.cloud.asset.v1.GcsOutputResult + */ +class GcsOutputResult extends \Google\Protobuf\Internal\Message +{ + /** + * List of URIs of the Cloud Storage objects. Example: + * "gs://bucket_name/object_name". + * + * Generated from protobuf field repeated string uris = 1; + */ + private $uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $uris + * List of URIs of the Cloud Storage objects. Example: + * "gs://bucket_name/object_name". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * List of URIs of the Cloud Storage objects. Example: + * "gs://bucket_name/object_name". + * + * Generated from protobuf field repeated string uris = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUris() + { + return $this->uris; + } + + /** + * List of URIs of the Cloud Storage objects. Example: + * "gs://bucket_name/object_name". + * + * Generated from protobuf field repeated string uris = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->uris = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GetFeedRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GetFeedRequest.php new file mode 100644 index 000000000000..75212d92676b --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GetFeedRequest.php @@ -0,0 +1,96 @@ +google.cloud.asset.v1.GetFeedRequest + */ +class GetFeedRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * Please see {@see AssetServiceClient::feedName()} for help formatting this field. + * + * @return \Google\Cloud\Asset\V1\GetFeedRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GetSavedQueryRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GetSavedQueryRequest.php new file mode 100644 index 000000000000..11f6e5810471 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/GetSavedQueryRequest.php @@ -0,0 +1,97 @@ +google.cloud.asset.v1.GetSavedQueryRequest + */ +class GetSavedQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the saved query and it must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the saved query and it must be in the format of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * Please see {@see AssetServiceClient::savedQueryName()} for help formatting this field. + * + * @return \Google\Cloud\Asset\V1\GetSavedQueryRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the saved query and it must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the saved query and it must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the saved query and it must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig.php new file mode 100644 index 000000000000..c5920d7aafd3 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig.php @@ -0,0 +1,108 @@ +google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + */ +class IamPolicyAnalysisOutputConfig extends \Google\Protobuf\Internal\Message +{ + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig\GcsDestination $gcs_destination + * Destination on Cloud Storage. + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig\BigQueryDestination $bigquery_destination + * Destination on BigQuery. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Destination on Cloud Storage. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination gcs_destination = 1; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * Destination on Cloud Storage. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination gcs_destination = 1; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Destination on BigQuery. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination bigquery_destination = 2; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig\BigQueryDestination|null + */ + public function getBigqueryDestination() + { + return $this->readOneof(2); + } + + public function hasBigqueryDestination() + { + return $this->hasOneof(2); + } + + /** + * Destination on BigQuery. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination bigquery_destination = 2; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig\BigQueryDestination $var + * @return $this + */ + public function setBigqueryDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig\BigQueryDestination::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig/BigQueryDestination.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig/BigQueryDestination.php new file mode 100644 index 000000000000..b3af2480f5cd --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig/BigQueryDestination.php @@ -0,0 +1,252 @@ +google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + */ +class BigQueryDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The BigQuery dataset in format + * "projects/projectId/datasets/datasetId", to which the analysis results + * should be exported. If this dataset does not exist, the export call will + * return an INVALID_ARGUMENT error. + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset = ''; + /** + * Required. The prefix of the BigQuery tables to which the analysis results + * will be written. Tables will be created based on this table_prefix if not + * exist: + * * _analysis table will contain export operation's metadata. + * * _analysis_result will contain all the + * [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult]. + * When [partition_key] is specified, both tables will be partitioned based + * on the [partition_key]. + * + * Generated from protobuf field string table_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table_prefix = ''; + /** + * The partition key for BigQuery partitioned table. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey partition_key = 3; + */ + protected $partition_key = 0; + /** + * Optional. Specifies the action that occurs if the destination table or + * partition already exists. The following values are supported: + * * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + * overwrites the entire table or all the partitions data. + * * WRITE_APPEND: If the table or partition already exists, BigQuery + * appends the data to the table or the latest partition. + * * WRITE_EMPTY: If the table already exists and contains data, an error is + * returned. + * The default value is WRITE_APPEND. Each action is atomic and only occurs + * if BigQuery is able to complete the job successfully. Details are at + * https://cloud.google.com/bigquery/docs/loading-data-local#appending_to_or_overwriting_a_table_using_a_local_file. + * + * Generated from protobuf field string write_disposition = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $write_disposition = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset + * Required. The BigQuery dataset in format + * "projects/projectId/datasets/datasetId", to which the analysis results + * should be exported. If this dataset does not exist, the export call will + * return an INVALID_ARGUMENT error. + * @type string $table_prefix + * Required. The prefix of the BigQuery tables to which the analysis results + * will be written. Tables will be created based on this table_prefix if not + * exist: + * * _analysis table will contain export operation's metadata. + * * _analysis_result will contain all the + * [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult]. + * When [partition_key] is specified, both tables will be partitioned based + * on the [partition_key]. + * @type int $partition_key + * The partition key for BigQuery partitioned table. + * @type string $write_disposition + * Optional. Specifies the action that occurs if the destination table or + * partition already exists. The following values are supported: + * * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + * overwrites the entire table or all the partitions data. + * * WRITE_APPEND: If the table or partition already exists, BigQuery + * appends the data to the table or the latest partition. + * * WRITE_EMPTY: If the table already exists and contains data, an error is + * returned. + * The default value is WRITE_APPEND. Each action is atomic and only occurs + * if BigQuery is able to complete the job successfully. Details are at + * https://cloud.google.com/bigquery/docs/loading-data-local#appending_to_or_overwriting_a_table_using_a_local_file. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The BigQuery dataset in format + * "projects/projectId/datasets/datasetId", to which the analysis results + * should be exported. If this dataset does not exist, the export call will + * return an INVALID_ARGUMENT error. + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataset() + { + return $this->dataset; + } + + /** + * Required. The BigQuery dataset in format + * "projects/projectId/datasets/datasetId", to which the analysis results + * should be exported. If this dataset does not exist, the export call will + * return an INVALID_ARGUMENT error. + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkString($var, True); + $this->dataset = $var; + + return $this; + } + + /** + * Required. The prefix of the BigQuery tables to which the analysis results + * will be written. Tables will be created based on this table_prefix if not + * exist: + * * _analysis table will contain export operation's metadata. + * * _analysis_result will contain all the + * [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult]. + * When [partition_key] is specified, both tables will be partitioned based + * on the [partition_key]. + * + * Generated from protobuf field string table_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTablePrefix() + { + return $this->table_prefix; + } + + /** + * Required. The prefix of the BigQuery tables to which the analysis results + * will be written. Tables will be created based on this table_prefix if not + * exist: + * * _analysis table will contain export operation's metadata. + * * _analysis_result will contain all the + * [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult]. + * When [partition_key] is specified, both tables will be partitioned based + * on the [partition_key]. + * + * Generated from protobuf field string table_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTablePrefix($var) + { + GPBUtil::checkString($var, True); + $this->table_prefix = $var; + + return $this; + } + + /** + * The partition key for BigQuery partitioned table. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey partition_key = 3; + * @return int + */ + public function getPartitionKey() + { + return $this->partition_key; + } + + /** + * The partition key for BigQuery partitioned table. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey partition_key = 3; + * @param int $var + * @return $this + */ + public function setPartitionKey($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig\BigQueryDestination\PartitionKey::class); + $this->partition_key = $var; + + return $this; + } + + /** + * Optional. Specifies the action that occurs if the destination table or + * partition already exists. The following values are supported: + * * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + * overwrites the entire table or all the partitions data. + * * WRITE_APPEND: If the table or partition already exists, BigQuery + * appends the data to the table or the latest partition. + * * WRITE_EMPTY: If the table already exists and contains data, an error is + * returned. + * The default value is WRITE_APPEND. Each action is atomic and only occurs + * if BigQuery is able to complete the job successfully. Details are at + * https://cloud.google.com/bigquery/docs/loading-data-local#appending_to_or_overwriting_a_table_using_a_local_file. + * + * Generated from protobuf field string write_disposition = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getWriteDisposition() + { + return $this->write_disposition; + } + + /** + * Optional. Specifies the action that occurs if the destination table or + * partition already exists. The following values are supported: + * * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + * overwrites the entire table or all the partitions data. + * * WRITE_APPEND: If the table or partition already exists, BigQuery + * appends the data to the table or the latest partition. + * * WRITE_EMPTY: If the table already exists and contains data, an error is + * returned. + * The default value is WRITE_APPEND. Each action is atomic and only occurs + * if BigQuery is able to complete the job successfully. Details are at + * https://cloud.google.com/bigquery/docs/loading-data-local#appending_to_or_overwriting_a_table_using_a_local_file. + * + * Generated from protobuf field string write_disposition = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setWriteDisposition($var) + { + GPBUtil::checkString($var, True); + $this->write_disposition = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BigQueryDestination::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig_BigQueryDestination::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig/BigQueryDestination/PartitionKey.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig/BigQueryDestination/PartitionKey.php new file mode 100644 index 000000000000..6902ee9a90e7 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig/BigQueryDestination/PartitionKey.php @@ -0,0 +1,63 @@ +google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey + */ +class PartitionKey +{ + /** + * Unspecified partition key. Tables won't be partitioned using this + * option. + * + * Generated from protobuf enum PARTITION_KEY_UNSPECIFIED = 0; + */ + const PARTITION_KEY_UNSPECIFIED = 0; + /** + * The time when the request is received. If specified as partition key, + * the result table(s) is partitoned by the RequestTime column, an + * additional timestamp column representing when the request was received. + * + * Generated from protobuf enum REQUEST_TIME = 1; + */ + const REQUEST_TIME = 1; + + private static $valueToName = [ + self::PARTITION_KEY_UNSPECIFIED => 'PARTITION_KEY_UNSPECIFIED', + self::REQUEST_TIME => 'REQUEST_TIME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PartitionKey::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig_BigQueryDestination_PartitionKey::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig/GcsDestination.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig/GcsDestination.php new file mode 100644 index 000000000000..a255efdb2975 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisOutputConfig/GcsDestination.php @@ -0,0 +1,98 @@ +google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The URI of the Cloud Storage object. It's the same URI that is + * used by gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + * Editing Object + * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + * for more information. + * If the specified Cloud Storage object already exists and there is no + * [hold](https://cloud.google.com/storage/docs/object-holds), it will be + * overwritten with the analysis result. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. The URI of the Cloud Storage object. It's the same URI that is + * used by gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + * Editing Object + * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + * for more information. + * If the specified Cloud Storage object already exists and there is no + * [hold](https://cloud.google.com/storage/docs/object-holds), it will be + * overwritten with the analysis result. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URI of the Cloud Storage object. It's the same URI that is + * used by gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + * Editing Object + * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + * for more information. + * If the specified Cloud Storage object already exists and there is no + * [hold](https://cloud.google.com/storage/docs/object-holds), it will be + * overwritten with the analysis result. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. The URI of the Cloud Storage object. It's the same URI that is + * used by gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + * Editing Object + * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + * for more information. + * If the specified Cloud Storage object already exists and there is no + * [hold](https://cloud.google.com/storage/docs/object-holds), it will be + * overwritten with the analysis result. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GcsDestination::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig_GcsDestination::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery.php new file mode 100644 index 000000000000..bf8de70d77ad --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery.php @@ -0,0 +1,319 @@ +google.cloud.asset.v1.IamPolicyAnalysisQuery + */ +class IamPolicyAnalysisQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The relative name of the root asset. Only resources and IAM + * policies within the scope will be analyzed. + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * To know how to get organization ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * To know how to get folder or project ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope = ''; + /** + * Optional. Specifies a resource for analysis. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector resource_selector = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $resource_selector = null; + /** + * Optional. Specifies an identity for analysis. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector identity_selector = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $identity_selector = null; + /** + * Optional. Specifies roles or permissions for analysis. This is optional. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector access_selector = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $access_selector = null; + /** + * Optional. The query options. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.Options options = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $options = null; + /** + * Optional. The hypothetical context for IAM conditions evaluation. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext condition_context = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $condition_context = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $scope + * Required. The relative name of the root asset. Only resources and IAM + * policies within the scope will be analyzed. + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * To know how to get organization ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * To know how to get folder or project ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\ResourceSelector $resource_selector + * Optional. Specifies a resource for analysis. + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\IdentitySelector $identity_selector + * Optional. Specifies an identity for analysis. + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\AccessSelector $access_selector + * Optional. Specifies roles or permissions for analysis. This is optional. + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\Options $options + * Optional. The query options. + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\ConditionContext $condition_context + * Optional. The hypothetical context for IAM conditions evaluation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The relative name of the root asset. Only resources and IAM + * policies within the scope will be analyzed. + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * To know how to get organization ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * To know how to get folder or project ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * Required. The relative name of the root asset. Only resources and IAM + * policies within the scope will be analyzed. + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * To know how to get organization ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * To know how to get folder or project ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + + /** + * Optional. Specifies a resource for analysis. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector resource_selector = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\ResourceSelector|null + */ + public function getResourceSelector() + { + return $this->resource_selector; + } + + public function hasResourceSelector() + { + return isset($this->resource_selector); + } + + public function clearResourceSelector() + { + unset($this->resource_selector); + } + + /** + * Optional. Specifies a resource for analysis. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector resource_selector = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\ResourceSelector $var + * @return $this + */ + public function setResourceSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\ResourceSelector::class); + $this->resource_selector = $var; + + return $this; + } + + /** + * Optional. Specifies an identity for analysis. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector identity_selector = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\IdentitySelector|null + */ + public function getIdentitySelector() + { + return $this->identity_selector; + } + + public function hasIdentitySelector() + { + return isset($this->identity_selector); + } + + public function clearIdentitySelector() + { + unset($this->identity_selector); + } + + /** + * Optional. Specifies an identity for analysis. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector identity_selector = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\IdentitySelector $var + * @return $this + */ + public function setIdentitySelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\IdentitySelector::class); + $this->identity_selector = $var; + + return $this; + } + + /** + * Optional. Specifies roles or permissions for analysis. This is optional. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector access_selector = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\AccessSelector|null + */ + public function getAccessSelector() + { + return $this->access_selector; + } + + public function hasAccessSelector() + { + return isset($this->access_selector); + } + + public function clearAccessSelector() + { + unset($this->access_selector); + } + + /** + * Optional. Specifies roles or permissions for analysis. This is optional. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector access_selector = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\AccessSelector $var + * @return $this + */ + public function setAccessSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\AccessSelector::class); + $this->access_selector = $var; + + return $this; + } + + /** + * Optional. The query options. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.Options options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\Options|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Optional. The query options. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.Options options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\Options $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\Options::class); + $this->options = $var; + + return $this; + } + + /** + * Optional. The hypothetical context for IAM conditions evaluation. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext condition_context = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\ConditionContext|null + */ + public function getConditionContext() + { + return $this->condition_context; + } + + public function hasConditionContext() + { + return isset($this->condition_context); + } + + public function clearConditionContext() + { + unset($this->condition_context); + } + + /** + * Optional. The hypothetical context for IAM conditions evaluation. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext condition_context = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\ConditionContext $var + * @return $this + */ + public function setConditionContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery\ConditionContext::class); + $this->condition_context = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/AccessSelector.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/AccessSelector.php new file mode 100644 index 000000000000..4300fff07a37 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/AccessSelector.php @@ -0,0 +1,108 @@ +google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + */ +class AccessSelector extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The roles to appear in result. + * + * Generated from protobuf field repeated string roles = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $roles; + /** + * Optional. The permissions to appear in result. + * + * Generated from protobuf field repeated string permissions = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $permissions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $roles + * Optional. The roles to appear in result. + * @type array|\Google\Protobuf\Internal\RepeatedField $permissions + * Optional. The permissions to appear in result. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The roles to appear in result. + * + * Generated from protobuf field repeated string roles = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoles() + { + return $this->roles; + } + + /** + * Optional. The roles to appear in result. + * + * Generated from protobuf field repeated string roles = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->roles = $arr; + + return $this; + } + + /** + * Optional. The permissions to appear in result. + * + * Generated from protobuf field repeated string permissions = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPermissions() + { + return $this->permissions; + } + + /** + * Optional. The permissions to appear in result. + * + * Generated from protobuf field repeated string permissions = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPermissions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->permissions = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AccessSelector::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery_AccessSelector::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/ConditionContext.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/ConditionContext.php new file mode 100644 index 000000000000..a8175ae7fc7e --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/ConditionContext.php @@ -0,0 +1,84 @@ +google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + */ +class ConditionContext extends \Google\Protobuf\Internal\Message +{ + protected $TimeContext; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $access_time + * The hypothetical access timestamp to evaluate IAM conditions. Note that + * this value must not be earlier than the current time; otherwise, an + * INVALID_ARGUMENT error will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The hypothetical access timestamp to evaluate IAM conditions. Note that + * this value must not be earlier than the current time; otherwise, an + * INVALID_ARGUMENT error will be returned. + * + * Generated from protobuf field .google.protobuf.Timestamp access_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getAccessTime() + { + return $this->readOneof(1); + } + + public function hasAccessTime() + { + return $this->hasOneof(1); + } + + /** + * The hypothetical access timestamp to evaluate IAM conditions. Note that + * this value must not be earlier than the current time; otherwise, an + * INVALID_ARGUMENT error will be returned. + * + * Generated from protobuf field .google.protobuf.Timestamp access_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setAccessTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getTimeContext() + { + return $this->whichOneof("TimeContext"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConditionContext::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery_ConditionContext::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/IdentitySelector.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/IdentitySelector.php new file mode 100644 index 000000000000..2bca0554f02f --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/IdentitySelector.php @@ -0,0 +1,108 @@ +google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + */ +class IdentitySelector extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The identity appear in the form of principals in + * [IAM policy + * binding](https://cloud.google.com/iam/reference/rest/v1/Binding). + * The examples of supported forms are: + * "user:mike@example.com", + * "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-project-id@appspot.gserviceaccount.com". + * Notice that wildcard characters (such as * and ?) are not supported. + * You must give a specific identity. + * + * Generated from protobuf field string identity = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $identity = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $identity + * Required. The identity appear in the form of principals in + * [IAM policy + * binding](https://cloud.google.com/iam/reference/rest/v1/Binding). + * The examples of supported forms are: + * "user:mike@example.com", + * "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-project-id@appspot.gserviceaccount.com". + * Notice that wildcard characters (such as * and ?) are not supported. + * You must give a specific identity. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The identity appear in the form of principals in + * [IAM policy + * binding](https://cloud.google.com/iam/reference/rest/v1/Binding). + * The examples of supported forms are: + * "user:mike@example.com", + * "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-project-id@appspot.gserviceaccount.com". + * Notice that wildcard characters (such as * and ?) are not supported. + * You must give a specific identity. + * + * Generated from protobuf field string identity = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getIdentity() + { + return $this->identity; + } + + /** + * Required. The identity appear in the form of principals in + * [IAM policy + * binding](https://cloud.google.com/iam/reference/rest/v1/Binding). + * The examples of supported forms are: + * "user:mike@example.com", + * "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-project-id@appspot.gserviceaccount.com". + * Notice that wildcard characters (such as * and ?) are not supported. + * You must give a specific identity. + * + * Generated from protobuf field string identity = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setIdentity($var) + { + GPBUtil::checkString($var, True); + $this->identity = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IdentitySelector::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery_IdentitySelector::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/Options.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/Options.php new file mode 100644 index 000000000000..aa83e164d5ba --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/Options.php @@ -0,0 +1,508 @@ +google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + */ +class Options extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If true, the identities section of the result will expand any + * Google groups appearing in an IAM policy binding. + * If + * [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] + * is specified, the identity in the result will be determined by the + * selector, and this flag is not allowed to set. + * If true, the default max expansion per group is 1000 for + * AssetService.AnalyzeIamPolicy][]. + * Default is false. + * + * Generated from protobuf field bool expand_groups = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $expand_groups = false; + /** + * Optional. If true, the access section of result will expand any roles + * appearing in IAM policy bindings to include their permissions. + * If + * [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] + * is specified, the access section of the result will be determined by the + * selector, and this flag is not allowed to set. + * Default is false. + * + * Generated from protobuf field bool expand_roles = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $expand_roles = false; + /** + * Optional. If true and + * [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + * is not specified, the resource section of the result will expand any + * resource attached to an IAM policy to include resources lower in the + * resource hierarchy. + * For example, if the request analyzes for which resources user A has + * permission P, and the results include an IAM policy with P on a Google + * Cloud folder, the results will also include resources in that folder with + * permission P. + * If true and + * [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + * is specified, the resource section of the result will expand the + * specified resource to include resources lower in the resource hierarchy. + * Only project or lower resources are supported. Folder and organization + * resources cannot be used together with this option. + * For example, if the request analyzes for which users have permission P on + * a Google Cloud project with this option enabled, the results will include + * all users who have permission P on that project or any lower resource. + * If true, the default max expansion per resource is 1000 for + * AssetService.AnalyzeIamPolicy][] and 100000 for + * AssetService.AnalyzeIamPolicyLongrunning][]. + * Default is false. + * + * Generated from protobuf field bool expand_resources = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $expand_resources = false; + /** + * Optional. If true, the result will output the relevant parent/child + * relationships between resources. Default is false. + * + * Generated from protobuf field bool output_resource_edges = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $output_resource_edges = false; + /** + * Optional. If true, the result will output the relevant membership + * relationships between groups and other groups, and between groups and + * principals. Default is false. + * + * Generated from protobuf field bool output_group_edges = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $output_group_edges = false; + /** + * Optional. If true, the response will include access analysis from + * identities to resources via service account impersonation. This is a very + * expensive operation, because many derived queries will be executed. We + * highly recommend you use + * [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + * RPC instead. + * For example, if the request analyzes for which resources user A has + * permission P, and there's an IAM policy states user A has + * iam.serviceAccounts.getAccessToken permission to a service account SA, + * and there's another IAM policy states service account SA has permission P + * to a Google Cloud folder F, then user A potentially has access to the + * Google Cloud folder F. And those advanced analysis results will be + * included in + * [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + * Another example, if the request analyzes for who has + * permission P to a Google Cloud folder F, and there's an IAM policy states + * user A has iam.serviceAccounts.actAs permission to a service account SA, + * and there's another IAM policy states service account SA has permission P + * to the Google Cloud folder F, then user A potentially has access to the + * Google Cloud folder F. And those advanced analysis results will be + * included in + * [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + * Only the following permissions are considered in this analysis: + * * `iam.serviceAccounts.actAs` + * * `iam.serviceAccounts.signBlob` + * * `iam.serviceAccounts.signJwt` + * * `iam.serviceAccounts.getAccessToken` + * * `iam.serviceAccounts.getOpenIdToken` + * * `iam.serviceAccounts.implicitDelegation` + * Default is false. + * + * Generated from protobuf field bool analyze_service_account_impersonation = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $analyze_service_account_impersonation = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $expand_groups + * Optional. If true, the identities section of the result will expand any + * Google groups appearing in an IAM policy binding. + * If + * [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] + * is specified, the identity in the result will be determined by the + * selector, and this flag is not allowed to set. + * If true, the default max expansion per group is 1000 for + * AssetService.AnalyzeIamPolicy][]. + * Default is false. + * @type bool $expand_roles + * Optional. If true, the access section of result will expand any roles + * appearing in IAM policy bindings to include their permissions. + * If + * [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] + * is specified, the access section of the result will be determined by the + * selector, and this flag is not allowed to set. + * Default is false. + * @type bool $expand_resources + * Optional. If true and + * [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + * is not specified, the resource section of the result will expand any + * resource attached to an IAM policy to include resources lower in the + * resource hierarchy. + * For example, if the request analyzes for which resources user A has + * permission P, and the results include an IAM policy with P on a Google + * Cloud folder, the results will also include resources in that folder with + * permission P. + * If true and + * [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + * is specified, the resource section of the result will expand the + * specified resource to include resources lower in the resource hierarchy. + * Only project or lower resources are supported. Folder and organization + * resources cannot be used together with this option. + * For example, if the request analyzes for which users have permission P on + * a Google Cloud project with this option enabled, the results will include + * all users who have permission P on that project or any lower resource. + * If true, the default max expansion per resource is 1000 for + * AssetService.AnalyzeIamPolicy][] and 100000 for + * AssetService.AnalyzeIamPolicyLongrunning][]. + * Default is false. + * @type bool $output_resource_edges + * Optional. If true, the result will output the relevant parent/child + * relationships between resources. Default is false. + * @type bool $output_group_edges + * Optional. If true, the result will output the relevant membership + * relationships between groups and other groups, and between groups and + * principals. Default is false. + * @type bool $analyze_service_account_impersonation + * Optional. If true, the response will include access analysis from + * identities to resources via service account impersonation. This is a very + * expensive operation, because many derived queries will be executed. We + * highly recommend you use + * [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + * RPC instead. + * For example, if the request analyzes for which resources user A has + * permission P, and there's an IAM policy states user A has + * iam.serviceAccounts.getAccessToken permission to a service account SA, + * and there's another IAM policy states service account SA has permission P + * to a Google Cloud folder F, then user A potentially has access to the + * Google Cloud folder F. And those advanced analysis results will be + * included in + * [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + * Another example, if the request analyzes for who has + * permission P to a Google Cloud folder F, and there's an IAM policy states + * user A has iam.serviceAccounts.actAs permission to a service account SA, + * and there's another IAM policy states service account SA has permission P + * to the Google Cloud folder F, then user A potentially has access to the + * Google Cloud folder F. And those advanced analysis results will be + * included in + * [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + * Only the following permissions are considered in this analysis: + * * `iam.serviceAccounts.actAs` + * * `iam.serviceAccounts.signBlob` + * * `iam.serviceAccounts.signJwt` + * * `iam.serviceAccounts.getAccessToken` + * * `iam.serviceAccounts.getOpenIdToken` + * * `iam.serviceAccounts.implicitDelegation` + * Default is false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If true, the identities section of the result will expand any + * Google groups appearing in an IAM policy binding. + * If + * [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] + * is specified, the identity in the result will be determined by the + * selector, and this flag is not allowed to set. + * If true, the default max expansion per group is 1000 for + * AssetService.AnalyzeIamPolicy][]. + * Default is false. + * + * Generated from protobuf field bool expand_groups = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getExpandGroups() + { + return $this->expand_groups; + } + + /** + * Optional. If true, the identities section of the result will expand any + * Google groups appearing in an IAM policy binding. + * If + * [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] + * is specified, the identity in the result will be determined by the + * selector, and this flag is not allowed to set. + * If true, the default max expansion per group is 1000 for + * AssetService.AnalyzeIamPolicy][]. + * Default is false. + * + * Generated from protobuf field bool expand_groups = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setExpandGroups($var) + { + GPBUtil::checkBool($var); + $this->expand_groups = $var; + + return $this; + } + + /** + * Optional. If true, the access section of result will expand any roles + * appearing in IAM policy bindings to include their permissions. + * If + * [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] + * is specified, the access section of the result will be determined by the + * selector, and this flag is not allowed to set. + * Default is false. + * + * Generated from protobuf field bool expand_roles = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getExpandRoles() + { + return $this->expand_roles; + } + + /** + * Optional. If true, the access section of result will expand any roles + * appearing in IAM policy bindings to include their permissions. + * If + * [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] + * is specified, the access section of the result will be determined by the + * selector, and this flag is not allowed to set. + * Default is false. + * + * Generated from protobuf field bool expand_roles = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setExpandRoles($var) + { + GPBUtil::checkBool($var); + $this->expand_roles = $var; + + return $this; + } + + /** + * Optional. If true and + * [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + * is not specified, the resource section of the result will expand any + * resource attached to an IAM policy to include resources lower in the + * resource hierarchy. + * For example, if the request analyzes for which resources user A has + * permission P, and the results include an IAM policy with P on a Google + * Cloud folder, the results will also include resources in that folder with + * permission P. + * If true and + * [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + * is specified, the resource section of the result will expand the + * specified resource to include resources lower in the resource hierarchy. + * Only project or lower resources are supported. Folder and organization + * resources cannot be used together with this option. + * For example, if the request analyzes for which users have permission P on + * a Google Cloud project with this option enabled, the results will include + * all users who have permission P on that project or any lower resource. + * If true, the default max expansion per resource is 1000 for + * AssetService.AnalyzeIamPolicy][] and 100000 for + * AssetService.AnalyzeIamPolicyLongrunning][]. + * Default is false. + * + * Generated from protobuf field bool expand_resources = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getExpandResources() + { + return $this->expand_resources; + } + + /** + * Optional. If true and + * [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + * is not specified, the resource section of the result will expand any + * resource attached to an IAM policy to include resources lower in the + * resource hierarchy. + * For example, if the request analyzes for which resources user A has + * permission P, and the results include an IAM policy with P on a Google + * Cloud folder, the results will also include resources in that folder with + * permission P. + * If true and + * [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + * is specified, the resource section of the result will expand the + * specified resource to include resources lower in the resource hierarchy. + * Only project or lower resources are supported. Folder and organization + * resources cannot be used together with this option. + * For example, if the request analyzes for which users have permission P on + * a Google Cloud project with this option enabled, the results will include + * all users who have permission P on that project or any lower resource. + * If true, the default max expansion per resource is 1000 for + * AssetService.AnalyzeIamPolicy][] and 100000 for + * AssetService.AnalyzeIamPolicyLongrunning][]. + * Default is false. + * + * Generated from protobuf field bool expand_resources = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setExpandResources($var) + { + GPBUtil::checkBool($var); + $this->expand_resources = $var; + + return $this; + } + + /** + * Optional. If true, the result will output the relevant parent/child + * relationships between resources. Default is false. + * + * Generated from protobuf field bool output_resource_edges = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getOutputResourceEdges() + { + return $this->output_resource_edges; + } + + /** + * Optional. If true, the result will output the relevant parent/child + * relationships between resources. Default is false. + * + * Generated from protobuf field bool output_resource_edges = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setOutputResourceEdges($var) + { + GPBUtil::checkBool($var); + $this->output_resource_edges = $var; + + return $this; + } + + /** + * Optional. If true, the result will output the relevant membership + * relationships between groups and other groups, and between groups and + * principals. Default is false. + * + * Generated from protobuf field bool output_group_edges = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getOutputGroupEdges() + { + return $this->output_group_edges; + } + + /** + * Optional. If true, the result will output the relevant membership + * relationships between groups and other groups, and between groups and + * principals. Default is false. + * + * Generated from protobuf field bool output_group_edges = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setOutputGroupEdges($var) + { + GPBUtil::checkBool($var); + $this->output_group_edges = $var; + + return $this; + } + + /** + * Optional. If true, the response will include access analysis from + * identities to resources via service account impersonation. This is a very + * expensive operation, because many derived queries will be executed. We + * highly recommend you use + * [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + * RPC instead. + * For example, if the request analyzes for which resources user A has + * permission P, and there's an IAM policy states user A has + * iam.serviceAccounts.getAccessToken permission to a service account SA, + * and there's another IAM policy states service account SA has permission P + * to a Google Cloud folder F, then user A potentially has access to the + * Google Cloud folder F. And those advanced analysis results will be + * included in + * [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + * Another example, if the request analyzes for who has + * permission P to a Google Cloud folder F, and there's an IAM policy states + * user A has iam.serviceAccounts.actAs permission to a service account SA, + * and there's another IAM policy states service account SA has permission P + * to the Google Cloud folder F, then user A potentially has access to the + * Google Cloud folder F. And those advanced analysis results will be + * included in + * [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + * Only the following permissions are considered in this analysis: + * * `iam.serviceAccounts.actAs` + * * `iam.serviceAccounts.signBlob` + * * `iam.serviceAccounts.signJwt` + * * `iam.serviceAccounts.getAccessToken` + * * `iam.serviceAccounts.getOpenIdToken` + * * `iam.serviceAccounts.implicitDelegation` + * Default is false. + * + * Generated from protobuf field bool analyze_service_account_impersonation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAnalyzeServiceAccountImpersonation() + { + return $this->analyze_service_account_impersonation; + } + + /** + * Optional. If true, the response will include access analysis from + * identities to resources via service account impersonation. This is a very + * expensive operation, because many derived queries will be executed. We + * highly recommend you use + * [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + * RPC instead. + * For example, if the request analyzes for which resources user A has + * permission P, and there's an IAM policy states user A has + * iam.serviceAccounts.getAccessToken permission to a service account SA, + * and there's another IAM policy states service account SA has permission P + * to a Google Cloud folder F, then user A potentially has access to the + * Google Cloud folder F. And those advanced analysis results will be + * included in + * [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + * Another example, if the request analyzes for who has + * permission P to a Google Cloud folder F, and there's an IAM policy states + * user A has iam.serviceAccounts.actAs permission to a service account SA, + * and there's another IAM policy states service account SA has permission P + * to the Google Cloud folder F, then user A potentially has access to the + * Google Cloud folder F. And those advanced analysis results will be + * included in + * [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + * Only the following permissions are considered in this analysis: + * * `iam.serviceAccounts.actAs` + * * `iam.serviceAccounts.signBlob` + * * `iam.serviceAccounts.signJwt` + * * `iam.serviceAccounts.getAccessToken` + * * `iam.serviceAccounts.getOpenIdToken` + * * `iam.serviceAccounts.implicitDelegation` + * Default is false. + * + * Generated from protobuf field bool analyze_service_account_impersonation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAnalyzeServiceAccountImpersonation($var) + { + GPBUtil::checkBool($var); + $this->analyze_service_account_impersonation = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Options::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery_Options::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/ResourceSelector.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/ResourceSelector.php new file mode 100644 index 000000000000..fb18d55f5bbb --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisQuery/ResourceSelector.php @@ -0,0 +1,84 @@ +google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + */ +class ResourceSelector extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of a resource of [supported resource + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types). + * + * Generated from protobuf field string full_resource_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $full_resource_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $full_resource_name + * Required. The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of a resource of [supported resource + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of a resource of [supported resource + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types). + * + * Generated from protobuf field string full_resource_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * Required. The [full resource name] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of a resource of [supported resource + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types). + * + * Generated from protobuf field string full_resource_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResourceSelector::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery_ResourceSelector::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult.php new file mode 100644 index 000000000000..7d3098780e3b --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult.php @@ -0,0 +1,268 @@ +google.cloud.asset.v1.IamPolicyAnalysisResult + */ +class IamPolicyAnalysisResult extends \Google\Protobuf\Internal\Message +{ + /** + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the resource to which the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * policy attaches. + * + * Generated from protobuf field string attached_resource_full_name = 1; + */ + protected $attached_resource_full_name = ''; + /** + * The IAM policy binding under analysis. + * + * Generated from protobuf field .google.iam.v1.Binding iam_binding = 2; + */ + protected $iam_binding = null; + /** + * The access control lists derived from the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * that match or potentially match resource and access selectors specified in + * the request. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList access_control_lists = 3; + */ + private $access_control_lists; + /** + * The identity list derived from members of the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * that match or potentially match identity selector specified in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList identity_list = 4; + */ + protected $identity_list = null; + /** + * Represents whether all analyses on the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * have successfully finished. + * + * Generated from protobuf field bool fully_explored = 5; + */ + protected $fully_explored = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attached_resource_full_name + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the resource to which the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * policy attaches. + * @type \Google\Cloud\Iam\V1\Binding $iam_binding + * The IAM policy binding under analysis. + * @type array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\AccessControlList>|\Google\Protobuf\Internal\RepeatedField $access_control_lists + * The access control lists derived from the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * that match or potentially match resource and access selectors specified in + * the request. + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisResult\IdentityList $identity_list + * The identity list derived from members of the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * that match or potentially match identity selector specified in the request. + * @type bool $fully_explored + * Represents whether all analyses on the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * have successfully finished. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the resource to which the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * policy attaches. + * + * Generated from protobuf field string attached_resource_full_name = 1; + * @return string + */ + public function getAttachedResourceFullName() + { + return $this->attached_resource_full_name; + } + + /** + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the resource to which the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * policy attaches. + * + * Generated from protobuf field string attached_resource_full_name = 1; + * @param string $var + * @return $this + */ + public function setAttachedResourceFullName($var) + { + GPBUtil::checkString($var, True); + $this->attached_resource_full_name = $var; + + return $this; + } + + /** + * The IAM policy binding under analysis. + * + * Generated from protobuf field .google.iam.v1.Binding iam_binding = 2; + * @return \Google\Cloud\Iam\V1\Binding|null + */ + public function getIamBinding() + { + return $this->iam_binding; + } + + public function hasIamBinding() + { + return isset($this->iam_binding); + } + + public function clearIamBinding() + { + unset($this->iam_binding); + } + + /** + * The IAM policy binding under analysis. + * + * Generated from protobuf field .google.iam.v1.Binding iam_binding = 2; + * @param \Google\Cloud\Iam\V1\Binding $var + * @return $this + */ + public function setIamBinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Binding::class); + $this->iam_binding = $var; + + return $this; + } + + /** + * The access control lists derived from the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * that match or potentially match resource and access selectors specified in + * the request. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList access_control_lists = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccessControlLists() + { + return $this->access_control_lists; + } + + /** + * The access control lists derived from the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * that match or potentially match resource and access selectors specified in + * the request. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList access_control_lists = 3; + * @param array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\AccessControlList>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccessControlLists($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult\AccessControlList::class); + $this->access_control_lists = $arr; + + return $this; + } + + /** + * The identity list derived from members of the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * that match or potentially match identity selector specified in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList identity_list = 4; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisResult\IdentityList|null + */ + public function getIdentityList() + { + return $this->identity_list; + } + + public function hasIdentityList() + { + return isset($this->identity_list); + } + + public function clearIdentityList() + { + unset($this->identity_list); + } + + /** + * The identity list derived from members of the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * that match or potentially match identity selector specified in the request. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList identity_list = 4; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisResult\IdentityList $var + * @return $this + */ + public function setIdentityList($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult\IdentityList::class); + $this->identity_list = $var; + + return $this; + } + + /** + * Represents whether all analyses on the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * have successfully finished. + * + * Generated from protobuf field bool fully_explored = 5; + * @return bool + */ + public function getFullyExplored() + { + return $this->fully_explored; + } + + /** + * Represents whether all analyses on the + * [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + * have successfully finished. + * + * Generated from protobuf field bool fully_explored = 5; + * @param bool $var + * @return $this + */ + public function setFullyExplored($var) + { + GPBUtil::checkBool($var); + $this->fully_explored = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Access.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Access.php new file mode 100644 index 000000000000..e7485733ea76 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Access.php @@ -0,0 +1,155 @@ +google.cloud.asset.v1.IamPolicyAnalysisResult.Access + */ +class Access extends \Google\Protobuf\Internal\Message +{ + /** + * The analysis state of this access. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisState analysis_state = 3; + */ + protected $analysis_state = null; + protected $oneof_access; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $role + * The role. + * @type string $permission + * The permission. + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisState $analysis_state + * The analysis state of this access. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The role. + * + * Generated from protobuf field string role = 1; + * @return string + */ + public function getRole() + { + return $this->readOneof(1); + } + + public function hasRole() + { + return $this->hasOneof(1); + } + + /** + * The role. + * + * Generated from protobuf field string role = 1; + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The permission. + * + * Generated from protobuf field string permission = 2; + * @return string + */ + public function getPermission() + { + return $this->readOneof(2); + } + + public function hasPermission() + { + return $this->hasOneof(2); + } + + /** + * The permission. + * + * Generated from protobuf field string permission = 2; + * @param string $var + * @return $this + */ + public function setPermission($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The analysis state of this access. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisState analysis_state = 3; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisState|null + */ + public function getAnalysisState() + { + return $this->analysis_state; + } + + public function hasAnalysisState() + { + return isset($this->analysis_state); + } + + public function clearAnalysisState() + { + unset($this->analysis_state); + } + + /** + * The analysis state of this access. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisState analysis_state = 3; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisState $var + * @return $this + */ + public function setAnalysisState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisState::class); + $this->analysis_state = $var; + + return $this; + } + + /** + * @return string + */ + public function getOneofAccess() + { + return $this->whichOneof("oneof_access"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Access::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult_Access::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/AccessControlList.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/AccessControlList.php new file mode 100644 index 000000000000..546498886774 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/AccessControlList.php @@ -0,0 +1,237 @@ +google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + */ +class AccessControlList extends \Google\Protobuf\Internal\Message +{ + /** + * The resources that match one of the following conditions: + * - The resource_selector, if it is specified in request; + * - Otherwise, resources reachable from the policy attached resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Resource resources = 1; + */ + private $resources; + /** + * The accesses that match one of the following conditions: + * - The access_selector, if it is specified in request; + * - Otherwise, access specifiers reachable from the policy binding's role. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Access accesses = 2; + */ + private $accesses; + /** + * Resource edges of the graph starting from the policy attached + * resource to any descendant resources. The + * [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + * contains the full resource name of a parent resource and + * [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + * contains the full resource name of a child resource. This field is + * present only if the output_resource_edges option is enabled in request. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Edge resource_edges = 3; + */ + private $resource_edges; + /** + * Condition evaluation for this AccessControlList, if there is a condition + * defined in the above IAM policy binding. + * + * Generated from protobuf field .google.cloud.asset.v1.ConditionEvaluation condition_evaluation = 4; + */ + protected $condition_evaluation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Resource>|\Google\Protobuf\Internal\RepeatedField $resources + * The resources that match one of the following conditions: + * - The resource_selector, if it is specified in request; + * - Otherwise, resources reachable from the policy attached resource. + * @type array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Access>|\Google\Protobuf\Internal\RepeatedField $accesses + * The accesses that match one of the following conditions: + * - The access_selector, if it is specified in request; + * - Otherwise, access specifiers reachable from the policy binding's role. + * @type array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Edge>|\Google\Protobuf\Internal\RepeatedField $resource_edges + * Resource edges of the graph starting from the policy attached + * resource to any descendant resources. The + * [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + * contains the full resource name of a parent resource and + * [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + * contains the full resource name of a child resource. This field is + * present only if the output_resource_edges option is enabled in request. + * @type \Google\Cloud\Asset\V1\ConditionEvaluation $condition_evaluation + * Condition evaluation for this AccessControlList, if there is a condition + * defined in the above IAM policy binding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The resources that match one of the following conditions: + * - The resource_selector, if it is specified in request; + * - Otherwise, resources reachable from the policy attached resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Resource resources = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResources() + { + return $this->resources; + } + + /** + * The resources that match one of the following conditions: + * - The resource_selector, if it is specified in request; + * - Otherwise, resources reachable from the policy attached resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Resource resources = 1; + * @param array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Resource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Resource::class); + $this->resources = $arr; + + return $this; + } + + /** + * The accesses that match one of the following conditions: + * - The access_selector, if it is specified in request; + * - Otherwise, access specifiers reachable from the policy binding's role. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Access accesses = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccesses() + { + return $this->accesses; + } + + /** + * The accesses that match one of the following conditions: + * - The access_selector, if it is specified in request; + * - Otherwise, access specifiers reachable from the policy binding's role. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Access accesses = 2; + * @param array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Access>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccesses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Access::class); + $this->accesses = $arr; + + return $this; + } + + /** + * Resource edges of the graph starting from the policy attached + * resource to any descendant resources. The + * [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + * contains the full resource name of a parent resource and + * [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + * contains the full resource name of a child resource. This field is + * present only if the output_resource_edges option is enabled in request. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Edge resource_edges = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceEdges() + { + return $this->resource_edges; + } + + /** + * Resource edges of the graph starting from the policy attached + * resource to any descendant resources. The + * [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + * contains the full resource name of a parent resource and + * [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + * contains the full resource name of a child resource. This field is + * present only if the output_resource_edges option is enabled in request. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Edge resource_edges = 3; + * @param array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Edge>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceEdges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Edge::class); + $this->resource_edges = $arr; + + return $this; + } + + /** + * Condition evaluation for this AccessControlList, if there is a condition + * defined in the above IAM policy binding. + * + * Generated from protobuf field .google.cloud.asset.v1.ConditionEvaluation condition_evaluation = 4; + * @return \Google\Cloud\Asset\V1\ConditionEvaluation|null + */ + public function getConditionEvaluation() + { + return $this->condition_evaluation; + } + + public function hasConditionEvaluation() + { + return isset($this->condition_evaluation); + } + + public function clearConditionEvaluation() + { + unset($this->condition_evaluation); + } + + /** + * Condition evaluation for this AccessControlList, if there is a condition + * defined in the above IAM policy binding. + * + * Generated from protobuf field .google.cloud.asset.v1.ConditionEvaluation condition_evaluation = 4; + * @param \Google\Cloud\Asset\V1\ConditionEvaluation $var + * @return $this + */ + public function setConditionEvaluation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\ConditionEvaluation::class); + $this->condition_evaluation = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AccessControlList::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult_AccessControlList::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Edge.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Edge.php new file mode 100644 index 000000000000..6ff59e6adb86 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Edge.php @@ -0,0 +1,112 @@ +google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + */ +class Edge extends \Google\Protobuf\Internal\Message +{ + /** + * The source node of the edge. For example, it could be a full resource + * name for a resource node or an email of an identity. + * + * Generated from protobuf field string source_node = 1; + */ + protected $source_node = ''; + /** + * The target node of the edge. For example, it could be a full resource + * name for a resource node or an email of an identity. + * + * Generated from protobuf field string target_node = 2; + */ + protected $target_node = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $source_node + * The source node of the edge. For example, it could be a full resource + * name for a resource node or an email of an identity. + * @type string $target_node + * The target node of the edge. For example, it could be a full resource + * name for a resource node or an email of an identity. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The source node of the edge. For example, it could be a full resource + * name for a resource node or an email of an identity. + * + * Generated from protobuf field string source_node = 1; + * @return string + */ + public function getSourceNode() + { + return $this->source_node; + } + + /** + * The source node of the edge. For example, it could be a full resource + * name for a resource node or an email of an identity. + * + * Generated from protobuf field string source_node = 1; + * @param string $var + * @return $this + */ + public function setSourceNode($var) + { + GPBUtil::checkString($var, True); + $this->source_node = $var; + + return $this; + } + + /** + * The target node of the edge. For example, it could be a full resource + * name for a resource node or an email of an identity. + * + * Generated from protobuf field string target_node = 2; + * @return string + */ + public function getTargetNode() + { + return $this->target_node; + } + + /** + * The target node of the edge. For example, it could be a full resource + * name for a resource node or an email of an identity. + * + * Generated from protobuf field string target_node = 2; + * @param string $var + * @return $this + */ + public function setTargetNode($var) + { + GPBUtil::checkString($var, True); + $this->target_node = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Edge::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult_Edge::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Identity.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Identity.php new file mode 100644 index 000000000000..7fb81d048292 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Identity.php @@ -0,0 +1,150 @@ +google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + */ +class Identity extends \Google\Protobuf\Internal\Message +{ + /** + * The identity of members, formatted as appear in an + * [IAM policy + * binding](https://cloud.google.com/iam/reference/rest/v1/Binding). For + * example, they might be formatted like the following: + * - user:foo@google.com + * - group:group1@google.com + * - serviceAccount:s1@prj1.iam.gserviceaccount.com + * - projectOwner:some_project_id + * - domain:google.com + * - allUsers + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The analysis state of this identity. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisState analysis_state = 2; + */ + protected $analysis_state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The identity of members, formatted as appear in an + * [IAM policy + * binding](https://cloud.google.com/iam/reference/rest/v1/Binding). For + * example, they might be formatted like the following: + * - user:foo@google.com + * - group:group1@google.com + * - serviceAccount:s1@prj1.iam.gserviceaccount.com + * - projectOwner:some_project_id + * - domain:google.com + * - allUsers + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisState $analysis_state + * The analysis state of this identity. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The identity of members, formatted as appear in an + * [IAM policy + * binding](https://cloud.google.com/iam/reference/rest/v1/Binding). For + * example, they might be formatted like the following: + * - user:foo@google.com + * - group:group1@google.com + * - serviceAccount:s1@prj1.iam.gserviceaccount.com + * - projectOwner:some_project_id + * - domain:google.com + * - allUsers + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The identity of members, formatted as appear in an + * [IAM policy + * binding](https://cloud.google.com/iam/reference/rest/v1/Binding). For + * example, they might be formatted like the following: + * - user:foo@google.com + * - group:group1@google.com + * - serviceAccount:s1@prj1.iam.gserviceaccount.com + * - projectOwner:some_project_id + * - domain:google.com + * - allUsers + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The analysis state of this identity. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisState analysis_state = 2; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisState|null + */ + public function getAnalysisState() + { + return $this->analysis_state; + } + + public function hasAnalysisState() + { + return isset($this->analysis_state); + } + + public function clearAnalysisState() + { + unset($this->analysis_state); + } + + /** + * The analysis state of this identity. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisState analysis_state = 2; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisState $var + * @return $this + */ + public function setAnalysisState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisState::class); + $this->analysis_state = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Identity::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult_Identity::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/IdentityList.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/IdentityList.php new file mode 100644 index 000000000000..83ce34566de4 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/IdentityList.php @@ -0,0 +1,152 @@ +google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + */ +class IdentityList extends \Google\Protobuf\Internal\Message +{ + /** + * Only the identities that match one of the following conditions will be + * presented: + * - The identity_selector, if it is specified in request; + * - Otherwise, identities reachable from the policy binding's members. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Identity identities = 1; + */ + private $identities; + /** + * Group identity edges of the graph starting from the binding's + * group members to any node of the + * [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. + * The + * [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + * contains a group, such as `group:parent@google.com`. The + * [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + * contains a member of the group, such as `group:child@google.com` or + * `user:foo@google.com`. This field is present only if the + * output_group_edges option is enabled in request. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Edge group_edges = 2; + */ + private $group_edges; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Identity>|\Google\Protobuf\Internal\RepeatedField $identities + * Only the identities that match one of the following conditions will be + * presented: + * - The identity_selector, if it is specified in request; + * - Otherwise, identities reachable from the policy binding's members. + * @type array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Edge>|\Google\Protobuf\Internal\RepeatedField $group_edges + * Group identity edges of the graph starting from the binding's + * group members to any node of the + * [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. + * The + * [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + * contains a group, such as `group:parent@google.com`. The + * [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + * contains a member of the group, such as `group:child@google.com` or + * `user:foo@google.com`. This field is present only if the + * output_group_edges option is enabled in request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * Only the identities that match one of the following conditions will be + * presented: + * - The identity_selector, if it is specified in request; + * - Otherwise, identities reachable from the policy binding's members. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Identity identities = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIdentities() + { + return $this->identities; + } + + /** + * Only the identities that match one of the following conditions will be + * presented: + * - The identity_selector, if it is specified in request; + * - Otherwise, identities reachable from the policy binding's members. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Identity identities = 1; + * @param array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Identity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIdentities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Identity::class); + $this->identities = $arr; + + return $this; + } + + /** + * Group identity edges of the graph starting from the binding's + * group members to any node of the + * [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. + * The + * [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + * contains a group, such as `group:parent@google.com`. The + * [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + * contains a member of the group, such as `group:child@google.com` or + * `user:foo@google.com`. This field is present only if the + * output_group_edges option is enabled in request. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Edge group_edges = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGroupEdges() + { + return $this->group_edges; + } + + /** + * Group identity edges of the graph starting from the binding's + * group members to any node of the + * [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. + * The + * [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + * contains a group, such as `group:parent@google.com`. The + * [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + * contains a member of the group, such as `group:child@google.com` or + * `user:foo@google.com`. This field is present only if the + * output_group_edges option is enabled in request. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicyAnalysisResult.Edge group_edges = 2; + * @param array<\Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Edge>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGroupEdges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult\Edge::class); + $this->group_edges = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IdentityList::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult_IdentityList::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Resource.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Resource.php new file mode 100644 index 000000000000..e8995d92953c --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisResult/Resource.php @@ -0,0 +1,118 @@ +google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + */ +class Resource extends \Google\Protobuf\Internal\Message +{ + /** + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * + * Generated from protobuf field string full_resource_name = 1; + */ + protected $full_resource_name = ''; + /** + * The analysis state of this resource. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisState analysis_state = 2; + */ + protected $analysis_state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $full_resource_name + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisState $analysis_state + * The analysis state of this resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * + * Generated from protobuf field string full_resource_name = 1; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * The [full resource + * name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * + * Generated from protobuf field string full_resource_name = 1; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + + /** + * The analysis state of this resource. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisState analysis_state = 2; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisState|null + */ + public function getAnalysisState() + { + return $this->analysis_state; + } + + public function hasAnalysisState() + { + return isset($this->analysis_state); + } + + public function clearAnalysisState() + { + unset($this->analysis_state); + } + + /** + * The analysis state of this resource. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisState analysis_state = 2; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisState $var + * @return $this + */ + public function setAnalysisState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisState::class); + $this->analysis_state = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Resource::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisResult_Resource::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisState.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisState.php new file mode 100644 index 000000000000..9ebcebbe8a81 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicyAnalysisState.php @@ -0,0 +1,122 @@ +google.cloud.asset.v1.IamPolicyAnalysisState + */ +class IamPolicyAnalysisState extends \Google\Protobuf\Internal\Message +{ + /** + * The Google standard error code that best describes the state. + * For example: + * - OK means the analysis on this entity has been successfully finished; + * - PERMISSION_DENIED means an access denied error is encountered; + * - DEADLINE_EXCEEDED means the analysis on this entity hasn't been started + * in time; + * + * Generated from protobuf field .google.rpc.Code code = 1; + */ + protected $code = 0; + /** + * The human-readable description of the cause of failure. + * + * Generated from protobuf field string cause = 2; + */ + protected $cause = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * The Google standard error code that best describes the state. + * For example: + * - OK means the analysis on this entity has been successfully finished; + * - PERMISSION_DENIED means an access denied error is encountered; + * - DEADLINE_EXCEEDED means the analysis on this entity hasn't been started + * in time; + * @type string $cause + * The human-readable description of the cause of failure. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The Google standard error code that best describes the state. + * For example: + * - OK means the analysis on this entity has been successfully finished; + * - PERMISSION_DENIED means an access denied error is encountered; + * - DEADLINE_EXCEEDED means the analysis on this entity hasn't been started + * in time; + * + * Generated from protobuf field .google.rpc.Code code = 1; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * The Google standard error code that best describes the state. + * For example: + * - OK means the analysis on this entity has been successfully finished; + * - PERMISSION_DENIED means an access denied error is encountered; + * - DEADLINE_EXCEEDED means the analysis on this entity hasn't been started + * in time; + * + * Generated from protobuf field .google.rpc.Code code = 1; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Google\Rpc\Code::class); + $this->code = $var; + + return $this; + } + + /** + * The human-readable description of the cause of failure. + * + * Generated from protobuf field string cause = 2; + * @return string + */ + public function getCause() + { + return $this->cause; + } + + /** + * The human-readable description of the cause of failure. + * + * Generated from protobuf field string cause = 2; + * @param string $var + * @return $this + */ + public function setCause($var) + { + GPBUtil::checkString($var, True); + $this->cause = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicySearchResult.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicySearchResult.php new file mode 100644 index 000000000000..2d9e36b7fb6a --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicySearchResult.php @@ -0,0 +1,451 @@ +google.cloud.asset.v1.IamPolicySearchResult + */ +class IamPolicySearchResult extends \Google\Protobuf\Internal\Message +{ + /** + * The full resource name of the resource associated with this IAM policy. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * To search against the `resource`: + * * use a field query. Example: `resource:organizations/123` + * + * Generated from protobuf field string resource = 1; + */ + protected $resource = ''; + /** + * The type of the resource associated with this IAM policy. Example: + * `compute.googleapis.com/Disk`. + * To search against the `asset_type`: + * * specify the `asset_types` field in your search request. + * + * Generated from protobuf field string asset_type = 5; + */ + protected $asset_type = ''; + /** + * The project that the associated Google Cloud resource belongs to, in the + * form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource + * (like VM instance, Cloud Storage bucket), the project field will indicate + * the project that contains the resource. If an IAM policy is set on a folder + * or orgnization, this field will be empty. + * To search against the `project`: + * * specify the `scope` field as this project in your search request. + * + * Generated from protobuf field string project = 2; + */ + protected $project = ''; + /** + * The folder(s) that the IAM policy belongs to, in the form of + * folders/{FOLDER_NUMBER}. This field is available when the IAM policy + * belongs to one or more folders. + * To search against `folders`: + * * use a field query. Example: `folders:(123 OR 456)` + * * use a free text query. Example: `123` + * * specify the `scope` field as this folder in your search request. + * + * Generated from protobuf field repeated string folders = 6; + */ + private $folders; + /** + * The organization that the IAM policy belongs to, in the form + * of organizations/{ORGANIZATION_NUMBER}. This field is available when the + * IAM policy belongs to an organization. + * To search against `organization`: + * * use a field query. Example: `organization:123` + * * use a free text query. Example: `123` + * * specify the `scope` field as this organization in your search request. + * + * Generated from protobuf field string organization = 7; + */ + protected $organization = ''; + /** + * The IAM policy directly set on the given resource. Note that the original + * IAM policy can contain multiple bindings. This only contains the bindings + * that match the given query. For queries that don't contain a constrain on + * policies (e.g., an empty query), this contains all the bindings. + * To search against the `policy` bindings: + * * use a field query: + * - query by the policy contained members. Example: + * `policy:amy@gmail.com` + * - query by the policy contained roles. Example: + * `policy:roles/compute.admin` + * - query by the policy contained roles' included permissions. Example: + * `policy.role.permissions:compute.instances.create` + * + * Generated from protobuf field .google.iam.v1.Policy policy = 3; + */ + protected $policy = null; + /** + * Explanation about the IAM policy search result. It contains additional + * information to explain why the search result matches the query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4; + */ + protected $explanation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * The full resource name of the resource associated with this IAM policy. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * To search against the `resource`: + * * use a field query. Example: `resource:organizations/123` + * @type string $asset_type + * The type of the resource associated with this IAM policy. Example: + * `compute.googleapis.com/Disk`. + * To search against the `asset_type`: + * * specify the `asset_types` field in your search request. + * @type string $project + * The project that the associated Google Cloud resource belongs to, in the + * form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource + * (like VM instance, Cloud Storage bucket), the project field will indicate + * the project that contains the resource. If an IAM policy is set on a folder + * or orgnization, this field will be empty. + * To search against the `project`: + * * specify the `scope` field as this project in your search request. + * @type array|\Google\Protobuf\Internal\RepeatedField $folders + * The folder(s) that the IAM policy belongs to, in the form of + * folders/{FOLDER_NUMBER}. This field is available when the IAM policy + * belongs to one or more folders. + * To search against `folders`: + * * use a field query. Example: `folders:(123 OR 456)` + * * use a free text query. Example: `123` + * * specify the `scope` field as this folder in your search request. + * @type string $organization + * The organization that the IAM policy belongs to, in the form + * of organizations/{ORGANIZATION_NUMBER}. This field is available when the + * IAM policy belongs to an organization. + * To search against `organization`: + * * use a field query. Example: `organization:123` + * * use a free text query. Example: `123` + * * specify the `scope` field as this organization in your search request. + * @type \Google\Cloud\Iam\V1\Policy $policy + * The IAM policy directly set on the given resource. Note that the original + * IAM policy can contain multiple bindings. This only contains the bindings + * that match the given query. For queries that don't contain a constrain on + * policies (e.g., an empty query), this contains all the bindings. + * To search against the `policy` bindings: + * * use a field query: + * - query by the policy contained members. Example: + * `policy:amy@gmail.com` + * - query by the policy contained roles. Example: + * `policy:roles/compute.admin` + * - query by the policy contained roles' included permissions. Example: + * `policy.role.permissions:compute.instances.create` + * @type \Google\Cloud\Asset\V1\IamPolicySearchResult\Explanation $explanation + * Explanation about the IAM policy search result. It contains additional + * information to explain why the search result matches the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The full resource name of the resource associated with this IAM policy. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * To search against the `resource`: + * * use a field query. Example: `resource:organizations/123` + * + * Generated from protobuf field string resource = 1; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * The full resource name of the resource associated with this IAM policy. + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * To search against the `resource`: + * * use a field query. Example: `resource:organizations/123` + * + * Generated from protobuf field string resource = 1; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The type of the resource associated with this IAM policy. Example: + * `compute.googleapis.com/Disk`. + * To search against the `asset_type`: + * * specify the `asset_types` field in your search request. + * + * Generated from protobuf field string asset_type = 5; + * @return string + */ + public function getAssetType() + { + return $this->asset_type; + } + + /** + * The type of the resource associated with this IAM policy. Example: + * `compute.googleapis.com/Disk`. + * To search against the `asset_type`: + * * specify the `asset_types` field in your search request. + * + * Generated from protobuf field string asset_type = 5; + * @param string $var + * @return $this + */ + public function setAssetType($var) + { + GPBUtil::checkString($var, True); + $this->asset_type = $var; + + return $this; + } + + /** + * The project that the associated Google Cloud resource belongs to, in the + * form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource + * (like VM instance, Cloud Storage bucket), the project field will indicate + * the project that contains the resource. If an IAM policy is set on a folder + * or orgnization, this field will be empty. + * To search against the `project`: + * * specify the `scope` field as this project in your search request. + * + * Generated from protobuf field string project = 2; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * The project that the associated Google Cloud resource belongs to, in the + * form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource + * (like VM instance, Cloud Storage bucket), the project field will indicate + * the project that contains the resource. If an IAM policy is set on a folder + * or orgnization, this field will be empty. + * To search against the `project`: + * * specify the `scope` field as this project in your search request. + * + * Generated from protobuf field string project = 2; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The folder(s) that the IAM policy belongs to, in the form of + * folders/{FOLDER_NUMBER}. This field is available when the IAM policy + * belongs to one or more folders. + * To search against `folders`: + * * use a field query. Example: `folders:(123 OR 456)` + * * use a free text query. Example: `123` + * * specify the `scope` field as this folder in your search request. + * + * Generated from protobuf field repeated string folders = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFolders() + { + return $this->folders; + } + + /** + * The folder(s) that the IAM policy belongs to, in the form of + * folders/{FOLDER_NUMBER}. This field is available when the IAM policy + * belongs to one or more folders. + * To search against `folders`: + * * use a field query. Example: `folders:(123 OR 456)` + * * use a free text query. Example: `123` + * * specify the `scope` field as this folder in your search request. + * + * Generated from protobuf field repeated string folders = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFolders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->folders = $arr; + + return $this; + } + + /** + * The organization that the IAM policy belongs to, in the form + * of organizations/{ORGANIZATION_NUMBER}. This field is available when the + * IAM policy belongs to an organization. + * To search against `organization`: + * * use a field query. Example: `organization:123` + * * use a free text query. Example: `123` + * * specify the `scope` field as this organization in your search request. + * + * Generated from protobuf field string organization = 7; + * @return string + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * The organization that the IAM policy belongs to, in the form + * of organizations/{ORGANIZATION_NUMBER}. This field is available when the + * IAM policy belongs to an organization. + * To search against `organization`: + * * use a field query. Example: `organization:123` + * * use a free text query. Example: `123` + * * specify the `scope` field as this organization in your search request. + * + * Generated from protobuf field string organization = 7; + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + + /** + * The IAM policy directly set on the given resource. Note that the original + * IAM policy can contain multiple bindings. This only contains the bindings + * that match the given query. For queries that don't contain a constrain on + * policies (e.g., an empty query), this contains all the bindings. + * To search against the `policy` bindings: + * * use a field query: + * - query by the policy contained members. Example: + * `policy:amy@gmail.com` + * - query by the policy contained roles. Example: + * `policy:roles/compute.admin` + * - query by the policy contained roles' included permissions. Example: + * `policy.role.permissions:compute.instances.create` + * + * Generated from protobuf field .google.iam.v1.Policy policy = 3; + * @return \Google\Cloud\Iam\V1\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * The IAM policy directly set on the given resource. Note that the original + * IAM policy can contain multiple bindings. This only contains the bindings + * that match the given query. For queries that don't contain a constrain on + * policies (e.g., an empty query), this contains all the bindings. + * To search against the `policy` bindings: + * * use a field query: + * - query by the policy contained members. Example: + * `policy:amy@gmail.com` + * - query by the policy contained roles. Example: + * `policy:roles/compute.admin` + * - query by the policy contained roles' included permissions. Example: + * `policy.role.permissions:compute.instances.create` + * + * Generated from protobuf field .google.iam.v1.Policy policy = 3; + * @param \Google\Cloud\Iam\V1\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\Policy::class); + $this->policy = $var; + + return $this; + } + + /** + * Explanation about the IAM policy search result. It contains additional + * information to explain why the search result matches the query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4; + * @return \Google\Cloud\Asset\V1\IamPolicySearchResult\Explanation|null + */ + public function getExplanation() + { + return $this->explanation; + } + + public function hasExplanation() + { + return isset($this->explanation); + } + + public function clearExplanation() + { + unset($this->explanation); + } + + /** + * Explanation about the IAM policy search result. It contains additional + * information to explain why the search result matches the query. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4; + * @param \Google\Cloud\Asset\V1\IamPolicySearchResult\Explanation $var + * @return $this + */ + public function setExplanation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicySearchResult\Explanation::class); + $this->explanation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicySearchResult/Explanation.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicySearchResult/Explanation.php new file mode 100644 index 000000000000..ab50a6e86090 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicySearchResult/Explanation.php @@ -0,0 +1,94 @@ +google.cloud.asset.v1.IamPolicySearchResult.Explanation + */ +class Explanation extends \Google\Protobuf\Internal\Message +{ + /** + * The map from roles to their included permissions that match the + * permission query (i.e., a query containing `policy.role.permissions:`). + * Example: if query `policy.role.permissions:compute.disk.get` + * matches a policy binding that contains owner role, the + * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The + * roles can also be found in the returned `policy` bindings. Note that the + * map is populated only for requests with permission queries. + * + * Generated from protobuf field map matched_permissions = 1; + */ + private $matched_permissions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $matched_permissions + * The map from roles to their included permissions that match the + * permission query (i.e., a query containing `policy.role.permissions:`). + * Example: if query `policy.role.permissions:compute.disk.get` + * matches a policy binding that contains owner role, the + * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The + * roles can also be found in the returned `policy` bindings. Note that the + * map is populated only for requests with permission queries. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The map from roles to their included permissions that match the + * permission query (i.e., a query containing `policy.role.permissions:`). + * Example: if query `policy.role.permissions:compute.disk.get` + * matches a policy binding that contains owner role, the + * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The + * roles can also be found in the returned `policy` bindings. Note that the + * map is populated only for requests with permission queries. + * + * Generated from protobuf field map matched_permissions = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMatchedPermissions() + { + return $this->matched_permissions; + } + + /** + * The map from roles to their included permissions that match the + * permission query (i.e., a query containing `policy.role.permissions:`). + * Example: if query `policy.role.permissions:compute.disk.get` + * matches a policy binding that contains owner role, the + * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The + * roles can also be found in the returned `policy` bindings. Note that the + * map is populated only for requests with permission queries. + * + * Generated from protobuf field map matched_permissions = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMatchedPermissions($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\IamPolicySearchResult\Explanation\Permissions::class); + $this->matched_permissions = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Explanation::class, \Google\Cloud\Asset\V1\IamPolicySearchResult_Explanation::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicySearchResult/Explanation/Permissions.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicySearchResult/Explanation/Permissions.php new file mode 100644 index 000000000000..7524b94e63b5 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/IamPolicySearchResult/Explanation/Permissions.php @@ -0,0 +1,70 @@ +google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + */ +class Permissions extends \Google\Protobuf\Internal\Message +{ + /** + * A list of permissions. A sample permission string: `compute.disk.get`. + * + * Generated from protobuf field repeated string permissions = 1; + */ + private $permissions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $permissions + * A list of permissions. A sample permission string: `compute.disk.get`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * A list of permissions. A sample permission string: `compute.disk.get`. + * + * Generated from protobuf field repeated string permissions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPermissions() + { + return $this->permissions; + } + + /** + * A list of permissions. A sample permission string: `compute.disk.get`. + * + * Generated from protobuf field repeated string permissions = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPermissions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->permissions = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Permissions::class, \Google\Cloud\Asset\V1\IamPolicySearchResult_Explanation_Permissions::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListAssetsRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListAssetsRequest.php new file mode 100644 index 000000000000..8209af3d0055 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListAssetsRequest.php @@ -0,0 +1,454 @@ +google.cloud.asset.v1.ListAssetsRequest + */ +class ListAssetsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 2; + */ + protected $read_time = null; + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expression is also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * + * Generated from protobuf field repeated string asset_types = 3; + */ + private $asset_types; + /** + * Asset content type. If not specified, no content but the asset name will + * be returned. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 4; + */ + protected $content_type = 0; + /** + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * + * Generated from protobuf field int32 page_size = 5; + */ + protected $page_size = 0; + /** + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * + * Generated from protobuf field string page_token = 6; + */ + protected $page_token = ''; + /** + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 7; + */ + private $relationship_types; + + /** + * @param string $parent Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * + * @return \Google\Cloud\Asset\V1\ListAssetsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * @type \Google\Protobuf\Timestamp $read_time + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @type array|\Google\Protobuf\Internal\RepeatedField $asset_types + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expression is also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @type int $content_type + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @type int $page_size + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @type string $page_token + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @type array|\Google\Protobuf\Internal\RepeatedField $relationship_types + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expression is also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * + * Generated from protobuf field repeated string asset_types = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssetTypes() + { + return $this->asset_types; + } + + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expression is also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * + * Generated from protobuf field repeated string asset_types = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssetTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->asset_types = $arr; + + return $this; + } + + /** + * Asset content type. If not specified, no content but the asset name will + * be returned. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 4; + * @return int + */ + public function getContentType() + { + return $this->content_type; + } + + /** + * Asset content type. If not specified, no content but the asset name will + * be returned. + * + * Generated from protobuf field .google.cloud.asset.v1.ContentType content_type = 4; + * @param int $var + * @return $this + */ + public function setContentType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Asset\V1\ContentType::class); + $this->content_type = $var; + + return $this; + } + + /** + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * + * Generated from protobuf field int32 page_size = 5; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * + * Generated from protobuf field int32 page_size = 5; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * + * Generated from protobuf field string page_token = 6; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * + * Generated from protobuf field string page_token = 6; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelationshipTypes() + { + return $this->relationship_types; + } + + /** + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + * + * Generated from protobuf field repeated string relationship_types = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelationshipTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->relationship_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListAssetsResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListAssetsResponse.php new file mode 100644 index 000000000000..1d4aa8a72052 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListAssetsResponse.php @@ -0,0 +1,153 @@ +google.cloud.asset.v1.ListAssetsResponse + */ +class ListAssetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Time the snapshot was taken. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; + */ + protected $read_time = null; + /** + * Assets. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Asset assets = 2; + */ + private $assets; + /** + * Token to retrieve the next page of results. It expires 72 hours after the + * page token for the first page is generated. Set to empty if there are no + * remaining results. + * + * Generated from protobuf field string next_page_token = 3; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $read_time + * Time the snapshot was taken. + * @type array<\Google\Cloud\Asset\V1\Asset>|\Google\Protobuf\Internal\RepeatedField $assets + * Assets. + * @type string $next_page_token + * Token to retrieve the next page of results. It expires 72 hours after the + * page token for the first page is generated. Set to empty if there are no + * remaining results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Time the snapshot was taken. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * Time the snapshot was taken. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + + /** + * Assets. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Asset assets = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssets() + { + return $this->assets; + } + + /** + * Assets. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Asset assets = 2; + * @param array<\Google\Cloud\Asset\V1\Asset>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\Asset::class); + $this->assets = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results. It expires 72 hours after the + * page token for the first page is generated. Set to empty if there are no + * remaining results. + * + * Generated from protobuf field string next_page_token = 3; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results. It expires 72 hours after the + * page token for the first page is generated. Set to empty if there are no + * remaining results. + * + * Generated from protobuf field string next_page_token = 3; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListFeedsRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListFeedsRequest.php new file mode 100644 index 000000000000..65a48c3d0ae5 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListFeedsRequest.php @@ -0,0 +1,90 @@ +google.cloud.asset.v1.ListFeedsRequest + */ +class ListFeedsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + + /** + * @param string $parent Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * + * @return \Google\Cloud\Asset\V1\ListFeedsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListFeedsResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListFeedsResponse.php new file mode 100644 index 000000000000..16092aec80d7 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListFeedsResponse.php @@ -0,0 +1,65 @@ +google.cloud.asset.v1.ListFeedsResponse + */ +class ListFeedsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of feeds. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Feed feeds = 1; + */ + private $feeds; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\Feed>|\Google\Protobuf\Internal\RepeatedField $feeds + * A list of feeds. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * A list of feeds. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Feed feeds = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFeeds() + { + return $this->feeds; + } + + /** + * A list of feeds. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Feed feeds = 1; + * @param array<\Google\Cloud\Asset\V1\Feed>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFeeds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\Feed::class); + $this->feeds = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListSavedQueriesRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListSavedQueriesRequest.php new file mode 100644 index 000000000000..3e3581b026c6 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListSavedQueriesRequest.php @@ -0,0 +1,237 @@ +google.cloud.asset.v1.ListSavedQueriesRequest + */ +class ListSavedQueriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * See https://google.aip.dev/160 for more information on the grammar. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). Please see + * {@see AssetServiceClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Asset\V1\ListSavedQueriesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @type string $filter + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * See https://google.aip.dev/160 for more information on the grammar. + * @type int $page_size + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * See https://google.aip.dev/160 for more information on the grammar. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * See https://google.aip.dev/160 for more information on the grammar. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListSavedQueriesResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListSavedQueriesResponse.php new file mode 100644 index 000000000000..9ddbb17f2f2d --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ListSavedQueriesResponse.php @@ -0,0 +1,105 @@ +google.cloud.asset.v1.ListSavedQueriesResponse + */ +class ListSavedQueriesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of savedQueries. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.SavedQuery saved_queries = 1; + */ + private $saved_queries; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\SavedQuery>|\Google\Protobuf\Internal\RepeatedField $saved_queries + * A list of savedQueries. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * A list of savedQueries. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.SavedQuery saved_queries = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSavedQueries() + { + return $this->saved_queries; + } + + /** + * A list of savedQueries. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.SavedQuery saved_queries = 1; + * @param array<\Google\Cloud\Asset\V1\SavedQuery>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSavedQueries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\SavedQuery::class); + $this->saved_queries = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/MoveAnalysis.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/MoveAnalysis.php new file mode 100644 index 000000000000..8661760af4e3 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/MoveAnalysis.php @@ -0,0 +1,146 @@ +google.cloud.asset.v1.MoveAnalysis + */ +class MoveAnalysis extends \Google\Protobuf\Internal\Message +{ + /** + * The user friendly display name of the analysis. E.g. IAM, organization + * policy etc. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + protected $result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The user friendly display name of the analysis. E.g. IAM, organization + * policy etc. + * @type \Google\Cloud\Asset\V1\MoveAnalysisResult $analysis + * Analysis result of moving the target resource. + * @type \Google\Rpc\Status $error + * Description of error encountered when performing the analysis. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The user friendly display name of the analysis. E.g. IAM, organization + * policy etc. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The user friendly display name of the analysis. E.g. IAM, organization + * policy etc. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Analysis result of moving the target resource. + * + * Generated from protobuf field .google.cloud.asset.v1.MoveAnalysisResult analysis = 2; + * @return \Google\Cloud\Asset\V1\MoveAnalysisResult|null + */ + public function getAnalysis() + { + return $this->readOneof(2); + } + + public function hasAnalysis() + { + return $this->hasOneof(2); + } + + /** + * Analysis result of moving the target resource. + * + * Generated from protobuf field .google.cloud.asset.v1.MoveAnalysisResult analysis = 2; + * @param \Google\Cloud\Asset\V1\MoveAnalysisResult $var + * @return $this + */ + public function setAnalysis($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\MoveAnalysisResult::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Description of error encountered when performing the analysis. + * + * Generated from protobuf field .google.rpc.Status error = 3; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->readOneof(3); + } + + public function hasError() + { + return $this->hasOneof(3); + } + + /** + * Description of error encountered when performing the analysis. + * + * Generated from protobuf field .google.rpc.Status error = 3; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/MoveAnalysisResult.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/MoveAnalysisResult.php new file mode 100644 index 000000000000..621242eaf526 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/MoveAnalysisResult.php @@ -0,0 +1,113 @@ +google.cloud.asset.v1.MoveAnalysisResult + */ +class MoveAnalysisResult extends \Google\Protobuf\Internal\Message +{ + /** + * Blocking information that would prevent the target resource from moving + * to the specified destination at runtime. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.MoveImpact blockers = 1; + */ + private $blockers; + /** + * Warning information indicating that moving the target resource to the + * specified destination might be unsafe. This can include important policy + * information and configuration changes, but will not block moves at runtime. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.MoveImpact warnings = 2; + */ + private $warnings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\MoveImpact>|\Google\Protobuf\Internal\RepeatedField $blockers + * Blocking information that would prevent the target resource from moving + * to the specified destination at runtime. + * @type array<\Google\Cloud\Asset\V1\MoveImpact>|\Google\Protobuf\Internal\RepeatedField $warnings + * Warning information indicating that moving the target resource to the + * specified destination might be unsafe. This can include important policy + * information and configuration changes, but will not block moves at runtime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Blocking information that would prevent the target resource from moving + * to the specified destination at runtime. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.MoveImpact blockers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBlockers() + { + return $this->blockers; + } + + /** + * Blocking information that would prevent the target resource from moving + * to the specified destination at runtime. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.MoveImpact blockers = 1; + * @param array<\Google\Cloud\Asset\V1\MoveImpact>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBlockers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\MoveImpact::class); + $this->blockers = $arr; + + return $this; + } + + /** + * Warning information indicating that moving the target resource to the + * specified destination might be unsafe. This can include important policy + * information and configuration changes, but will not block moves at runtime. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.MoveImpact warnings = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWarnings() + { + return $this->warnings; + } + + /** + * Warning information indicating that moving the target resource to the + * specified destination might be unsafe. This can include important policy + * information and configuration changes, but will not block moves at runtime. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.MoveImpact warnings = 2; + * @param array<\Google\Cloud\Asset\V1\MoveImpact>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWarnings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\MoveImpact::class); + $this->warnings = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/MoveImpact.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/MoveImpact.php new file mode 100644 index 000000000000..6174ec1638ba --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/MoveImpact.php @@ -0,0 +1,67 @@ +google.cloud.asset.v1.MoveImpact + */ +class MoveImpact extends \Google\Protobuf\Internal\Message +{ + /** + * User friendly impact detail in a free form message. + * + * Generated from protobuf field string detail = 1; + */ + protected $detail = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $detail + * User friendly impact detail in a free form message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * User friendly impact detail in a free form message. + * + * Generated from protobuf field string detail = 1; + * @return string + */ + public function getDetail() + { + return $this->detail; + } + + /** + * User friendly impact detail in a free form message. + * + * Generated from protobuf field string detail = 1; + * @param string $var + * @return $this + */ + public function setDetail($var) + { + GPBUtil::checkString($var, True); + $this->detail = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/OutputConfig.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/OutputConfig.php new file mode 100644 index 000000000000..755ecf4df045 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/OutputConfig.php @@ -0,0 +1,111 @@ +google.cloud.asset.v1.OutputConfig + */ +class OutputConfig extends \Google\Protobuf\Internal\Message +{ + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\GcsDestination $gcs_destination + * Destination on Cloud Storage. + * @type \Google\Cloud\Asset\V1\BigQueryDestination $bigquery_destination + * Destination on BigQuery. The output table stores the fields in asset + * Protobuf as columns in BigQuery. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Destination on Cloud Storage. + * + * Generated from protobuf field .google.cloud.asset.v1.GcsDestination gcs_destination = 1; + * @return \Google\Cloud\Asset\V1\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * Destination on Cloud Storage. + * + * Generated from protobuf field .google.cloud.asset.v1.GcsDestination gcs_destination = 1; + * @param \Google\Cloud\Asset\V1\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Destination on BigQuery. The output table stores the fields in asset + * Protobuf as columns in BigQuery. + * + * Generated from protobuf field .google.cloud.asset.v1.BigQueryDestination bigquery_destination = 2; + * @return \Google\Cloud\Asset\V1\BigQueryDestination|null + */ + public function getBigqueryDestination() + { + return $this->readOneof(2); + } + + public function hasBigqueryDestination() + { + return $this->hasOneof(2); + } + + /** + * Destination on BigQuery. The output table stores the fields in asset + * Protobuf as columns in BigQuery. + * + * Generated from protobuf field .google.cloud.asset.v1.BigQueryDestination bigquery_destination = 2; + * @param \Google\Cloud\Asset\V1\BigQueryDestination $var + * @return $this + */ + public function setBigqueryDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\BigQueryDestination::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/OutputResult.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/OutputResult.php new file mode 100644 index 000000000000..c81bfd357244 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/OutputResult.php @@ -0,0 +1,75 @@ +google.cloud.asset.v1.OutputResult + */ +class OutputResult extends \Google\Protobuf\Internal\Message +{ + protected $result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\GcsOutputResult $gcs_result + * Export result on Cloud Storage. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Export result on Cloud Storage. + * + * Generated from protobuf field .google.cloud.asset.v1.GcsOutputResult gcs_result = 1; + * @return \Google\Cloud\Asset\V1\GcsOutputResult|null + */ + public function getGcsResult() + { + return $this->readOneof(1); + } + + public function hasGcsResult() + { + return $this->hasOneof(1); + } + + /** + * Export result on Cloud Storage. + * + * Generated from protobuf field .google.cloud.asset.v1.GcsOutputResult gcs_result = 1; + * @param \Google\Cloud\Asset\V1\GcsOutputResult $var + * @return $this + */ + public function setGcsResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\GcsOutputResult::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/PartitionSpec.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/PartitionSpec.php new file mode 100644 index 000000000000..e46ad84b2576 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/PartitionSpec.php @@ -0,0 +1,67 @@ +google.cloud.asset.v1.PartitionSpec + */ +class PartitionSpec extends \Google\Protobuf\Internal\Message +{ + /** + * The partition key for BigQuery partitioned table. + * + * Generated from protobuf field .google.cloud.asset.v1.PartitionSpec.PartitionKey partition_key = 1; + */ + protected $partition_key = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $partition_key + * The partition key for BigQuery partitioned table. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The partition key for BigQuery partitioned table. + * + * Generated from protobuf field .google.cloud.asset.v1.PartitionSpec.PartitionKey partition_key = 1; + * @return int + */ + public function getPartitionKey() + { + return $this->partition_key; + } + + /** + * The partition key for BigQuery partitioned table. + * + * Generated from protobuf field .google.cloud.asset.v1.PartitionSpec.PartitionKey partition_key = 1; + * @param int $var + * @return $this + */ + public function setPartitionKey($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Asset\V1\PartitionSpec\PartitionKey::class); + $this->partition_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/PartitionSpec/PartitionKey.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/PartitionSpec/PartitionKey.php new file mode 100644 index 000000000000..d7dd49a6d7e3 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/PartitionSpec/PartitionKey.php @@ -0,0 +1,75 @@ +google.cloud.asset.v1.PartitionSpec.PartitionKey + */ +class PartitionKey +{ + /** + * Unspecified partition key. If used, it means using non-partitioned table. + * + * Generated from protobuf enum PARTITION_KEY_UNSPECIFIED = 0; + */ + const PARTITION_KEY_UNSPECIFIED = 0; + /** + * The time when the snapshot is taken. If specified as partition key, the + * result table(s) is partitoned by the additional timestamp column, + * readTime. If [read_time] in ExportAssetsRequest is specified, the + * readTime column's value will be the same as it. Otherwise, its value will + * be the current time that is used to take the snapshot. + * + * Generated from protobuf enum READ_TIME = 1; + */ + const READ_TIME = 1; + /** + * The time when the request is received and started to be processed. If + * specified as partition key, the result table(s) is partitoned by the + * requestTime column, an additional timestamp column representing when the + * request was received. + * + * Generated from protobuf enum REQUEST_TIME = 2; + */ + const REQUEST_TIME = 2; + + private static $valueToName = [ + self::PARTITION_KEY_UNSPECIFIED => 'PARTITION_KEY_UNSPECIFIED', + self::READ_TIME => 'READ_TIME', + self::REQUEST_TIME => 'REQUEST_TIME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PartitionKey::class, \Google\Cloud\Asset\V1\PartitionSpec_PartitionKey::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/PubsubDestination.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/PubsubDestination.php new file mode 100644 index 000000000000..a84a9c172138 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/PubsubDestination.php @@ -0,0 +1,71 @@ +google.cloud.asset.v1.PubsubDestination + */ +class PubsubDestination extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the Pub/Sub topic to publish to. + * Example: `projects/PROJECT_ID/topics/TOPIC_ID`. + * + * Generated from protobuf field string topic = 1; + */ + protected $topic = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic + * The name of the Pub/Sub topic to publish to. + * Example: `projects/PROJECT_ID/topics/TOPIC_ID`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The name of the Pub/Sub topic to publish to. + * Example: `projects/PROJECT_ID/topics/TOPIC_ID`. + * + * Generated from protobuf field string topic = 1; + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * The name of the Pub/Sub topic to publish to. + * Example: `projects/PROJECT_ID/topics/TOPIC_ID`. + * + * Generated from protobuf field string topic = 1; + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsOutputConfig.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsOutputConfig.php new file mode 100644 index 000000000000..09c39ffdb0fb --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsOutputConfig.php @@ -0,0 +1,77 @@ +google.cloud.asset.v1.QueryAssetsOutputConfig + */ +class QueryAssetsOutputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * BigQuery destination where the query results will be saved. + * + * Generated from protobuf field .google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination bigquery_destination = 1; + */ + protected $bigquery_destination = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\QueryAssetsOutputConfig\BigQueryDestination $bigquery_destination + * BigQuery destination where the query results will be saved. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * BigQuery destination where the query results will be saved. + * + * Generated from protobuf field .google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination bigquery_destination = 1; + * @return \Google\Cloud\Asset\V1\QueryAssetsOutputConfig\BigQueryDestination|null + */ + public function getBigqueryDestination() + { + return $this->bigquery_destination; + } + + public function hasBigqueryDestination() + { + return isset($this->bigquery_destination); + } + + public function clearBigqueryDestination() + { + unset($this->bigquery_destination); + } + + /** + * BigQuery destination where the query results will be saved. + * + * Generated from protobuf field .google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination bigquery_destination = 1; + * @param \Google\Cloud\Asset\V1\QueryAssetsOutputConfig\BigQueryDestination $var + * @return $this + */ + public function setBigqueryDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\QueryAssetsOutputConfig\BigQueryDestination::class); + $this->bigquery_destination = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsOutputConfig/BigQueryDestination.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsOutputConfig/BigQueryDestination.php new file mode 100644 index 000000000000..0a95b67a1e4a --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsOutputConfig/BigQueryDestination.php @@ -0,0 +1,182 @@ +google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + */ +class BigQueryDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The BigQuery dataset where the query results will be saved. It + * has the format of "projects/{projectId}/datasets/{datasetId}". + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset = ''; + /** + * Required. The BigQuery table where the query results will be saved. If + * this table does not exist, a new table with the given name will be + * created. + * + * Generated from protobuf field string table = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table = ''; + /** + * Specifies the action that occurs if the destination table or partition + * already exists. The following values are supported: + * * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + * overwrites the entire table or all the partitions data. + * * WRITE_APPEND: If the table or partition already exists, BigQuery + * appends the data to the table or the latest partition. + * * WRITE_EMPTY: If the table already exists and contains data, a + * 'duplicate' error is returned in the job result. + * The default value is WRITE_EMPTY. + * + * Generated from protobuf field string write_disposition = 3; + */ + protected $write_disposition = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset + * Required. The BigQuery dataset where the query results will be saved. It + * has the format of "projects/{projectId}/datasets/{datasetId}". + * @type string $table + * Required. The BigQuery table where the query results will be saved. If + * this table does not exist, a new table with the given name will be + * created. + * @type string $write_disposition + * Specifies the action that occurs if the destination table or partition + * already exists. The following values are supported: + * * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + * overwrites the entire table or all the partitions data. + * * WRITE_APPEND: If the table or partition already exists, BigQuery + * appends the data to the table or the latest partition. + * * WRITE_EMPTY: If the table already exists and contains data, a + * 'duplicate' error is returned in the job result. + * The default value is WRITE_EMPTY. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The BigQuery dataset where the query results will be saved. It + * has the format of "projects/{projectId}/datasets/{datasetId}". + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataset() + { + return $this->dataset; + } + + /** + * Required. The BigQuery dataset where the query results will be saved. It + * has the format of "projects/{projectId}/datasets/{datasetId}". + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkString($var, True); + $this->dataset = $var; + + return $this; + } + + /** + * Required. The BigQuery table where the query results will be saved. If + * this table does not exist, a new table with the given name will be + * created. + * + * Generated from protobuf field string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTable() + { + return $this->table; + } + + /** + * Required. The BigQuery table where the query results will be saved. If + * this table does not exist, a new table with the given name will be + * created. + * + * Generated from protobuf field string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTable($var) + { + GPBUtil::checkString($var, True); + $this->table = $var; + + return $this; + } + + /** + * Specifies the action that occurs if the destination table or partition + * already exists. The following values are supported: + * * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + * overwrites the entire table or all the partitions data. + * * WRITE_APPEND: If the table or partition already exists, BigQuery + * appends the data to the table or the latest partition. + * * WRITE_EMPTY: If the table already exists and contains data, a + * 'duplicate' error is returned in the job result. + * The default value is WRITE_EMPTY. + * + * Generated from protobuf field string write_disposition = 3; + * @return string + */ + public function getWriteDisposition() + { + return $this->write_disposition; + } + + /** + * Specifies the action that occurs if the destination table or partition + * already exists. The following values are supported: + * * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + * overwrites the entire table or all the partitions data. + * * WRITE_APPEND: If the table or partition already exists, BigQuery + * appends the data to the table or the latest partition. + * * WRITE_EMPTY: If the table already exists and contains data, a + * 'duplicate' error is returned in the job result. + * The default value is WRITE_EMPTY. + * + * Generated from protobuf field string write_disposition = 3; + * @param string $var + * @return $this + */ + public function setWriteDisposition($var) + { + GPBUtil::checkString($var, True); + $this->write_disposition = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BigQueryDestination::class, \Google\Cloud\Asset\V1\QueryAssetsOutputConfig_BigQueryDestination::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsRequest.php new file mode 100644 index 000000000000..0dbf1309b55e --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsRequest.php @@ -0,0 +1,488 @@ +google.cloud.asset.v1.QueryAssetsRequest + */ +class QueryAssetsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * Only assets belonging to the `parent` will be returned. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of rows to return in the results. Responses + * are limited to 10 MB and 1000 rows. + * By default, the maximum row count is 1000. When the byte or row count limit + * is reached, the rest of the query results will be paginated. + * The field will be ignored when [output_config] is specified. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token received from previous `QueryAssets`. + * The field will be ignored when [output_config] is specified. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Specifies the maximum amount of time that the client is willing + * to wait for the query to complete. By default, this limit is 5 min for the + * first query, and 1 minute for the following queries. If the query is + * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise + * false. + * Like BigQuery [jobs.query + * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) + * The call is not guaranteed to wait for the specified timeout; it typically + * returns after around 200 seconds (200,000 milliseconds), even if the query + * is not complete. + * The field will be ignored when [output_config] is specified. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $timeout = null; + /** + * Optional. Destination where the query results will be saved. + * When this field is specified, the query results won't be saved in the + * [QueryAssetsResponse.query_result]. Instead + * [QueryAssetsResponse.output_config] will be set. + * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used + * to check the status of the query job when passed to a following + * [QueryAssets] API call. + * + * Generated from protobuf field .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $output_config = null; + protected $query; + protected $time; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * Only assets belonging to the `parent` will be returned. + * @type string $statement + * Optional. A SQL statement that's compatible with [BigQuery + * SQL](https://cloud.google.com/bigquery/docs/introduction-sql). + * @type string $job_reference + * Optional. Reference to the query job, which is from the + * `QueryAssetsResponse` of previous `QueryAssets` call. + * @type int $page_size + * Optional. The maximum number of rows to return in the results. Responses + * are limited to 10 MB and 1000 rows. + * By default, the maximum row count is 1000. When the byte or row count limit + * is reached, the rest of the query results will be paginated. + * The field will be ignored when [output_config] is specified. + * @type string $page_token + * Optional. A page token received from previous `QueryAssets`. + * The field will be ignored when [output_config] is specified. + * @type \Google\Protobuf\Duration $timeout + * Optional. Specifies the maximum amount of time that the client is willing + * to wait for the query to complete. By default, this limit is 5 min for the + * first query, and 1 minute for the following queries. If the query is + * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise + * false. + * Like BigQuery [jobs.query + * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) + * The call is not guaranteed to wait for the specified timeout; it typically + * returns after around 200 seconds (200,000 milliseconds), even if the query + * is not complete. + * The field will be ignored when [output_config] is specified. + * @type \Google\Cloud\Asset\V1\TimeWindow $read_time_window + * Optional. [start_time] is required. [start_time] must be less than + * [end_time] Defaults [end_time] to now if [start_time] is set and + * [end_time] isn't. Maximum permitted time range is 7 days. + * @type \Google\Protobuf\Timestamp $read_time + * Optional. Queries cloud assets as they appeared at the specified point in + * time. + * @type \Google\Cloud\Asset\V1\QueryAssetsOutputConfig $output_config + * Optional. Destination where the query results will be saved. + * When this field is specified, the query results won't be saved in the + * [QueryAssetsResponse.query_result]. Instead + * [QueryAssetsResponse.output_config] will be set. + * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used + * to check the status of the query job when passed to a following + * [QueryAssets] API call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * Only assets belonging to the `parent` will be returned. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * Only assets belonging to the `parent` will be returned. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. A SQL statement that's compatible with [BigQuery + * SQL](https://cloud.google.com/bigquery/docs/introduction-sql). + * + * Generated from protobuf field string statement = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getStatement() + { + return $this->readOneof(2); + } + + public function hasStatement() + { + return $this->hasOneof(2); + } + + /** + * Optional. A SQL statement that's compatible with [BigQuery + * SQL](https://cloud.google.com/bigquery/docs/introduction-sql). + * + * Generated from protobuf field string statement = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setStatement($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. Reference to the query job, which is from the + * `QueryAssetsResponse` of previous `QueryAssets` call. + * + * Generated from protobuf field string job_reference = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getJobReference() + { + return $this->readOneof(3); + } + + public function hasJobReference() + { + return $this->hasOneof(3); + } + + /** + * Optional. Reference to the query job, which is from the + * `QueryAssetsResponse` of previous `QueryAssets` call. + * + * Generated from protobuf field string job_reference = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setJobReference($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. The maximum number of rows to return in the results. Responses + * are limited to 10 MB and 1000 rows. + * By default, the maximum row count is 1000. When the byte or row count limit + * is reached, the rest of the query results will be paginated. + * The field will be ignored when [output_config] is specified. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of rows to return in the results. Responses + * are limited to 10 MB and 1000 rows. + * By default, the maximum row count is 1000. When the byte or row count limit + * is reached, the rest of the query results will be paginated. + * The field will be ignored when [output_config] is specified. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token received from previous `QueryAssets`. + * The field will be ignored when [output_config] is specified. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token received from previous `QueryAssets`. + * The field will be ignored when [output_config] is specified. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Specifies the maximum amount of time that the client is willing + * to wait for the query to complete. By default, this limit is 5 min for the + * first query, and 1 minute for the following queries. If the query is + * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise + * false. + * Like BigQuery [jobs.query + * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) + * The call is not guaranteed to wait for the specified timeout; it typically + * returns after around 200 seconds (200,000 milliseconds), even if the query + * is not complete. + * The field will be ignored when [output_config] is specified. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Optional. Specifies the maximum amount of time that the client is willing + * to wait for the query to complete. By default, this limit is 5 min for the + * first query, and 1 minute for the following queries. If the query is + * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise + * false. + * Like BigQuery [jobs.query + * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) + * The call is not guaranteed to wait for the specified timeout; it typically + * returns after around 200 seconds (200,000 milliseconds), even if the query + * is not complete. + * The field will be ignored when [output_config] is specified. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Optional. [start_time] is required. [start_time] must be less than + * [end_time] Defaults [end_time] to now if [start_time] is set and + * [end_time] isn't. Maximum permitted time range is 7 days. + * + * Generated from protobuf field .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Asset\V1\TimeWindow|null + */ + public function getReadTimeWindow() + { + return $this->readOneof(7); + } + + public function hasReadTimeWindow() + { + return $this->hasOneof(7); + } + + /** + * Optional. [start_time] is required. [start_time] must be less than + * [end_time] Defaults [end_time] to now if [start_time] is set and + * [end_time] isn't. Maximum permitted time range is 7 days. + * + * Generated from protobuf field .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Asset\V1\TimeWindow $var + * @return $this + */ + public function setReadTimeWindow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\TimeWindow::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Optional. Queries cloud assets as they appeared at the specified point in + * time. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->readOneof(8); + } + + public function hasReadTime() + { + return $this->hasOneof(8); + } + + /** + * Optional. Queries cloud assets as they appeared at the specified point in + * time. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Optional. Destination where the query results will be saved. + * When this field is specified, the query results won't be saved in the + * [QueryAssetsResponse.query_result]. Instead + * [QueryAssetsResponse.output_config] will be set. + * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used + * to check the status of the query job when passed to a following + * [QueryAssets] API call. + * + * Generated from protobuf field .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Asset\V1\QueryAssetsOutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Optional. Destination where the query results will be saved. + * When this field is specified, the query results won't be saved in the + * [QueryAssetsResponse.query_result]. Instead + * [QueryAssetsResponse.output_config] will be set. + * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used + * to check the status of the query job when passed to a following + * [QueryAssets] API call. + * + * Generated from protobuf field .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Asset\V1\QueryAssetsOutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\QueryAssetsOutputConfig::class); + $this->output_config = $var; + + return $this; + } + + /** + * @return string + */ + public function getQuery() + { + return $this->whichOneof("query"); + } + + /** + * @return string + */ + public function getTime() + { + return $this->whichOneof("time"); + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsResponse.php new file mode 100644 index 000000000000..cc23eb77115b --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryAssetsResponse.php @@ -0,0 +1,239 @@ +google.cloud.asset.v1.QueryAssetsResponse + */ +class QueryAssetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Reference to a query job. + * + * Generated from protobuf field string job_reference = 1; + */ + protected $job_reference = ''; + /** + * The query response, which can be either an `error` or a valid `response`. + * If `done` == `false` and the query result is being saved in an output, the + * output_config field will be set. + * If `done` == `true`, exactly one of + * `error`, `query_result` or `output_config` will be set. + * [done] is unset unless the [QueryAssetsResponse] contains a + * [QueryAssetsResponse.job_reference]. + * + * Generated from protobuf field bool done = 2; + */ + protected $done = false; + protected $response; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $job_reference + * Reference to a query job. + * @type bool $done + * The query response, which can be either an `error` or a valid `response`. + * If `done` == `false` and the query result is being saved in an output, the + * output_config field will be set. + * If `done` == `true`, exactly one of + * `error`, `query_result` or `output_config` will be set. + * [done] is unset unless the [QueryAssetsResponse] contains a + * [QueryAssetsResponse.job_reference]. + * @type \Google\Rpc\Status $error + * Error status. + * @type \Google\Cloud\Asset\V1\QueryResult $query_result + * Result of the query. + * @type \Google\Cloud\Asset\V1\QueryAssetsOutputConfig $output_config + * Output configuration, which indicates that instead of being returned in + * an API response on the fly, the query result will be saved in a specific + * output. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Reference to a query job. + * + * Generated from protobuf field string job_reference = 1; + * @return string + */ + public function getJobReference() + { + return $this->job_reference; + } + + /** + * Reference to a query job. + * + * Generated from protobuf field string job_reference = 1; + * @param string $var + * @return $this + */ + public function setJobReference($var) + { + GPBUtil::checkString($var, True); + $this->job_reference = $var; + + return $this; + } + + /** + * The query response, which can be either an `error` or a valid `response`. + * If `done` == `false` and the query result is being saved in an output, the + * output_config field will be set. + * If `done` == `true`, exactly one of + * `error`, `query_result` or `output_config` will be set. + * [done] is unset unless the [QueryAssetsResponse] contains a + * [QueryAssetsResponse.job_reference]. + * + * Generated from protobuf field bool done = 2; + * @return bool + */ + public function getDone() + { + return $this->done; + } + + /** + * The query response, which can be either an `error` or a valid `response`. + * If `done` == `false` and the query result is being saved in an output, the + * output_config field will be set. + * If `done` == `true`, exactly one of + * `error`, `query_result` or `output_config` will be set. + * [done] is unset unless the [QueryAssetsResponse] contains a + * [QueryAssetsResponse.job_reference]. + * + * Generated from protobuf field bool done = 2; + * @param bool $var + * @return $this + */ + public function setDone($var) + { + GPBUtil::checkBool($var); + $this->done = $var; + + return $this; + } + + /** + * Error status. + * + * Generated from protobuf field .google.rpc.Status error = 3; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->readOneof(3); + } + + public function hasError() + { + return $this->hasOneof(3); + } + + /** + * Error status. + * + * Generated from protobuf field .google.rpc.Status error = 3; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Result of the query. + * + * Generated from protobuf field .google.cloud.asset.v1.QueryResult query_result = 4; + * @return \Google\Cloud\Asset\V1\QueryResult|null + */ + public function getQueryResult() + { + return $this->readOneof(4); + } + + public function hasQueryResult() + { + return $this->hasOneof(4); + } + + /** + * Result of the query. + * + * Generated from protobuf field .google.cloud.asset.v1.QueryResult query_result = 4; + * @param \Google\Cloud\Asset\V1\QueryResult $var + * @return $this + */ + public function setQueryResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\QueryResult::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Output configuration, which indicates that instead of being returned in + * an API response on the fly, the query result will be saved in a specific + * output. + * + * Generated from protobuf field .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 5; + * @return \Google\Cloud\Asset\V1\QueryAssetsOutputConfig|null + */ + public function getOutputConfig() + { + return $this->readOneof(5); + } + + public function hasOutputConfig() + { + return $this->hasOneof(5); + } + + /** + * Output configuration, which indicates that instead of being returned in + * an API response on the fly, the query result will be saved in a specific + * output. + * + * Generated from protobuf field .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 5; + * @param \Google\Cloud\Asset\V1\QueryAssetsOutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\QueryAssetsOutputConfig::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getResponse() + { + return $this->whichOneof("response"); + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryResult.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryResult.php new file mode 100644 index 000000000000..430f80179a4e --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/QueryResult.php @@ -0,0 +1,182 @@ +google.cloud.asset.v1.QueryResult + */ +class QueryResult extends \Google\Protobuf\Internal\Message +{ + /** + * Each row hold a query result in the format of `Struct`. + * + * Generated from protobuf field repeated .google.protobuf.Struct rows = 1; + */ + private $rows; + /** + * Describes the format of the [rows]. + * + * Generated from protobuf field .google.cloud.asset.v1.TableSchema schema = 2; + */ + protected $schema = null; + /** + * Token to retrieve the next page of the results. + * + * Generated from protobuf field string next_page_token = 3; + */ + protected $next_page_token = ''; + /** + * Total rows of the whole query results. + * + * Generated from protobuf field int64 total_rows = 4; + */ + protected $total_rows = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Struct>|\Google\Protobuf\Internal\RepeatedField $rows + * Each row hold a query result in the format of `Struct`. + * @type \Google\Cloud\Asset\V1\TableSchema $schema + * Describes the format of the [rows]. + * @type string $next_page_token + * Token to retrieve the next page of the results. + * @type int|string $total_rows + * Total rows of the whole query results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Each row hold a query result in the format of `Struct`. + * + * Generated from protobuf field repeated .google.protobuf.Struct rows = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRows() + { + return $this->rows; + } + + /** + * Each row hold a query result in the format of `Struct`. + * + * Generated from protobuf field repeated .google.protobuf.Struct rows = 1; + * @param array<\Google\Protobuf\Struct>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Struct::class); + $this->rows = $arr; + + return $this; + } + + /** + * Describes the format of the [rows]. + * + * Generated from protobuf field .google.cloud.asset.v1.TableSchema schema = 2; + * @return \Google\Cloud\Asset\V1\TableSchema|null + */ + public function getSchema() + { + return $this->schema; + } + + public function hasSchema() + { + return isset($this->schema); + } + + public function clearSchema() + { + unset($this->schema); + } + + /** + * Describes the format of the [rows]. + * + * Generated from protobuf field .google.cloud.asset.v1.TableSchema schema = 2; + * @param \Google\Cloud\Asset\V1\TableSchema $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\TableSchema::class); + $this->schema = $var; + + return $this; + } + + /** + * Token to retrieve the next page of the results. + * + * Generated from protobuf field string next_page_token = 3; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of the results. + * + * Generated from protobuf field string next_page_token = 3; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total rows of the whole query results. + * + * Generated from protobuf field int64 total_rows = 4; + * @return int|string + */ + public function getTotalRows() + { + return $this->total_rows; + } + + /** + * Total rows of the whole query results. + * + * Generated from protobuf field int64 total_rows = 4; + * @param int|string $var + * @return $this + */ + public function setTotalRows($var) + { + GPBUtil::checkInt64($var); + $this->total_rows = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedAsset.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedAsset.php new file mode 100644 index 000000000000..f5776b29d83c --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedAsset.php @@ -0,0 +1,224 @@ +google.cloud.asset.v1.RelatedAsset + */ +class RelatedAsset extends \Google\Protobuf\Internal\Message +{ + /** + * The full name of the asset. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + * See [Resource + * names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * + * Generated from protobuf field string asset = 1 [(.google.api.resource_reference) = { + */ + protected $asset = ''; + /** + * The type of the asset. Example: `compute.googleapis.com/Disk` + * See [Supported asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for more information. + * + * Generated from protobuf field string asset_type = 2; + */ + protected $asset_type = ''; + /** + * The ancestors of an asset in Google Cloud [resource + * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + * represented as a list of relative resource names. An ancestry path starts + * with the closest ancestor in the hierarchy and ends at root. + * Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + * + * Generated from protobuf field repeated string ancestors = 3; + */ + private $ancestors; + /** + * The unique identifier of the relationship type. Example: + * `INSTANCE_TO_INSTANCEGROUP` + * + * Generated from protobuf field string relationship_type = 4; + */ + protected $relationship_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $asset + * The full name of the asset. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + * See [Resource + * names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * @type string $asset_type + * The type of the asset. Example: `compute.googleapis.com/Disk` + * See [Supported asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for more information. + * @type array|\Google\Protobuf\Internal\RepeatedField $ancestors + * The ancestors of an asset in Google Cloud [resource + * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + * represented as a list of relative resource names. An ancestry path starts + * with the closest ancestor in the hierarchy and ends at root. + * Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + * @type string $relationship_type + * The unique identifier of the relationship type. Example: + * `INSTANCE_TO_INSTANCEGROUP` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The full name of the asset. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + * See [Resource + * names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * + * Generated from protobuf field string asset = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getAsset() + { + return $this->asset; + } + + /** + * The full name of the asset. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + * See [Resource + * names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * + * Generated from protobuf field string asset = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAsset($var) + { + GPBUtil::checkString($var, True); + $this->asset = $var; + + return $this; + } + + /** + * The type of the asset. Example: `compute.googleapis.com/Disk` + * See [Supported asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for more information. + * + * Generated from protobuf field string asset_type = 2; + * @return string + */ + public function getAssetType() + { + return $this->asset_type; + } + + /** + * The type of the asset. Example: `compute.googleapis.com/Disk` + * See [Supported asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * for more information. + * + * Generated from protobuf field string asset_type = 2; + * @param string $var + * @return $this + */ + public function setAssetType($var) + { + GPBUtil::checkString($var, True); + $this->asset_type = $var; + + return $this; + } + + /** + * The ancestors of an asset in Google Cloud [resource + * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + * represented as a list of relative resource names. An ancestry path starts + * with the closest ancestor in the hierarchy and ends at root. + * Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + * + * Generated from protobuf field repeated string ancestors = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAncestors() + { + return $this->ancestors; + } + + /** + * The ancestors of an asset in Google Cloud [resource + * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + * represented as a list of relative resource names. An ancestry path starts + * with the closest ancestor in the hierarchy and ends at root. + * Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + * + * Generated from protobuf field repeated string ancestors = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAncestors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ancestors = $arr; + + return $this; + } + + /** + * The unique identifier of the relationship type. Example: + * `INSTANCE_TO_INSTANCEGROUP` + * + * Generated from protobuf field string relationship_type = 4; + * @return string + */ + public function getRelationshipType() + { + return $this->relationship_type; + } + + /** + * The unique identifier of the relationship type. Example: + * `INSTANCE_TO_INSTANCEGROUP` + * + * Generated from protobuf field string relationship_type = 4; + * @param string $var + * @return $this + */ + public function setRelationshipType($var) + { + GPBUtil::checkString($var, True); + $this->relationship_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedAssets.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedAssets.php new file mode 100644 index 000000000000..3b38c610874c --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedAssets.php @@ -0,0 +1,115 @@ +google.cloud.asset.v1.RelatedAssets + */ +class RelatedAssets extends \Google\Protobuf\Internal\Message +{ + /** + * The detailed relationship attributes. + * + * Generated from protobuf field .google.cloud.asset.v1.RelationshipAttributes relationship_attributes = 1; + */ + protected $relationship_attributes = null; + /** + * The peer resources of the relationship. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.RelatedAsset assets = 2; + */ + private $assets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\RelationshipAttributes $relationship_attributes + * The detailed relationship attributes. + * @type array<\Google\Cloud\Asset\V1\RelatedAsset>|\Google\Protobuf\Internal\RepeatedField $assets + * The peer resources of the relationship. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The detailed relationship attributes. + * + * Generated from protobuf field .google.cloud.asset.v1.RelationshipAttributes relationship_attributes = 1; + * @return \Google\Cloud\Asset\V1\RelationshipAttributes|null + */ + public function getRelationshipAttributes() + { + return $this->relationship_attributes; + } + + public function hasRelationshipAttributes() + { + return isset($this->relationship_attributes); + } + + public function clearRelationshipAttributes() + { + unset($this->relationship_attributes); + } + + /** + * The detailed relationship attributes. + * + * Generated from protobuf field .google.cloud.asset.v1.RelationshipAttributes relationship_attributes = 1; + * @param \Google\Cloud\Asset\V1\RelationshipAttributes $var + * @return $this + */ + public function setRelationshipAttributes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\RelationshipAttributes::class); + $this->relationship_attributes = $var; + + return $this; + } + + /** + * The peer resources of the relationship. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.RelatedAsset assets = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssets() + { + return $this->assets; + } + + /** + * The peer resources of the relationship. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.RelatedAsset assets = 2; + * @param array<\Google\Cloud\Asset\V1\RelatedAsset>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\RelatedAsset::class); + $this->assets = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedResource.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedResource.php new file mode 100644 index 000000000000..276ad6987d6c --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedResource.php @@ -0,0 +1,105 @@ +google.cloud.asset.v1.RelatedResource + */ +class RelatedResource extends \Google\Protobuf\Internal\Message +{ + /** + * The type of the asset. Example: `compute.googleapis.com/Instance` + * + * Generated from protobuf field string asset_type = 1; + */ + protected $asset_type = ''; + /** + * The full resource name of the related resource. Example: + * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123` + * + * Generated from protobuf field string full_resource_name = 2; + */ + protected $full_resource_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $asset_type + * The type of the asset. Example: `compute.googleapis.com/Instance` + * @type string $full_resource_name + * The full resource name of the related resource. Example: + * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The type of the asset. Example: `compute.googleapis.com/Instance` + * + * Generated from protobuf field string asset_type = 1; + * @return string + */ + public function getAssetType() + { + return $this->asset_type; + } + + /** + * The type of the asset. Example: `compute.googleapis.com/Instance` + * + * Generated from protobuf field string asset_type = 1; + * @param string $var + * @return $this + */ + public function setAssetType($var) + { + GPBUtil::checkString($var, True); + $this->asset_type = $var; + + return $this; + } + + /** + * The full resource name of the related resource. Example: + * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123` + * + * Generated from protobuf field string full_resource_name = 2; + * @return string + */ + public function getFullResourceName() + { + return $this->full_resource_name; + } + + /** + * The full resource name of the related resource. Example: + * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123` + * + * Generated from protobuf field string full_resource_name = 2; + * @param string $var + * @return $this + */ + public function setFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->full_resource_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedResources.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedResources.php new file mode 100644 index 000000000000..db80697a9a7c --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelatedResources.php @@ -0,0 +1,67 @@ +google.cloud.asset.v1.RelatedResources + */ +class RelatedResources extends \Google\Protobuf\Internal\Message +{ + /** + * The detailed related resources of the primary resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + private $related_resources; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\RelatedResource>|\Google\Protobuf\Internal\RepeatedField $related_resources + * The detailed related resources of the primary resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The detailed related resources of the primary resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelatedResources() + { + return $this->related_resources; + } + + /** + * The detailed related resources of the primary resource. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + * @param array<\Google\Cloud\Asset\V1\RelatedResource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelatedResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\RelatedResource::class); + $this->related_resources = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelationshipAttributes.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelationshipAttributes.php new file mode 100644 index 000000000000..13e68a4e5b28 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/RelationshipAttributes.php @@ -0,0 +1,178 @@ +google.cloud.asset.v1.RelationshipAttributes + */ +class RelationshipAttributes extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the relationship type. Example: + * `INSTANCE_TO_INSTANCEGROUP` + * + * Generated from protobuf field string type = 4; + */ + protected $type = ''; + /** + * The source asset type. Example: `compute.googleapis.com/Instance` + * + * Generated from protobuf field string source_resource_type = 1; + */ + protected $source_resource_type = ''; + /** + * The target asset type. Example: `compute.googleapis.com/Disk` + * + * Generated from protobuf field string target_resource_type = 2; + */ + protected $target_resource_type = ''; + /** + * The detail of the relationship, e.g. `contains`, `attaches` + * + * Generated from protobuf field string action = 3; + */ + protected $action = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * The unique identifier of the relationship type. Example: + * `INSTANCE_TO_INSTANCEGROUP` + * @type string $source_resource_type + * The source asset type. Example: `compute.googleapis.com/Instance` + * @type string $target_resource_type + * The target asset type. Example: `compute.googleapis.com/Disk` + * @type string $action + * The detail of the relationship, e.g. `contains`, `attaches` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the relationship type. Example: + * `INSTANCE_TO_INSTANCEGROUP` + * + * Generated from protobuf field string type = 4; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The unique identifier of the relationship type. Example: + * `INSTANCE_TO_INSTANCEGROUP` + * + * Generated from protobuf field string type = 4; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The source asset type. Example: `compute.googleapis.com/Instance` + * + * Generated from protobuf field string source_resource_type = 1; + * @return string + */ + public function getSourceResourceType() + { + return $this->source_resource_type; + } + + /** + * The source asset type. Example: `compute.googleapis.com/Instance` + * + * Generated from protobuf field string source_resource_type = 1; + * @param string $var + * @return $this + */ + public function setSourceResourceType($var) + { + GPBUtil::checkString($var, True); + $this->source_resource_type = $var; + + return $this; + } + + /** + * The target asset type. Example: `compute.googleapis.com/Disk` + * + * Generated from protobuf field string target_resource_type = 2; + * @return string + */ + public function getTargetResourceType() + { + return $this->target_resource_type; + } + + /** + * The target asset type. Example: `compute.googleapis.com/Disk` + * + * Generated from protobuf field string target_resource_type = 2; + * @param string $var + * @return $this + */ + public function setTargetResourceType($var) + { + GPBUtil::checkString($var, True); + $this->target_resource_type = $var; + + return $this; + } + + /** + * The detail of the relationship, e.g. `contains`, `attaches` + * + * Generated from protobuf field string action = 3; + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * The detail of the relationship, e.g. `contains`, `attaches` + * + * Generated from protobuf field string action = 3; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Resource.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Resource.php new file mode 100644 index 000000000000..ae0f10a874a9 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Resource.php @@ -0,0 +1,361 @@ +google.cloud.asset.v1.Resource + */ +class Resource extends \Google\Protobuf\Internal\Message +{ + /** + * The API version. Example: `v1` + * + * Generated from protobuf field string version = 1; + */ + protected $version = ''; + /** + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` + * This value is unspecified for resources that do not have an API based on a + * discovery document, such as Cloud Bigtable. + * + * Generated from protobuf field string discovery_document_uri = 2; + */ + protected $discovery_document_uri = ''; + /** + * The JSON schema name listed in the discovery document. Example: + * `Project` + * This value is unspecified for resources that do not have an API based on a + * discovery document, such as Cloud Bigtable. + * + * Generated from protobuf field string discovery_name = 3; + */ + protected $discovery_name = ''; + /** + * The REST URL for accessing the resource. An HTTP `GET` request using this + * URL returns the resource itself. Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` + * This value is unspecified for resources without a REST API. + * + * Generated from protobuf field string resource_url = 4; + */ + protected $resource_url = ''; + /** + * The full name of the immediate parent of this resource. See + * [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * For Google Cloud assets, this value is the parent resource defined in the + * [IAM policy + * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + * Example: + * `//cloudresourcemanager.googleapis.com/projects/my_project_123` + * + * Generated from protobuf field string parent = 5; + */ + protected $parent = ''; + /** + * The content of the resource, in which some sensitive fields are removed + * and may not be present. + * + * Generated from protobuf field .google.protobuf.Struct data = 6; + */ + protected $data = null; + /** + * The location of the resource in Google Cloud, such as its zone and region. + * For more information, see https://cloud.google.com/about/locations/. + * + * Generated from protobuf field string location = 8; + */ + protected $location = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $version + * The API version. Example: `v1` + * @type string $discovery_document_uri + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` + * This value is unspecified for resources that do not have an API based on a + * discovery document, such as Cloud Bigtable. + * @type string $discovery_name + * The JSON schema name listed in the discovery document. Example: + * `Project` + * This value is unspecified for resources that do not have an API based on a + * discovery document, such as Cloud Bigtable. + * @type string $resource_url + * The REST URL for accessing the resource. An HTTP `GET` request using this + * URL returns the resource itself. Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` + * This value is unspecified for resources without a REST API. + * @type string $parent + * The full name of the immediate parent of this resource. See + * [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * For Google Cloud assets, this value is the parent resource defined in the + * [IAM policy + * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + * Example: + * `//cloudresourcemanager.googleapis.com/projects/my_project_123` + * @type \Google\Protobuf\Struct $data + * The content of the resource, in which some sensitive fields are removed + * and may not be present. + * @type string $location + * The location of the resource in Google Cloud, such as its zone and region. + * For more information, see https://cloud.google.com/about/locations/. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The API version. Example: `v1` + * + * Generated from protobuf field string version = 1; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The API version. Example: `v1` + * + * Generated from protobuf field string version = 1; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` + * This value is unspecified for resources that do not have an API based on a + * discovery document, such as Cloud Bigtable. + * + * Generated from protobuf field string discovery_document_uri = 2; + * @return string + */ + public function getDiscoveryDocumentUri() + { + return $this->discovery_document_uri; + } + + /** + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` + * This value is unspecified for resources that do not have an API based on a + * discovery document, such as Cloud Bigtable. + * + * Generated from protobuf field string discovery_document_uri = 2; + * @param string $var + * @return $this + */ + public function setDiscoveryDocumentUri($var) + { + GPBUtil::checkString($var, True); + $this->discovery_document_uri = $var; + + return $this; + } + + /** + * The JSON schema name listed in the discovery document. Example: + * `Project` + * This value is unspecified for resources that do not have an API based on a + * discovery document, such as Cloud Bigtable. + * + * Generated from protobuf field string discovery_name = 3; + * @return string + */ + public function getDiscoveryName() + { + return $this->discovery_name; + } + + /** + * The JSON schema name listed in the discovery document. Example: + * `Project` + * This value is unspecified for resources that do not have an API based on a + * discovery document, such as Cloud Bigtable. + * + * Generated from protobuf field string discovery_name = 3; + * @param string $var + * @return $this + */ + public function setDiscoveryName($var) + { + GPBUtil::checkString($var, True); + $this->discovery_name = $var; + + return $this; + } + + /** + * The REST URL for accessing the resource. An HTTP `GET` request using this + * URL returns the resource itself. Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` + * This value is unspecified for resources without a REST API. + * + * Generated from protobuf field string resource_url = 4; + * @return string + */ + public function getResourceUrl() + { + return $this->resource_url; + } + + /** + * The REST URL for accessing the resource. An HTTP `GET` request using this + * URL returns the resource itself. Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` + * This value is unspecified for resources without a REST API. + * + * Generated from protobuf field string resource_url = 4; + * @param string $var + * @return $this + */ + public function setResourceUrl($var) + { + GPBUtil::checkString($var, True); + $this->resource_url = $var; + + return $this; + } + + /** + * The full name of the immediate parent of this resource. See + * [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * For Google Cloud assets, this value is the parent resource defined in the + * [IAM policy + * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + * Example: + * `//cloudresourcemanager.googleapis.com/projects/my_project_123` + * + * Generated from protobuf field string parent = 5; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The full name of the immediate parent of this resource. See + * [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * For Google Cloud assets, this value is the parent resource defined in the + * [IAM policy + * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + * Example: + * `//cloudresourcemanager.googleapis.com/projects/my_project_123` + * + * Generated from protobuf field string parent = 5; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The content of the resource, in which some sensitive fields are removed + * and may not be present. + * + * Generated from protobuf field .google.protobuf.Struct data = 6; + * @return \Google\Protobuf\Struct|null + */ + public function getData() + { + return $this->data; + } + + public function hasData() + { + return isset($this->data); + } + + public function clearData() + { + unset($this->data); + } + + /** + * The content of the resource, in which some sensitive fields are removed + * and may not be present. + * + * Generated from protobuf field .google.protobuf.Struct data = 6; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->data = $var; + + return $this; + } + + /** + * The location of the resource in Google Cloud, such as its zone and region. + * For more information, see https://cloud.google.com/about/locations/. + * + * Generated from protobuf field string location = 8; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * The location of the resource in Google Cloud, such as its zone and region. + * For more information, see https://cloud.google.com/about/locations/. + * + * Generated from protobuf field string location = 8; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ResourceSearchResult.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ResourceSearchResult.php new file mode 100644 index 000000000000..1ff1be739f9c --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/ResourceSearchResult.php @@ -0,0 +1,1849 @@ +google.cloud.asset.v1.ResourceSearchResult + */ +class ResourceSearchResult extends \Google\Protobuf\Internal\Message +{ + /** + * The full resource name of this resource. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * To search against the `name`: + * * Use a field query. Example: `name:instance1` + * * Use a free text query. Example: `instance1` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The type of this resource. Example: `compute.googleapis.com/Disk`. + * To search against the `asset_type`: + * * Specify the `asset_type` field in your search request. + * + * Generated from protobuf field string asset_type = 2; + */ + protected $asset_type = ''; + /** + * The project that this resource belongs to, in the form of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * To search against `project`: + * * Use a field query. Example: `project:12345` + * * Use a free text query. Example: `12345` + * * Specify the `scope` field as this project in your search request. + * + * Generated from protobuf field string project = 3; + */ + protected $project = ''; + /** + * The folder(s) that this resource belongs to, in the form of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs to one or more folders. + * To search against `folders`: + * * Use a field query. Example: `folders:(123 OR 456)` + * * Use a free text query. Example: `123` + * * Specify the `scope` field as this folder in your search request. + * + * Generated from protobuf field repeated string folders = 17; + */ + private $folders; + /** + * The organization that this resource belongs to, in the form of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs to an organization. + * To search against `organization`: + * * Use a field query. Example: `organization:123` + * * Use a free text query. Example: `123` + * * Specify the `scope` field as this organization in your search request. + * + * Generated from protobuf field string organization = 18; + */ + protected $organization = ''; + /** + * The display name of this resource. This field is available only when the + * resource's Protobuf contains it. + * To search against the `display_name`: + * * Use a field query. Example: `displayName:"My Instance"` + * * Use a free text query. Example: `"My Instance"` + * + * Generated from protobuf field string display_name = 4; + */ + protected $display_name = ''; + /** + * One or more paragraphs of text description of this resource. Maximum length + * could be up to 1M bytes. This field is available only when the resource's + * Protobuf contains it. + * To search against the `description`: + * * Use a field query. Example: `description:"important instance"` + * * Use a free text query. Example: `"important instance"` + * + * Generated from protobuf field string description = 5; + */ + protected $description = ''; + /** + * Location can be `global`, regional like `us-east1`, or zonal like + * `us-west1-b`. This field is available only when the resource's Protobuf + * contains it. + * To search against the `location`: + * * Use a field query. Example: `location:us-west*` + * * Use a free text query. Example: `us-west*` + * + * Generated from protobuf field string location = 6; + */ + protected $location = ''; + /** + * User labels associated with this resource. See [Labelling and grouping + * Google Cloud + * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + * for more information. This field is available only when the resource's + * Protobuf contains it. + * To search against the `labels`: + * * Use a field query: + * - query on any label's key or value. Example: `labels:prod` + * - query by a given label. Example: `labels.env:prod` + * - query by a given label's existence. Example: `labels.env:*` + * * Use a free text query. Example: `prod` + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + /** + * Network tags associated with this resource. Like labels, network tags are a + * type of annotations used to group Google Cloud resources. See [Labelling + * Google Cloud + * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + * for more information. This field is available only when the resource's + * Protobuf contains it. + * To search against the `network_tags`: + * * Use a field query. Example: `networkTags:internal` + * * Use a free text query. Example: `internal` + * + * Generated from protobuf field repeated string network_tags = 8; + */ + private $network_tags; + /** + * The Cloud KMS + * [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) + * name or + * [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + * name. + * This field only presents for the purpose of backward compatibility. + * Use the `kms_keys` field to retrieve Cloud KMS key information. This field + * is available only when the resource's Protobuf contains it and will only be + * populated for [these resource + * types](https://cloud.google.com/asset-inventory/docs/legacy-field-names#resource_types_with_the_to_be_deprecated_kmskey_field) + * for backward compatible purposes. + * To search against the `kms_key`: + * * Use a field query. Example: `kmsKey:key` + * * Use a free text query. Example: `key` + * + * Generated from protobuf field string kms_key = 10 [deprecated = true]; + * @deprecated + */ + protected $kms_key = ''; + /** + * The Cloud KMS + * [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) + * names or + * [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + * names. This field is available only when the resource's Protobuf contains + * it. + * To search against the `kms_keys`: + * * Use a field query. Example: `kmsKeys:key` + * * Use a free text query. Example: `key` + * + * Generated from protobuf field repeated string kms_keys = 28; + */ + private $kms_keys; + /** + * The create timestamp of this resource, at which the resource was created. + * The granularity is in seconds. Timestamp.nanos will always be 0. This field + * is available only when the resource's Protobuf contains it. + * To search against `create_time`: + * * Use a field query. + * - value in seconds since unix epoch. Example: `createTime > 1609459200` + * - value in date string. Example: `createTime > 2021-01-01` + * - value in date-time string (must be quoted). Example: `createTime > + * "2021-01-01T00:00:00"` + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11; + */ + protected $create_time = null; + /** + * The last update timestamp of this resource, at which the resource was last + * modified or deleted. The granularity is in seconds. Timestamp.nanos will + * always be 0. This field is available only when the resource's Protobuf + * contains it. + * To search against `update_time`: + * * Use a field query. + * - value in seconds since unix epoch. Example: `updateTime < 1609459200` + * - value in date string. Example: `updateTime < 2021-01-01` + * - value in date-time string (must be quoted). Example: `updateTime < + * "2021-01-01T00:00:00"` + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12; + */ + protected $update_time = null; + /** + * The state of this resource. Different resources types have different state + * definitions that are mapped from various fields of different resource + * types. This field is available only when the resource's Protobuf contains + * it. + * Example: + * If the resource is an instance provided by Compute Engine, + * its state will include PROVISIONING, STAGING, RUNNING, STOPPING, + * SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See `status` definition + * in [API + * Reference](https://cloud.google.com/compute/docs/reference/rest/v1/instances). + * If the resource is a project provided by Resource Manager, its state + * will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED and + * DELETE_IN_PROGRESS. See `lifecycleState` definition in [API + * Reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects). + * To search against the `state`: + * * Use a field query. Example: `state:RUNNING` + * * Use a free text query. Example: `RUNNING` + * + * Generated from protobuf field string state = 13; + */ + protected $state = ''; + /** + * The additional searchable attributes of this resource. The attributes may + * vary from one resource type to another. Examples: `projectId` for Project, + * `dnsName` for DNS ManagedZone. This field contains a subset of the resource + * metadata fields that are returned by the List or Get APIs provided by the + * corresponding Google Cloud service (e.g., Compute Engine). see [API + * references and supported searchable + * attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * to see which fields are included. + * You can search values of these fields through free text search. However, + * you should not consume the field programically as the field names and + * values may change as the Google Cloud service updates to a new incompatible + * API version. + * To search against the `additional_attributes`: + * * Use a free text query to match the attributes values. Example: to search + * `additional_attributes = { dnsName: "foobar" }`, you can issue a query + * `foobar`. + * + * Generated from protobuf field .google.protobuf.Struct additional_attributes = 9; + */ + protected $additional_attributes = null; + /** + * The full resource name of this resource's parent, if it has one. + * To search against the `parent_full_resource_name`: + * * Use a field query. Example: + * `parentFullResourceName:"project-name"` + * * Use a free text query. Example: + * `project-name` + * + * Generated from protobuf field string parent_full_resource_name = 19; + */ + protected $parent_full_resource_name = ''; + /** + * Versioned resource representations of this resource. This is repeated + * because there could be multiple versions of resource representations during + * version migration. + * This `versioned_resources` field is not searchable. Some attributes of the + * resource representations are exposed in `additional_attributes` field, so + * as to allow users to search on them. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.VersionedResource versioned_resources = 16; + */ + private $versioned_resources; + /** + * Attached resources of this resource. For example, an OSConfig + * Inventory is an attached resource of a Compute Instance. This field is + * repeated because a resource could have multiple attached resources. + * This `attached_resources` field is not searchable. Some attributes + * of the attached resources are exposed in `additional_attributes` field, so + * as to allow users to search on them. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AttachedResource attached_resources = 20; + */ + private $attached_resources; + /** + * A map of related resources of this resource, keyed by the + * relationship type. A relationship type is in the format of + * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`, + * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`. + * See [supported relationship + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types). + * + * Generated from protobuf field map relationships = 21; + */ + private $relationships; + /** + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + * To search against the `tagKeys`: + * * Use a field query. Example: + * - `tagKeys:"123456789/env*"` + * - `tagKeys="123456789/env"` + * - `tagKeys:"env"` + * * Use a free text query. Example: + * - `env` + * + * Generated from protobuf field repeated string tag_keys = 23 [deprecated = true]; + * @deprecated + */ + private $tag_keys; + /** + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagValue namespaced names, in the format of + * {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + * To search against the `tagValues`: + * * Use a field query. Example: + * - `tagValues:"env"` + * - `tagValues:"env/prod"` + * - `tagValues:"123456789/env/prod*"` + * - `tagValues="123456789/env/prod"` + * * Use a free text query. Example: + * - `prod` + * + * Generated from protobuf field repeated string tag_values = 25 [deprecated = true]; + * @deprecated + */ + private $tag_values; + /** + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}. + * To search against the `tagValueIds`: + * * Use a field query. Example: + * - `tagValueIds="tagValues/456"` + * * Use a free text query. Example: + * - `456` + * + * Generated from protobuf field repeated string tag_value_ids = 26 [deprecated = true]; + * @deprecated + */ + private $tag_value_ids; + /** + * The tags directly attached to this resource. + * To search against the `tags`: + * * Use a field query. Example: + * - `tagKeys:"123456789/env*"` + * - `tagKeys="123456789/env"` + * - `tagKeys:"env"` + * - `tagKeyIds="tagKeys/123"` + * - `tagValues:"env"` + * - `tagValues:"env/prod"` + * - `tagValues:"123456789/env/prod*"` + * - `tagValues="123456789/env/prod"` + * - `tagValueIds="tagValues/456"` + * * Use a free text query. Example: + * - `env/prod` + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Tag tags = 29; + */ + private $tags; + /** + * The effective tags on this resource. All of the tags that are both attached + * to and inherited by a resource are collectively called the effective + * tags. For more information, see [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * To search against the `effective_tags`: + * * Use a field query. Example: + * - `effectiveTagKeys:"123456789/env*"` + * - `effectiveTagKeys="123456789/env"` + * - `effectiveTagKeys:"env"` + * - `effectiveTagKeyIds="tagKeys/123"` + * - `effectiveTagValues:"env"` + * - `effectiveTagValues:"env/prod"` + * - `effectiveTagValues:"123456789/env/prod*"` + * - `effectiveTagValues="123456789/env/prod"` + * - `effectiveTagValueIds="tagValues/456"` + * + * Generated from protobuf field repeated .google.cloud.asset.v1.EffectiveTagDetails effective_tags = 30; + */ + private $effective_tags; + /** + * The type of this resource's immediate parent, if there is one. + * To search against the `parent_asset_type`: + * * Use a field query. Example: + * `parentAssetType:"cloudresourcemanager.googleapis.com/Project"` + * * Use a free text query. Example: + * `cloudresourcemanager.googleapis.com/Project` + * + * Generated from protobuf field string parent_asset_type = 103; + */ + protected $parent_asset_type = ''; + /** + * The actual content of Security Command Center security marks associated + * with the asset. + * To search against SCC SecurityMarks field: + * * Use a field query: + * - query by a given key value pair. Example: `sccSecurityMarks.foo=bar` + * - query by a given key's existence. Example: `sccSecurityMarks.foo:*` + * + * Generated from protobuf field map scc_security_marks = 32; + */ + private $scc_security_marks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The full resource name of this resource. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * To search against the `name`: + * * Use a field query. Example: `name:instance1` + * * Use a free text query. Example: `instance1` + * @type string $asset_type + * The type of this resource. Example: `compute.googleapis.com/Disk`. + * To search against the `asset_type`: + * * Specify the `asset_type` field in your search request. + * @type string $project + * The project that this resource belongs to, in the form of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * To search against `project`: + * * Use a field query. Example: `project:12345` + * * Use a free text query. Example: `12345` + * * Specify the `scope` field as this project in your search request. + * @type array|\Google\Protobuf\Internal\RepeatedField $folders + * The folder(s) that this resource belongs to, in the form of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs to one or more folders. + * To search against `folders`: + * * Use a field query. Example: `folders:(123 OR 456)` + * * Use a free text query. Example: `123` + * * Specify the `scope` field as this folder in your search request. + * @type string $organization + * The organization that this resource belongs to, in the form of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs to an organization. + * To search against `organization`: + * * Use a field query. Example: `organization:123` + * * Use a free text query. Example: `123` + * * Specify the `scope` field as this organization in your search request. + * @type string $display_name + * The display name of this resource. This field is available only when the + * resource's Protobuf contains it. + * To search against the `display_name`: + * * Use a field query. Example: `displayName:"My Instance"` + * * Use a free text query. Example: `"My Instance"` + * @type string $description + * One or more paragraphs of text description of this resource. Maximum length + * could be up to 1M bytes. This field is available only when the resource's + * Protobuf contains it. + * To search against the `description`: + * * Use a field query. Example: `description:"important instance"` + * * Use a free text query. Example: `"important instance"` + * @type string $location + * Location can be `global`, regional like `us-east1`, or zonal like + * `us-west1-b`. This field is available only when the resource's Protobuf + * contains it. + * To search against the `location`: + * * Use a field query. Example: `location:us-west*` + * * Use a free text query. Example: `us-west*` + * @type array|\Google\Protobuf\Internal\MapField $labels + * User labels associated with this resource. See [Labelling and grouping + * Google Cloud + * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + * for more information. This field is available only when the resource's + * Protobuf contains it. + * To search against the `labels`: + * * Use a field query: + * - query on any label's key or value. Example: `labels:prod` + * - query by a given label. Example: `labels.env:prod` + * - query by a given label's existence. Example: `labels.env:*` + * * Use a free text query. Example: `prod` + * @type array|\Google\Protobuf\Internal\RepeatedField $network_tags + * Network tags associated with this resource. Like labels, network tags are a + * type of annotations used to group Google Cloud resources. See [Labelling + * Google Cloud + * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + * for more information. This field is available only when the resource's + * Protobuf contains it. + * To search against the `network_tags`: + * * Use a field query. Example: `networkTags:internal` + * * Use a free text query. Example: `internal` + * @type string $kms_key + * The Cloud KMS + * [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) + * name or + * [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + * name. + * This field only presents for the purpose of backward compatibility. + * Use the `kms_keys` field to retrieve Cloud KMS key information. This field + * is available only when the resource's Protobuf contains it and will only be + * populated for [these resource + * types](https://cloud.google.com/asset-inventory/docs/legacy-field-names#resource_types_with_the_to_be_deprecated_kmskey_field) + * for backward compatible purposes. + * To search against the `kms_key`: + * * Use a field query. Example: `kmsKey:key` + * * Use a free text query. Example: `key` + * @type array|\Google\Protobuf\Internal\RepeatedField $kms_keys + * The Cloud KMS + * [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) + * names or + * [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + * names. This field is available only when the resource's Protobuf contains + * it. + * To search against the `kms_keys`: + * * Use a field query. Example: `kmsKeys:key` + * * Use a free text query. Example: `key` + * @type \Google\Protobuf\Timestamp $create_time + * The create timestamp of this resource, at which the resource was created. + * The granularity is in seconds. Timestamp.nanos will always be 0. This field + * is available only when the resource's Protobuf contains it. + * To search against `create_time`: + * * Use a field query. + * - value in seconds since unix epoch. Example: `createTime > 1609459200` + * - value in date string. Example: `createTime > 2021-01-01` + * - value in date-time string (must be quoted). Example: `createTime > + * "2021-01-01T00:00:00"` + * @type \Google\Protobuf\Timestamp $update_time + * The last update timestamp of this resource, at which the resource was last + * modified or deleted. The granularity is in seconds. Timestamp.nanos will + * always be 0. This field is available only when the resource's Protobuf + * contains it. + * To search against `update_time`: + * * Use a field query. + * - value in seconds since unix epoch. Example: `updateTime < 1609459200` + * - value in date string. Example: `updateTime < 2021-01-01` + * - value in date-time string (must be quoted). Example: `updateTime < + * "2021-01-01T00:00:00"` + * @type string $state + * The state of this resource. Different resources types have different state + * definitions that are mapped from various fields of different resource + * types. This field is available only when the resource's Protobuf contains + * it. + * Example: + * If the resource is an instance provided by Compute Engine, + * its state will include PROVISIONING, STAGING, RUNNING, STOPPING, + * SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See `status` definition + * in [API + * Reference](https://cloud.google.com/compute/docs/reference/rest/v1/instances). + * If the resource is a project provided by Resource Manager, its state + * will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED and + * DELETE_IN_PROGRESS. See `lifecycleState` definition in [API + * Reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects). + * To search against the `state`: + * * Use a field query. Example: `state:RUNNING` + * * Use a free text query. Example: `RUNNING` + * @type \Google\Protobuf\Struct $additional_attributes + * The additional searchable attributes of this resource. The attributes may + * vary from one resource type to another. Examples: `projectId` for Project, + * `dnsName` for DNS ManagedZone. This field contains a subset of the resource + * metadata fields that are returned by the List or Get APIs provided by the + * corresponding Google Cloud service (e.g., Compute Engine). see [API + * references and supported searchable + * attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * to see which fields are included. + * You can search values of these fields through free text search. However, + * you should not consume the field programically as the field names and + * values may change as the Google Cloud service updates to a new incompatible + * API version. + * To search against the `additional_attributes`: + * * Use a free text query to match the attributes values. Example: to search + * `additional_attributes = { dnsName: "foobar" }`, you can issue a query + * `foobar`. + * @type string $parent_full_resource_name + * The full resource name of this resource's parent, if it has one. + * To search against the `parent_full_resource_name`: + * * Use a field query. Example: + * `parentFullResourceName:"project-name"` + * * Use a free text query. Example: + * `project-name` + * @type array<\Google\Cloud\Asset\V1\VersionedResource>|\Google\Protobuf\Internal\RepeatedField $versioned_resources + * Versioned resource representations of this resource. This is repeated + * because there could be multiple versions of resource representations during + * version migration. + * This `versioned_resources` field is not searchable. Some attributes of the + * resource representations are exposed in `additional_attributes` field, so + * as to allow users to search on them. + * @type array<\Google\Cloud\Asset\V1\AttachedResource>|\Google\Protobuf\Internal\RepeatedField $attached_resources + * Attached resources of this resource. For example, an OSConfig + * Inventory is an attached resource of a Compute Instance. This field is + * repeated because a resource could have multiple attached resources. + * This `attached_resources` field is not searchable. Some attributes + * of the attached resources are exposed in `additional_attributes` field, so + * as to allow users to search on them. + * @type array|\Google\Protobuf\Internal\MapField $relationships + * A map of related resources of this resource, keyed by the + * relationship type. A relationship type is in the format of + * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`, + * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`. + * See [supported relationship + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types). + * @type array|\Google\Protobuf\Internal\RepeatedField $tag_keys + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + * To search against the `tagKeys`: + * * Use a field query. Example: + * - `tagKeys:"123456789/env*"` + * - `tagKeys="123456789/env"` + * - `tagKeys:"env"` + * * Use a free text query. Example: + * - `env` + * @type array|\Google\Protobuf\Internal\RepeatedField $tag_values + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagValue namespaced names, in the format of + * {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + * To search against the `tagValues`: + * * Use a field query. Example: + * - `tagValues:"env"` + * - `tagValues:"env/prod"` + * - `tagValues:"123456789/env/prod*"` + * - `tagValues="123456789/env/prod"` + * * Use a free text query. Example: + * - `prod` + * @type array|\Google\Protobuf\Internal\RepeatedField $tag_value_ids + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}. + * To search against the `tagValueIds`: + * * Use a field query. Example: + * - `tagValueIds="tagValues/456"` + * * Use a free text query. Example: + * - `456` + * @type array<\Google\Cloud\Asset\V1\Tag>|\Google\Protobuf\Internal\RepeatedField $tags + * The tags directly attached to this resource. + * To search against the `tags`: + * * Use a field query. Example: + * - `tagKeys:"123456789/env*"` + * - `tagKeys="123456789/env"` + * - `tagKeys:"env"` + * - `tagKeyIds="tagKeys/123"` + * - `tagValues:"env"` + * - `tagValues:"env/prod"` + * - `tagValues:"123456789/env/prod*"` + * - `tagValues="123456789/env/prod"` + * - `tagValueIds="tagValues/456"` + * * Use a free text query. Example: + * - `env/prod` + * @type array<\Google\Cloud\Asset\V1\EffectiveTagDetails>|\Google\Protobuf\Internal\RepeatedField $effective_tags + * The effective tags on this resource. All of the tags that are both attached + * to and inherited by a resource are collectively called the effective + * tags. For more information, see [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * To search against the `effective_tags`: + * * Use a field query. Example: + * - `effectiveTagKeys:"123456789/env*"` + * - `effectiveTagKeys="123456789/env"` + * - `effectiveTagKeys:"env"` + * - `effectiveTagKeyIds="tagKeys/123"` + * - `effectiveTagValues:"env"` + * - `effectiveTagValues:"env/prod"` + * - `effectiveTagValues:"123456789/env/prod*"` + * - `effectiveTagValues="123456789/env/prod"` + * - `effectiveTagValueIds="tagValues/456"` + * @type string $parent_asset_type + * The type of this resource's immediate parent, if there is one. + * To search against the `parent_asset_type`: + * * Use a field query. Example: + * `parentAssetType:"cloudresourcemanager.googleapis.com/Project"` + * * Use a free text query. Example: + * `cloudresourcemanager.googleapis.com/Project` + * @type array|\Google\Protobuf\Internal\MapField $scc_security_marks + * The actual content of Security Command Center security marks associated + * with the asset. + * To search against SCC SecurityMarks field: + * * Use a field query: + * - query by a given key value pair. Example: `sccSecurityMarks.foo=bar` + * - query by a given key's existence. Example: `sccSecurityMarks.foo:*` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The full resource name of this resource. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * To search against the `name`: + * * Use a field query. Example: `name:instance1` + * * Use a free text query. Example: `instance1` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The full resource name of this resource. Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Cloud Asset Inventory Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more information. + * To search against the `name`: + * * Use a field query. Example: `name:instance1` + * * Use a free text query. Example: `instance1` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The type of this resource. Example: `compute.googleapis.com/Disk`. + * To search against the `asset_type`: + * * Specify the `asset_type` field in your search request. + * + * Generated from protobuf field string asset_type = 2; + * @return string + */ + public function getAssetType() + { + return $this->asset_type; + } + + /** + * The type of this resource. Example: `compute.googleapis.com/Disk`. + * To search against the `asset_type`: + * * Specify the `asset_type` field in your search request. + * + * Generated from protobuf field string asset_type = 2; + * @param string $var + * @return $this + */ + public function setAssetType($var) + { + GPBUtil::checkString($var, True); + $this->asset_type = $var; + + return $this; + } + + /** + * The project that this resource belongs to, in the form of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * To search against `project`: + * * Use a field query. Example: `project:12345` + * * Use a free text query. Example: `12345` + * * Specify the `scope` field as this project in your search request. + * + * Generated from protobuf field string project = 3; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * The project that this resource belongs to, in the form of + * projects/{PROJECT_NUMBER}. This field is available when the resource + * belongs to a project. + * To search against `project`: + * * Use a field query. Example: `project:12345` + * * Use a free text query. Example: `12345` + * * Specify the `scope` field as this project in your search request. + * + * Generated from protobuf field string project = 3; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The folder(s) that this resource belongs to, in the form of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs to one or more folders. + * To search against `folders`: + * * Use a field query. Example: `folders:(123 OR 456)` + * * Use a free text query. Example: `123` + * * Specify the `scope` field as this folder in your search request. + * + * Generated from protobuf field repeated string folders = 17; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFolders() + { + return $this->folders; + } + + /** + * The folder(s) that this resource belongs to, in the form of + * folders/{FOLDER_NUMBER}. This field is available when the resource + * belongs to one or more folders. + * To search against `folders`: + * * Use a field query. Example: `folders:(123 OR 456)` + * * Use a free text query. Example: `123` + * * Specify the `scope` field as this folder in your search request. + * + * Generated from protobuf field repeated string folders = 17; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFolders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->folders = $arr; + + return $this; + } + + /** + * The organization that this resource belongs to, in the form of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs to an organization. + * To search against `organization`: + * * Use a field query. Example: `organization:123` + * * Use a free text query. Example: `123` + * * Specify the `scope` field as this organization in your search request. + * + * Generated from protobuf field string organization = 18; + * @return string + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * The organization that this resource belongs to, in the form of + * organizations/{ORGANIZATION_NUMBER}. This field is available when the + * resource belongs to an organization. + * To search against `organization`: + * * Use a field query. Example: `organization:123` + * * Use a free text query. Example: `123` + * * Specify the `scope` field as this organization in your search request. + * + * Generated from protobuf field string organization = 18; + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + + /** + * The display name of this resource. This field is available only when the + * resource's Protobuf contains it. + * To search against the `display_name`: + * * Use a field query. Example: `displayName:"My Instance"` + * * Use a free text query. Example: `"My Instance"` + * + * Generated from protobuf field string display_name = 4; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of this resource. This field is available only when the + * resource's Protobuf contains it. + * To search against the `display_name`: + * * Use a field query. Example: `displayName:"My Instance"` + * * Use a free text query. Example: `"My Instance"` + * + * Generated from protobuf field string display_name = 4; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * One or more paragraphs of text description of this resource. Maximum length + * could be up to 1M bytes. This field is available only when the resource's + * Protobuf contains it. + * To search against the `description`: + * * Use a field query. Example: `description:"important instance"` + * * Use a free text query. Example: `"important instance"` + * + * Generated from protobuf field string description = 5; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * One or more paragraphs of text description of this resource. Maximum length + * could be up to 1M bytes. This field is available only when the resource's + * Protobuf contains it. + * To search against the `description`: + * * Use a field query. Example: `description:"important instance"` + * * Use a free text query. Example: `"important instance"` + * + * Generated from protobuf field string description = 5; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Location can be `global`, regional like `us-east1`, or zonal like + * `us-west1-b`. This field is available only when the resource's Protobuf + * contains it. + * To search against the `location`: + * * Use a field query. Example: `location:us-west*` + * * Use a free text query. Example: `us-west*` + * + * Generated from protobuf field string location = 6; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Location can be `global`, regional like `us-east1`, or zonal like + * `us-west1-b`. This field is available only when the resource's Protobuf + * contains it. + * To search against the `location`: + * * Use a field query. Example: `location:us-west*` + * * Use a free text query. Example: `us-west*` + * + * Generated from protobuf field string location = 6; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * User labels associated with this resource. See [Labelling and grouping + * Google Cloud + * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + * for more information. This field is available only when the resource's + * Protobuf contains it. + * To search against the `labels`: + * * Use a field query: + * - query on any label's key or value. Example: `labels:prod` + * - query by a given label. Example: `labels.env:prod` + * - query by a given label's existence. Example: `labels.env:*` + * * Use a free text query. Example: `prod` + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * User labels associated with this resource. See [Labelling and grouping + * Google Cloud + * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + * for more information. This field is available only when the resource's + * Protobuf contains it. + * To search against the `labels`: + * * Use a field query: + * - query on any label's key or value. Example: `labels:prod` + * - query by a given label. Example: `labels.env:prod` + * - query by a given label's existence. Example: `labels.env:*` + * * Use a free text query. Example: `prod` + * + * Generated from protobuf field map labels = 7; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Network tags associated with this resource. Like labels, network tags are a + * type of annotations used to group Google Cloud resources. See [Labelling + * Google Cloud + * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + * for more information. This field is available only when the resource's + * Protobuf contains it. + * To search against the `network_tags`: + * * Use a field query. Example: `networkTags:internal` + * * Use a free text query. Example: `internal` + * + * Generated from protobuf field repeated string network_tags = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkTags() + { + return $this->network_tags; + } + + /** + * Network tags associated with this resource. Like labels, network tags are a + * type of annotations used to group Google Cloud resources. See [Labelling + * Google Cloud + * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + * for more information. This field is available only when the resource's + * Protobuf contains it. + * To search against the `network_tags`: + * * Use a field query. Example: `networkTags:internal` + * * Use a free text query. Example: `internal` + * + * Generated from protobuf field repeated string network_tags = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->network_tags = $arr; + + return $this; + } + + /** + * The Cloud KMS + * [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) + * name or + * [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + * name. + * This field only presents for the purpose of backward compatibility. + * Use the `kms_keys` field to retrieve Cloud KMS key information. This field + * is available only when the resource's Protobuf contains it and will only be + * populated for [these resource + * types](https://cloud.google.com/asset-inventory/docs/legacy-field-names#resource_types_with_the_to_be_deprecated_kmskey_field) + * for backward compatible purposes. + * To search against the `kms_key`: + * * Use a field query. Example: `kmsKey:key` + * * Use a free text query. Example: `key` + * + * Generated from protobuf field string kms_key = 10 [deprecated = true]; + * @return string + * @deprecated + */ + public function getKmsKey() + { + @trigger_error('kms_key is deprecated.', E_USER_DEPRECATED); + return $this->kms_key; + } + + /** + * The Cloud KMS + * [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) + * name or + * [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + * name. + * This field only presents for the purpose of backward compatibility. + * Use the `kms_keys` field to retrieve Cloud KMS key information. This field + * is available only when the resource's Protobuf contains it and will only be + * populated for [these resource + * types](https://cloud.google.com/asset-inventory/docs/legacy-field-names#resource_types_with_the_to_be_deprecated_kmskey_field) + * for backward compatible purposes. + * To search against the `kms_key`: + * * Use a field query. Example: `kmsKey:key` + * * Use a free text query. Example: `key` + * + * Generated from protobuf field string kms_key = 10 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setKmsKey($var) + { + @trigger_error('kms_key is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->kms_key = $var; + + return $this; + } + + /** + * The Cloud KMS + * [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) + * names or + * [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + * names. This field is available only when the resource's Protobuf contains + * it. + * To search against the `kms_keys`: + * * Use a field query. Example: `kmsKeys:key` + * * Use a free text query. Example: `key` + * + * Generated from protobuf field repeated string kms_keys = 28; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKmsKeys() + { + return $this->kms_keys; + } + + /** + * The Cloud KMS + * [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) + * names or + * [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + * names. This field is available only when the resource's Protobuf contains + * it. + * To search against the `kms_keys`: + * * Use a field query. Example: `kmsKeys:key` + * * Use a free text query. Example: `key` + * + * Generated from protobuf field repeated string kms_keys = 28; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKmsKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->kms_keys = $arr; + + return $this; + } + + /** + * The create timestamp of this resource, at which the resource was created. + * The granularity is in seconds. Timestamp.nanos will always be 0. This field + * is available only when the resource's Protobuf contains it. + * To search against `create_time`: + * * Use a field query. + * - value in seconds since unix epoch. Example: `createTime > 1609459200` + * - value in date string. Example: `createTime > 2021-01-01` + * - value in date-time string (must be quoted). Example: `createTime > + * "2021-01-01T00:00:00"` + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The create timestamp of this resource, at which the resource was created. + * The granularity is in seconds. Timestamp.nanos will always be 0. This field + * is available only when the resource's Protobuf contains it. + * To search against `create_time`: + * * Use a field query. + * - value in seconds since unix epoch. Example: `createTime > 1609459200` + * - value in date string. Example: `createTime > 2021-01-01` + * - value in date-time string (must be quoted). Example: `createTime > + * "2021-01-01T00:00:00"` + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The last update timestamp of this resource, at which the resource was last + * modified or deleted. The granularity is in seconds. Timestamp.nanos will + * always be 0. This field is available only when the resource's Protobuf + * contains it. + * To search against `update_time`: + * * Use a field query. + * - value in seconds since unix epoch. Example: `updateTime < 1609459200` + * - value in date string. Example: `updateTime < 2021-01-01` + * - value in date-time string (must be quoted). Example: `updateTime < + * "2021-01-01T00:00:00"` + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * The last update timestamp of this resource, at which the resource was last + * modified or deleted. The granularity is in seconds. Timestamp.nanos will + * always be 0. This field is available only when the resource's Protobuf + * contains it. + * To search against `update_time`: + * * Use a field query. + * - value in seconds since unix epoch. Example: `updateTime < 1609459200` + * - value in date string. Example: `updateTime < 2021-01-01` + * - value in date-time string (must be quoted). Example: `updateTime < + * "2021-01-01T00:00:00"` + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * The state of this resource. Different resources types have different state + * definitions that are mapped from various fields of different resource + * types. This field is available only when the resource's Protobuf contains + * it. + * Example: + * If the resource is an instance provided by Compute Engine, + * its state will include PROVISIONING, STAGING, RUNNING, STOPPING, + * SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See `status` definition + * in [API + * Reference](https://cloud.google.com/compute/docs/reference/rest/v1/instances). + * If the resource is a project provided by Resource Manager, its state + * will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED and + * DELETE_IN_PROGRESS. See `lifecycleState` definition in [API + * Reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects). + * To search against the `state`: + * * Use a field query. Example: `state:RUNNING` + * * Use a free text query. Example: `RUNNING` + * + * Generated from protobuf field string state = 13; + * @return string + */ + public function getState() + { + return $this->state; + } + + /** + * The state of this resource. Different resources types have different state + * definitions that are mapped from various fields of different resource + * types. This field is available only when the resource's Protobuf contains + * it. + * Example: + * If the resource is an instance provided by Compute Engine, + * its state will include PROVISIONING, STAGING, RUNNING, STOPPING, + * SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See `status` definition + * in [API + * Reference](https://cloud.google.com/compute/docs/reference/rest/v1/instances). + * If the resource is a project provided by Resource Manager, its state + * will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED and + * DELETE_IN_PROGRESS. See `lifecycleState` definition in [API + * Reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects). + * To search against the `state`: + * * Use a field query. Example: `state:RUNNING` + * * Use a free text query. Example: `RUNNING` + * + * Generated from protobuf field string state = 13; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * The additional searchable attributes of this resource. The attributes may + * vary from one resource type to another. Examples: `projectId` for Project, + * `dnsName` for DNS ManagedZone. This field contains a subset of the resource + * metadata fields that are returned by the List or Get APIs provided by the + * corresponding Google Cloud service (e.g., Compute Engine). see [API + * references and supported searchable + * attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * to see which fields are included. + * You can search values of these fields through free text search. However, + * you should not consume the field programically as the field names and + * values may change as the Google Cloud service updates to a new incompatible + * API version. + * To search against the `additional_attributes`: + * * Use a free text query to match the attributes values. Example: to search + * `additional_attributes = { dnsName: "foobar" }`, you can issue a query + * `foobar`. + * + * Generated from protobuf field .google.protobuf.Struct additional_attributes = 9; + * @return \Google\Protobuf\Struct|null + */ + public function getAdditionalAttributes() + { + return $this->additional_attributes; + } + + public function hasAdditionalAttributes() + { + return isset($this->additional_attributes); + } + + public function clearAdditionalAttributes() + { + unset($this->additional_attributes); + } + + /** + * The additional searchable attributes of this resource. The attributes may + * vary from one resource type to another. Examples: `projectId` for Project, + * `dnsName` for DNS ManagedZone. This field contains a subset of the resource + * metadata fields that are returned by the List or Get APIs provided by the + * corresponding Google Cloud service (e.g., Compute Engine). see [API + * references and supported searchable + * attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * to see which fields are included. + * You can search values of these fields through free text search. However, + * you should not consume the field programically as the field names and + * values may change as the Google Cloud service updates to a new incompatible + * API version. + * To search against the `additional_attributes`: + * * Use a free text query to match the attributes values. Example: to search + * `additional_attributes = { dnsName: "foobar" }`, you can issue a query + * `foobar`. + * + * Generated from protobuf field .google.protobuf.Struct additional_attributes = 9; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setAdditionalAttributes($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->additional_attributes = $var; + + return $this; + } + + /** + * The full resource name of this resource's parent, if it has one. + * To search against the `parent_full_resource_name`: + * * Use a field query. Example: + * `parentFullResourceName:"project-name"` + * * Use a free text query. Example: + * `project-name` + * + * Generated from protobuf field string parent_full_resource_name = 19; + * @return string + */ + public function getParentFullResourceName() + { + return $this->parent_full_resource_name; + } + + /** + * The full resource name of this resource's parent, if it has one. + * To search against the `parent_full_resource_name`: + * * Use a field query. Example: + * `parentFullResourceName:"project-name"` + * * Use a free text query. Example: + * `project-name` + * + * Generated from protobuf field string parent_full_resource_name = 19; + * @param string $var + * @return $this + */ + public function setParentFullResourceName($var) + { + GPBUtil::checkString($var, True); + $this->parent_full_resource_name = $var; + + return $this; + } + + /** + * Versioned resource representations of this resource. This is repeated + * because there could be multiple versions of resource representations during + * version migration. + * This `versioned_resources` field is not searchable. Some attributes of the + * resource representations are exposed in `additional_attributes` field, so + * as to allow users to search on them. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.VersionedResource versioned_resources = 16; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVersionedResources() + { + return $this->versioned_resources; + } + + /** + * Versioned resource representations of this resource. This is repeated + * because there could be multiple versions of resource representations during + * version migration. + * This `versioned_resources` field is not searchable. Some attributes of the + * resource representations are exposed in `additional_attributes` field, so + * as to allow users to search on them. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.VersionedResource versioned_resources = 16; + * @param array<\Google\Cloud\Asset\V1\VersionedResource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVersionedResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\VersionedResource::class); + $this->versioned_resources = $arr; + + return $this; + } + + /** + * Attached resources of this resource. For example, an OSConfig + * Inventory is an attached resource of a Compute Instance. This field is + * repeated because a resource could have multiple attached resources. + * This `attached_resources` field is not searchable. Some attributes + * of the attached resources are exposed in `additional_attributes` field, so + * as to allow users to search on them. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AttachedResource attached_resources = 20; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttachedResources() + { + return $this->attached_resources; + } + + /** + * Attached resources of this resource. For example, an OSConfig + * Inventory is an attached resource of a Compute Instance. This field is + * repeated because a resource could have multiple attached resources. + * This `attached_resources` field is not searchable. Some attributes + * of the attached resources are exposed in `additional_attributes` field, so + * as to allow users to search on them. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.AttachedResource attached_resources = 20; + * @param array<\Google\Cloud\Asset\V1\AttachedResource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttachedResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\AttachedResource::class); + $this->attached_resources = $arr; + + return $this; + } + + /** + * A map of related resources of this resource, keyed by the + * relationship type. A relationship type is in the format of + * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`, + * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`. + * See [supported relationship + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types). + * + * Generated from protobuf field map relationships = 21; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRelationships() + { + return $this->relationships; + } + + /** + * A map of related resources of this resource, keyed by the + * relationship type. A relationship type is in the format of + * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`, + * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`. + * See [supported relationship + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types). + * + * Generated from protobuf field map relationships = 21; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRelationships($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\RelatedResources::class); + $this->relationships = $arr; + + return $this; + } + + /** + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + * To search against the `tagKeys`: + * * Use a field query. Example: + * - `tagKeys:"123456789/env*"` + * - `tagKeys="123456789/env"` + * - `tagKeys:"env"` + * * Use a free text query. Example: + * - `env` + * + * Generated from protobuf field repeated string tag_keys = 23 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getTagKeys() + { + @trigger_error('tag_keys is deprecated.', E_USER_DEPRECATED); + return $this->tag_keys; + } + + /** + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + * To search against the `tagKeys`: + * * Use a field query. Example: + * - `tagKeys:"123456789/env*"` + * - `tagKeys="123456789/env"` + * - `tagKeys:"env"` + * * Use a free text query. Example: + * - `env` + * + * Generated from protobuf field repeated string tag_keys = 23 [deprecated = true]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setTagKeys($var) + { + @trigger_error('tag_keys is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tag_keys = $arr; + + return $this; + } + + /** + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagValue namespaced names, in the format of + * {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + * To search against the `tagValues`: + * * Use a field query. Example: + * - `tagValues:"env"` + * - `tagValues:"env/prod"` + * - `tagValues:"123456789/env/prod*"` + * - `tagValues="123456789/env/prod"` + * * Use a free text query. Example: + * - `prod` + * + * Generated from protobuf field repeated string tag_values = 25 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getTagValues() + { + @trigger_error('tag_values is deprecated.', E_USER_DEPRECATED); + return $this->tag_values; + } + + /** + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagValue namespaced names, in the format of + * {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + * To search against the `tagValues`: + * * Use a field query. Example: + * - `tagValues:"env"` + * - `tagValues:"env/prod"` + * - `tagValues:"123456789/env/prod*"` + * - `tagValues="123456789/env/prod"` + * * Use a free text query. Example: + * - `prod` + * + * Generated from protobuf field repeated string tag_values = 25 [deprecated = true]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setTagValues($var) + { + @trigger_error('tag_values is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tag_values = $arr; + + return $this; + } + + /** + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}. + * To search against the `tagValueIds`: + * * Use a field query. Example: + * - `tagValueIds="tagValues/456"` + * * Use a free text query. Example: + * - `456` + * + * Generated from protobuf field repeated string tag_value_ids = 26 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getTagValueIds() + { + @trigger_error('tag_value_ids is deprecated.', E_USER_DEPRECATED); + return $this->tag_value_ids; + } + + /** + * This field is only present for the purpose of backward compatibility. + * Use the `tags` field instead. + * TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}. + * To search against the `tagValueIds`: + * * Use a field query. Example: + * - `tagValueIds="tagValues/456"` + * * Use a free text query. Example: + * - `456` + * + * Generated from protobuf field repeated string tag_value_ids = 26 [deprecated = true]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setTagValueIds($var) + { + @trigger_error('tag_value_ids is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tag_value_ids = $arr; + + return $this; + } + + /** + * The tags directly attached to this resource. + * To search against the `tags`: + * * Use a field query. Example: + * - `tagKeys:"123456789/env*"` + * - `tagKeys="123456789/env"` + * - `tagKeys:"env"` + * - `tagKeyIds="tagKeys/123"` + * - `tagValues:"env"` + * - `tagValues:"env/prod"` + * - `tagValues:"123456789/env/prod*"` + * - `tagValues="123456789/env/prod"` + * - `tagValueIds="tagValues/456"` + * * Use a free text query. Example: + * - `env/prod` + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Tag tags = 29; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * The tags directly attached to this resource. + * To search against the `tags`: + * * Use a field query. Example: + * - `tagKeys:"123456789/env*"` + * - `tagKeys="123456789/env"` + * - `tagKeys:"env"` + * - `tagKeyIds="tagKeys/123"` + * - `tagValues:"env"` + * - `tagValues:"env/prod"` + * - `tagValues:"123456789/env/prod*"` + * - `tagValues="123456789/env/prod"` + * - `tagValueIds="tagValues/456"` + * * Use a free text query. Example: + * - `env/prod` + * + * Generated from protobuf field repeated .google.cloud.asset.v1.Tag tags = 29; + * @param array<\Google\Cloud\Asset\V1\Tag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\Tag::class); + $this->tags = $arr; + + return $this; + } + + /** + * The effective tags on this resource. All of the tags that are both attached + * to and inherited by a resource are collectively called the effective + * tags. For more information, see [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * To search against the `effective_tags`: + * * Use a field query. Example: + * - `effectiveTagKeys:"123456789/env*"` + * - `effectiveTagKeys="123456789/env"` + * - `effectiveTagKeys:"env"` + * - `effectiveTagKeyIds="tagKeys/123"` + * - `effectiveTagValues:"env"` + * - `effectiveTagValues:"env/prod"` + * - `effectiveTagValues:"123456789/env/prod*"` + * - `effectiveTagValues="123456789/env/prod"` + * - `effectiveTagValueIds="tagValues/456"` + * + * Generated from protobuf field repeated .google.cloud.asset.v1.EffectiveTagDetails effective_tags = 30; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectiveTags() + { + return $this->effective_tags; + } + + /** + * The effective tags on this resource. All of the tags that are both attached + * to and inherited by a resource are collectively called the effective + * tags. For more information, see [tag + * inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + * To search against the `effective_tags`: + * * Use a field query. Example: + * - `effectiveTagKeys:"123456789/env*"` + * - `effectiveTagKeys="123456789/env"` + * - `effectiveTagKeys:"env"` + * - `effectiveTagKeyIds="tagKeys/123"` + * - `effectiveTagValues:"env"` + * - `effectiveTagValues:"env/prod"` + * - `effectiveTagValues:"123456789/env/prod*"` + * - `effectiveTagValues="123456789/env/prod"` + * - `effectiveTagValueIds="tagValues/456"` + * + * Generated from protobuf field repeated .google.cloud.asset.v1.EffectiveTagDetails effective_tags = 30; + * @param array<\Google\Cloud\Asset\V1\EffectiveTagDetails>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectiveTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\EffectiveTagDetails::class); + $this->effective_tags = $arr; + + return $this; + } + + /** + * The type of this resource's immediate parent, if there is one. + * To search against the `parent_asset_type`: + * * Use a field query. Example: + * `parentAssetType:"cloudresourcemanager.googleapis.com/Project"` + * * Use a free text query. Example: + * `cloudresourcemanager.googleapis.com/Project` + * + * Generated from protobuf field string parent_asset_type = 103; + * @return string + */ + public function getParentAssetType() + { + return $this->parent_asset_type; + } + + /** + * The type of this resource's immediate parent, if there is one. + * To search against the `parent_asset_type`: + * * Use a field query. Example: + * `parentAssetType:"cloudresourcemanager.googleapis.com/Project"` + * * Use a free text query. Example: + * `cloudresourcemanager.googleapis.com/Project` + * + * Generated from protobuf field string parent_asset_type = 103; + * @param string $var + * @return $this + */ + public function setParentAssetType($var) + { + GPBUtil::checkString($var, True); + $this->parent_asset_type = $var; + + return $this; + } + + /** + * The actual content of Security Command Center security marks associated + * with the asset. + * To search against SCC SecurityMarks field: + * * Use a field query: + * - query by a given key value pair. Example: `sccSecurityMarks.foo=bar` + * - query by a given key's existence. Example: `sccSecurityMarks.foo:*` + * + * Generated from protobuf field map scc_security_marks = 32; + * @return \Google\Protobuf\Internal\MapField + */ + public function getSccSecurityMarks() + { + return $this->scc_security_marks; + } + + /** + * The actual content of Security Command Center security marks associated + * with the asset. + * To search against SCC SecurityMarks field: + * * Use a field query: + * - query by a given key value pair. Example: `sccSecurityMarks.foo=bar` + * - query by a given key's existence. Example: `sccSecurityMarks.foo:*` + * + * Generated from protobuf field map scc_security_marks = 32; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setSccSecurityMarks($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->scc_security_marks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SavedQuery.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SavedQuery.php new file mode 100644 index 000000000000..3928fe35a45c --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SavedQuery.php @@ -0,0 +1,363 @@ +google.cloud.asset.v1.SavedQuery + */ +class SavedQuery extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the saved query. The format must be: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The description of this saved query. This value should be fewer than 255 + * characters. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Output only. The create time of this saved query. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The account's email address who has created this saved query. + * + * Generated from protobuf field string creator = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $creator = ''; + /** + * Output only. The last update time of this saved query. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_update_time = null; + /** + * Output only. The account's email address who has updated this saved query + * most recently. + * + * Generated from protobuf field string last_updater = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_updater = ''; + /** + * Labels applied on the resource. + * This value should not contain more than 10 entries. The key and value of + * each entry must be non-empty and fewer than 64 characters. + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + /** + * The query content. + * + * Generated from protobuf field .google.cloud.asset.v1.SavedQuery.QueryContent content = 8; + */ + protected $content = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the saved query. The format must be: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @type string $description + * The description of this saved query. This value should be fewer than 255 + * characters. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The create time of this saved query. + * @type string $creator + * Output only. The account's email address who has created this saved query. + * @type \Google\Protobuf\Timestamp $last_update_time + * Output only. The last update time of this saved query. + * @type string $last_updater + * Output only. The account's email address who has updated this saved query + * most recently. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels applied on the resource. + * This value should not contain more than 10 entries. The key and value of + * each entry must be non-empty and fewer than 64 characters. + * @type \Google\Cloud\Asset\V1\SavedQuery\QueryContent $content + * The query content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the saved query. The format must be: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the saved query. The format must be: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The description of this saved query. This value should be fewer than 255 + * characters. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * The description of this saved query. This value should be fewer than 255 + * characters. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The create time of this saved query. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The create time of this saved query. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The account's email address who has created this saved query. + * + * Generated from protobuf field string creator = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCreator() + { + return $this->creator; + } + + /** + * Output only. The account's email address who has created this saved query. + * + * Generated from protobuf field string creator = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCreator($var) + { + GPBUtil::checkString($var, True); + $this->creator = $var; + + return $this; + } + + /** + * Output only. The last update time of this saved query. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastUpdateTime() + { + return $this->last_update_time; + } + + public function hasLastUpdateTime() + { + return isset($this->last_update_time); + } + + public function clearLastUpdateTime() + { + unset($this->last_update_time); + } + + /** + * Output only. The last update time of this saved query. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_update_time = $var; + + return $this; + } + + /** + * Output only. The account's email address who has updated this saved query + * most recently. + * + * Generated from protobuf field string last_updater = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLastUpdater() + { + return $this->last_updater; + } + + /** + * Output only. The account's email address who has updated this saved query + * most recently. + * + * Generated from protobuf field string last_updater = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLastUpdater($var) + { + GPBUtil::checkString($var, True); + $this->last_updater = $var; + + return $this; + } + + /** + * Labels applied on the resource. + * This value should not contain more than 10 entries. The key and value of + * each entry must be non-empty and fewer than 64 characters. + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels applied on the resource. + * This value should not contain more than 10 entries. The key and value of + * each entry must be non-empty and fewer than 64 characters. + * + * Generated from protobuf field map labels = 7; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The query content. + * + * Generated from protobuf field .google.cloud.asset.v1.SavedQuery.QueryContent content = 8; + * @return \Google\Cloud\Asset\V1\SavedQuery\QueryContent|null + */ + public function getContent() + { + return $this->content; + } + + public function hasContent() + { + return isset($this->content); + } + + public function clearContent() + { + unset($this->content); + } + + /** + * The query content. + * + * Generated from protobuf field .google.cloud.asset.v1.SavedQuery.QueryContent content = 8; + * @param \Google\Cloud\Asset\V1\SavedQuery\QueryContent $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\SavedQuery\QueryContent::class); + $this->content = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SavedQuery/QueryContent.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SavedQuery/QueryContent.php new file mode 100644 index 000000000000..f88f91e790a2 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SavedQuery/QueryContent.php @@ -0,0 +1,93 @@ +google.cloud.asset.v1.SavedQuery.QueryContent + */ +class QueryContent extends \Google\Protobuf\Internal\Message +{ + protected $query_content; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery $iam_policy_analysis_query + * An IAM Policy Analysis query, which could be used in + * the + * [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy] + * RPC or the + * [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + * RPC. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * An IAM Policy Analysis query, which could be used in + * the + * [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy] + * RPC or the + * [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + * RPC. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery iam_policy_analysis_query = 1; + * @return \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery|null + */ + public function getIamPolicyAnalysisQuery() + { + return $this->readOneof(1); + } + + public function hasIamPolicyAnalysisQuery() + { + return $this->hasOneof(1); + } + + /** + * An IAM Policy Analysis query, which could be used in + * the + * [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy] + * RPC or the + * [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + * RPC. + * + * Generated from protobuf field .google.cloud.asset.v1.IamPolicyAnalysisQuery iam_policy_analysis_query = 1; + * @param \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery $var + * @return $this + */ + public function setIamPolicyAnalysisQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getQueryContent() + { + return $this->whichOneof("query_content"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QueryContent::class, \Google\Cloud\Asset\V1\SavedQuery_QueryContent::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllIamPoliciesRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllIamPoliciesRequest.php new file mode 100644 index 000000000000..f12c14204e78 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllIamPoliciesRequest.php @@ -0,0 +1,612 @@ +google.cloud.asset.v1.SearchAllIamPoliciesRequest + */ +class SearchAllIamPoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope = ''; + /** + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. Note that the query string is + * compared against each IAM policy binding, including its principals, + * roles, and IAM conditions. The returned IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). + * Examples: + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $query = ''; + /** + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the asset + * types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * Generated from protobuf field repeated string asset_types = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $asset_types; + /** + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not supported. + * + * Generated from protobuf field string order_by = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $scope Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param string $query Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. Note that the query string is + * compared against each IAM policy binding, including its principals, + * roles, and IAM conditions. The returned IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). + * + * Examples: + * + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". + * + * @return \Google\Cloud\Asset\V1\SearchAllIamPoliciesRequest + * + * @experimental + */ + public static function build(string $scope, string $query): self + { + return (new self()) + ->setScope($scope) + ->setQuery($query); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $scope + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @type string $query + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. Note that the query string is + * compared against each IAM policy binding, including its principals, + * roles, and IAM conditions. The returned IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). + * Examples: + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". + * @type int $page_size + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * @type string $page_token + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * @type array|\Google\Protobuf\Internal\RepeatedField $asset_types + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the asset + * types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * @type string $order_by + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + + /** + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. Note that the query string is + * compared against each IAM policy binding, including its principals, + * roles, and IAM conditions. The returned IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). + * Examples: + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. Note that the query string is + * compared against each IAM policy binding, including its principals, + * roles, and IAM conditions. The returned IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). + * Examples: + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the asset + * types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * Generated from protobuf field repeated string asset_types = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssetTypes() + { + return $this->asset_types; + } + + /** + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the asset + * types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * Generated from protobuf field repeated string asset_types = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssetTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->asset_types = $arr; + + return $this; + } + + /** + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not supported. + * + * Generated from protobuf field string order_by = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not supported. + * + * Generated from protobuf field string order_by = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllIamPoliciesResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllIamPoliciesResponse.php new file mode 100644 index 000000000000..c1f4ab0abb2f --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllIamPoliciesResponse.php @@ -0,0 +1,113 @@ +google.cloud.asset.v1.SearchAllIamPoliciesResponse + */ +class SearchAllIamPoliciesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of IAM policies that match the search query. Related information + * such as the associated resource is returned along with the policy. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicySearchResult results = 1; + */ + private $results; + /** + * Set if there are more results than those appearing in this response; to get + * the next set of results, call this method again, using this value as the + * `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\IamPolicySearchResult>|\Google\Protobuf\Internal\RepeatedField $results + * A list of IAM policies that match the search query. Related information + * such as the associated resource is returned along with the policy. + * @type string $next_page_token + * Set if there are more results than those appearing in this response; to get + * the next set of results, call this method again, using this value as the + * `page_token`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * A list of IAM policies that match the search query. Related information + * such as the associated resource is returned along with the policy. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicySearchResult results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResults() + { + return $this->results; + } + + /** + * A list of IAM policies that match the search query. Related information + * such as the associated resource is returned along with the policy. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.IamPolicySearchResult results = 1; + * @param array<\Google\Cloud\Asset\V1\IamPolicySearchResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\IamPolicySearchResult::class); + $this->results = $arr; + + return $this; + } + + /** + * Set if there are more results than those appearing in this response; to get + * the next set of results, call this method again, using this value as the + * `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Set if there are more results than those appearing in this response; to get + * the next set of results, call this method again, using this value as the + * `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllResourcesRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllResourcesRequest.php new file mode 100644 index 000000000000..700bd3911bd3 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllResourcesRequest.php @@ -0,0 +1,985 @@ +google.cloud.asset.v1.SearchAllResourcesRequest + */ +class SearchAllResourcesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope = ''; + /** + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. + * Examples: + * * `name:Important` to find Google Cloud resources whose name contains + * `Important` as a word. + * * `name=Important` to find the Google Cloud resource whose name is exactly + * `Important`. + * * `displayName:Impor*` to find Google Cloud resources whose display name + * contains `Impor` as a prefix of any word in the field. + * * `location:us-west*` to find Google Cloud resources whose location + * contains both `us` and `west` as prefixes. + * * `labels:prod` to find Google Cloud resources whose labels contain `prod` + * as a key or value. + * * `labels.env:prod` to find Google Cloud resources that have a label `env` + * and its value is `prod`. + * * `labels.env:*` to find Google Cloud resources that have a label `env`. + * * `tagKeys:env` to find Google Cloud resources that have directly + * attached tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `tagValues:prod*` to find Google Cloud resources that have directly + * attached tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `tagValueIds=tagValues/123` to find Google Cloud resources that have + * directly attached tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `effectiveTagKeys:env` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `effectiveTagValues:prod*` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that + * have directly attached or inherited tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `kmsKey:key` to find Google Cloud resources encrypted with a + * customer-managed encryption key whose name contains `key` as a word. This + * field is deprecated. Use the `kmsKeys` field to retrieve Cloud KMS + * key information. + * * `kmsKeys:key` to find Google Cloud resources encrypted with + * customer-managed encryption keys whose name contains the word `key`. + * * `relationships:instance-group-1` to find Google Cloud resources that have + * relationships with `instance-group-1` in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine + * instances that have relationships of type `INSTANCE_TO_INSTANCEGROUP`. + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * Compute Engine instances that have relationships with `instance-group-1` + * in the Compute Engine instance group resource name, for relationship type + * `INSTANCE_TO_INSTANCEGROUP`. + * * `sccSecurityMarks.key=value` to find Cloud resources that are attached + * with security marks whose key is `key` and value is `value`. + * * `sccSecurityMarks.key:*` to find Cloud resources that are attached with + * security marks whose key is `key`. + * * `state:ACTIVE` to find Google Cloud resources whose state contains + * `ACTIVE` as a word. + * * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't + * contain `ACTIVE` as a word. + * * `createTime<1609459200` to find Google Cloud resources that were created + * before `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `updateTime>1609459200` to find Google Cloud resources that were updated + * after `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `Important` to find Google Cloud resources that contain `Important` as a + * word in any of the searchable fields. + * * `Impor*` to find Google Cloud resources that contain `Impor` as a prefix + * of any word in any of the searchable fields. + * * `Important location:(us-west1 OR global)` to find Google Cloud + * resources that contain `Important` as a word in any of the searchable + * fields and are also located in the `us-west1` region or the `global` + * location. + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $query = ''; + /** + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * Generated from protobuf field repeated string asset_types = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $asset_types; + /** + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". + * Only the following fields in the response are sortable: + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. A comma-separated list of fields that you want returned in the + * results. The following fields are returned by default if not specified: + * * `name` + * * `assetType` + * * `project` + * * `folders` + * * `organization` + * * `displayName` + * * `description` + * * `location` + * * `labels` + * * `tags` + * * `effectiveTags` + * * `networkTags` + * * `kmsKeys` + * * `createTime` + * * `updateTime` + * * `state` + * * `additionalAttributes` + * * `parentFullResourceName` + * * `parentAssetType` + * Some fields of large size, such as `versionedResources`, + * `attachedResources`, `effectiveTags` etc., are not returned by default, but + * you can specify them in the `read_mask` parameter if you want to include + * them. If `"*"` is specified, all [available + * fields](https://cloud.google.com/asset-inventory/docs/reference/rest/v1/TopLevel/searchAllResources#resourcesearchresult) + * are returned. + * Examples: `"name,location"`, `"name,versionedResources"`, `"*"`. + * Any invalid field path will trigger INVALID_ARGUMENT error. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $read_mask = null; + + /** + * @param string $scope Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param string $query Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. + * + * Examples: + * + * * `name:Important` to find Google Cloud resources whose name contains + * `Important` as a word. + * * `name=Important` to find the Google Cloud resource whose name is exactly + * `Important`. + * * `displayName:Impor*` to find Google Cloud resources whose display name + * contains `Impor` as a prefix of any word in the field. + * * `location:us-west*` to find Google Cloud resources whose location + * contains both `us` and `west` as prefixes. + * * `labels:prod` to find Google Cloud resources whose labels contain `prod` + * as a key or value. + * * `labels.env:prod` to find Google Cloud resources that have a label `env` + * and its value is `prod`. + * * `labels.env:*` to find Google Cloud resources that have a label `env`. + * * `tagKeys:env` to find Google Cloud resources that have directly + * attached tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `tagValues:prod*` to find Google Cloud resources that have directly + * attached tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `tagValueIds=tagValues/123` to find Google Cloud resources that have + * directly attached tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `effectiveTagKeys:env` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `effectiveTagValues:prod*` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that + * have directly attached or inherited tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `kmsKey:key` to find Google Cloud resources encrypted with a + * customer-managed encryption key whose name contains `key` as a word. This + * field is deprecated. Use the `kmsKeys` field to retrieve Cloud KMS + * key information. + * * `kmsKeys:key` to find Google Cloud resources encrypted with + * customer-managed encryption keys whose name contains the word `key`. + * * `relationships:instance-group-1` to find Google Cloud resources that have + * relationships with `instance-group-1` in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine + * instances that have relationships of type `INSTANCE_TO_INSTANCEGROUP`. + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * Compute Engine instances that have relationships with `instance-group-1` + * in the Compute Engine instance group resource name, for relationship type + * `INSTANCE_TO_INSTANCEGROUP`. + * * `sccSecurityMarks.key=value` to find Cloud resources that are attached + * with security marks whose key is `key` and value is `value`. + * * `sccSecurityMarks.key:*` to find Cloud resources that are attached with + * security marks whose key is `key`. + * * `state:ACTIVE` to find Google Cloud resources whose state contains + * `ACTIVE` as a word. + * * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't + * contain `ACTIVE` as a word. + * * `createTime<1609459200` to find Google Cloud resources that were created + * before `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `updateTime>1609459200` to find Google Cloud resources that were updated + * after `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `Important` to find Google Cloud resources that contain `Important` as a + * word in any of the searchable fields. + * * `Impor*` to find Google Cloud resources that contain `Impor` as a prefix + * of any word in any of the searchable fields. + * * `Important location:(us-west1 OR global)` to find Google Cloud + * resources that contain `Important` as a word in any of the searchable + * fields and are also located in the `us-west1` region or the `global` + * location. + * @param string[] $assetTypes Optional. A list of asset types that this request searches for. If empty, + * it will search all the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * @return \Google\Cloud\Asset\V1\SearchAllResourcesRequest + * + * @experimental + */ + public static function build(string $scope, string $query, array $assetTypes): self + { + return (new self()) + ->setScope($scope) + ->setQuery($query) + ->setAssetTypes($assetTypes); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $scope + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @type string $query + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. + * Examples: + * * `name:Important` to find Google Cloud resources whose name contains + * `Important` as a word. + * * `name=Important` to find the Google Cloud resource whose name is exactly + * `Important`. + * * `displayName:Impor*` to find Google Cloud resources whose display name + * contains `Impor` as a prefix of any word in the field. + * * `location:us-west*` to find Google Cloud resources whose location + * contains both `us` and `west` as prefixes. + * * `labels:prod` to find Google Cloud resources whose labels contain `prod` + * as a key or value. + * * `labels.env:prod` to find Google Cloud resources that have a label `env` + * and its value is `prod`. + * * `labels.env:*` to find Google Cloud resources that have a label `env`. + * * `tagKeys:env` to find Google Cloud resources that have directly + * attached tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `tagValues:prod*` to find Google Cloud resources that have directly + * attached tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `tagValueIds=tagValues/123` to find Google Cloud resources that have + * directly attached tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `effectiveTagKeys:env` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `effectiveTagValues:prod*` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that + * have directly attached or inherited tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `kmsKey:key` to find Google Cloud resources encrypted with a + * customer-managed encryption key whose name contains `key` as a word. This + * field is deprecated. Use the `kmsKeys` field to retrieve Cloud KMS + * key information. + * * `kmsKeys:key` to find Google Cloud resources encrypted with + * customer-managed encryption keys whose name contains the word `key`. + * * `relationships:instance-group-1` to find Google Cloud resources that have + * relationships with `instance-group-1` in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine + * instances that have relationships of type `INSTANCE_TO_INSTANCEGROUP`. + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * Compute Engine instances that have relationships with `instance-group-1` + * in the Compute Engine instance group resource name, for relationship type + * `INSTANCE_TO_INSTANCEGROUP`. + * * `sccSecurityMarks.key=value` to find Cloud resources that are attached + * with security marks whose key is `key` and value is `value`. + * * `sccSecurityMarks.key:*` to find Cloud resources that are attached with + * security marks whose key is `key`. + * * `state:ACTIVE` to find Google Cloud resources whose state contains + * `ACTIVE` as a word. + * * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't + * contain `ACTIVE` as a word. + * * `createTime<1609459200` to find Google Cloud resources that were created + * before `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `updateTime>1609459200` to find Google Cloud resources that were updated + * after `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `Important` to find Google Cloud resources that contain `Important` as a + * word in any of the searchable fields. + * * `Impor*` to find Google Cloud resources that contain `Impor` as a prefix + * of any word in any of the searchable fields. + * * `Important location:(us-west1 OR global)` to find Google Cloud + * resources that contain `Important` as a word in any of the searchable + * fields and are also located in the `us-west1` region or the `global` + * location. + * @type array|\Google\Protobuf\Internal\RepeatedField $asset_types + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * @type int $page_size + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * @type string $page_token + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * @type string $order_by + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". + * Only the following fields in the response are sortable: + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + * @type \Google\Protobuf\FieldMask $read_mask + * Optional. A comma-separated list of fields that you want returned in the + * results. The following fields are returned by default if not specified: + * * `name` + * * `assetType` + * * `project` + * * `folders` + * * `organization` + * * `displayName` + * * `description` + * * `location` + * * `labels` + * * `tags` + * * `effectiveTags` + * * `networkTags` + * * `kmsKeys` + * * `createTime` + * * `updateTime` + * * `state` + * * `additionalAttributes` + * * `parentFullResourceName` + * * `parentAssetType` + * Some fields of large size, such as `versionedResources`, + * `attachedResources`, `effectiveTags` etc., are not returned by default, but + * you can specify them in the `read_mask` parameter if you want to include + * them. If `"*"` is specified, all [available + * fields](https://cloud.google.com/asset-inventory/docs/reference/rest/v1/TopLevel/searchAllResources#resourcesearchresult) + * are returned. + * Examples: `"name,location"`, `"name,versionedResources"`, `"*"`. + * Any invalid field path will trigger INVALID_ARGUMENT error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * + * Generated from protobuf field string scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + + /** + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. + * Examples: + * * `name:Important` to find Google Cloud resources whose name contains + * `Important` as a word. + * * `name=Important` to find the Google Cloud resource whose name is exactly + * `Important`. + * * `displayName:Impor*` to find Google Cloud resources whose display name + * contains `Impor` as a prefix of any word in the field. + * * `location:us-west*` to find Google Cloud resources whose location + * contains both `us` and `west` as prefixes. + * * `labels:prod` to find Google Cloud resources whose labels contain `prod` + * as a key or value. + * * `labels.env:prod` to find Google Cloud resources that have a label `env` + * and its value is `prod`. + * * `labels.env:*` to find Google Cloud resources that have a label `env`. + * * `tagKeys:env` to find Google Cloud resources that have directly + * attached tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `tagValues:prod*` to find Google Cloud resources that have directly + * attached tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `tagValueIds=tagValues/123` to find Google Cloud resources that have + * directly attached tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `effectiveTagKeys:env` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `effectiveTagValues:prod*` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that + * have directly attached or inherited tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `kmsKey:key` to find Google Cloud resources encrypted with a + * customer-managed encryption key whose name contains `key` as a word. This + * field is deprecated. Use the `kmsKeys` field to retrieve Cloud KMS + * key information. + * * `kmsKeys:key` to find Google Cloud resources encrypted with + * customer-managed encryption keys whose name contains the word `key`. + * * `relationships:instance-group-1` to find Google Cloud resources that have + * relationships with `instance-group-1` in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine + * instances that have relationships of type `INSTANCE_TO_INSTANCEGROUP`. + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * Compute Engine instances that have relationships with `instance-group-1` + * in the Compute Engine instance group resource name, for relationship type + * `INSTANCE_TO_INSTANCEGROUP`. + * * `sccSecurityMarks.key=value` to find Cloud resources that are attached + * with security marks whose key is `key` and value is `value`. + * * `sccSecurityMarks.key:*` to find Cloud resources that are attached with + * security marks whose key is `key`. + * * `state:ACTIVE` to find Google Cloud resources whose state contains + * `ACTIVE` as a word. + * * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't + * contain `ACTIVE` as a word. + * * `createTime<1609459200` to find Google Cloud resources that were created + * before `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `updateTime>1609459200` to find Google Cloud resources that were updated + * after `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `Important` to find Google Cloud resources that contain `Important` as a + * word in any of the searchable fields. + * * `Impor*` to find Google Cloud resources that contain `Impor` as a prefix + * of any word in any of the searchable fields. + * * `Important location:(us-west1 OR global)` to find Google Cloud + * resources that contain `Important` as a word in any of the searchable + * fields and are also located in the `us-west1` region or the `global` + * location. + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. + * Examples: + * * `name:Important` to find Google Cloud resources whose name contains + * `Important` as a word. + * * `name=Important` to find the Google Cloud resource whose name is exactly + * `Important`. + * * `displayName:Impor*` to find Google Cloud resources whose display name + * contains `Impor` as a prefix of any word in the field. + * * `location:us-west*` to find Google Cloud resources whose location + * contains both `us` and `west` as prefixes. + * * `labels:prod` to find Google Cloud resources whose labels contain `prod` + * as a key or value. + * * `labels.env:prod` to find Google Cloud resources that have a label `env` + * and its value is `prod`. + * * `labels.env:*` to find Google Cloud resources that have a label `env`. + * * `tagKeys:env` to find Google Cloud resources that have directly + * attached tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `tagValues:prod*` to find Google Cloud resources that have directly + * attached tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `tagValueIds=tagValues/123` to find Google Cloud resources that have + * directly attached tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `effectiveTagKeys:env` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `effectiveTagValues:prod*` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that + * have directly attached or inherited tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `kmsKey:key` to find Google Cloud resources encrypted with a + * customer-managed encryption key whose name contains `key` as a word. This + * field is deprecated. Use the `kmsKeys` field to retrieve Cloud KMS + * key information. + * * `kmsKeys:key` to find Google Cloud resources encrypted with + * customer-managed encryption keys whose name contains the word `key`. + * * `relationships:instance-group-1` to find Google Cloud resources that have + * relationships with `instance-group-1` in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine + * instances that have relationships of type `INSTANCE_TO_INSTANCEGROUP`. + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * Compute Engine instances that have relationships with `instance-group-1` + * in the Compute Engine instance group resource name, for relationship type + * `INSTANCE_TO_INSTANCEGROUP`. + * * `sccSecurityMarks.key=value` to find Cloud resources that are attached + * with security marks whose key is `key` and value is `value`. + * * `sccSecurityMarks.key:*` to find Cloud resources that are attached with + * security marks whose key is `key`. + * * `state:ACTIVE` to find Google Cloud resources whose state contains + * `ACTIVE` as a word. + * * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't + * contain `ACTIVE` as a word. + * * `createTime<1609459200` to find Google Cloud resources that were created + * before `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `updateTime>1609459200` to find Google Cloud resources that were updated + * after `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `Important` to find Google Cloud resources that contain `Important` as a + * word in any of the searchable fields. + * * `Impor*` to find Google Cloud resources that contain `Impor` as a prefix + * of any word in any of the searchable fields. + * * `Important location:(us-west1 OR global)` to find Google Cloud + * resources that contain `Important` as a word in any of the searchable + * fields and are also located in the `us-west1` region or the `global` + * location. + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * Generated from protobuf field repeated string asset_types = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssetTypes() + { + return $this->asset_types; + } + + /** + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * Generated from protobuf field repeated string asset_types = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssetTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->asset_types = $arr; + + return $this; + } + + /** + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". + * Only the following fields in the response are sortable: + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". + * Only the following fields in the response are sortable: + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. A comma-separated list of fields that you want returned in the + * results. The following fields are returned by default if not specified: + * * `name` + * * `assetType` + * * `project` + * * `folders` + * * `organization` + * * `displayName` + * * `description` + * * `location` + * * `labels` + * * `tags` + * * `effectiveTags` + * * `networkTags` + * * `kmsKeys` + * * `createTime` + * * `updateTime` + * * `state` + * * `additionalAttributes` + * * `parentFullResourceName` + * * `parentAssetType` + * Some fields of large size, such as `versionedResources`, + * `attachedResources`, `effectiveTags` etc., are not returned by default, but + * you can specify them in the `read_mask` parameter if you want to include + * them. If `"*"` is specified, all [available + * fields](https://cloud.google.com/asset-inventory/docs/reference/rest/v1/TopLevel/searchAllResources#resourcesearchresult) + * are returned. + * Examples: `"name,location"`, `"name,versionedResources"`, `"*"`. + * Any invalid field path will trigger INVALID_ARGUMENT error. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getReadMask() + { + return $this->read_mask; + } + + public function hasReadMask() + { + return isset($this->read_mask); + } + + public function clearReadMask() + { + unset($this->read_mask); + } + + /** + * Optional. A comma-separated list of fields that you want returned in the + * results. The following fields are returned by default if not specified: + * * `name` + * * `assetType` + * * `project` + * * `folders` + * * `organization` + * * `displayName` + * * `description` + * * `location` + * * `labels` + * * `tags` + * * `effectiveTags` + * * `networkTags` + * * `kmsKeys` + * * `createTime` + * * `updateTime` + * * `state` + * * `additionalAttributes` + * * `parentFullResourceName` + * * `parentAssetType` + * Some fields of large size, such as `versionedResources`, + * `attachedResources`, `effectiveTags` etc., are not returned by default, but + * you can specify them in the `read_mask` parameter if you want to include + * them. If `"*"` is specified, all [available + * fields](https://cloud.google.com/asset-inventory/docs/reference/rest/v1/TopLevel/searchAllResources#resourcesearchresult) + * are returned. + * Examples: `"name,location"`, `"name,versionedResources"`, `"*"`. + * Any invalid field path will trigger INVALID_ARGUMENT error. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setReadMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->read_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllResourcesResponse.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllResourcesResponse.php new file mode 100644 index 000000000000..7cdfc2756d4d --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/SearchAllResourcesResponse.php @@ -0,0 +1,113 @@ +google.cloud.asset.v1.SearchAllResourcesResponse + */ +class SearchAllResourcesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of Resources that match the search query. It contains the resource + * standard metadata information. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.ResourceSearchResult results = 1; + */ + private $results; + /** + * If there are more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\ResourceSearchResult>|\Google\Protobuf\Internal\RepeatedField $results + * A list of Resources that match the search query. It contains the resource + * standard metadata information. + * @type string $next_page_token + * If there are more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * A list of Resources that match the search query. It contains the resource + * standard metadata information. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.ResourceSearchResult results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResults() + { + return $this->results; + } + + /** + * A list of Resources that match the search query. It contains the resource + * standard metadata information. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.ResourceSearchResult results = 1; + * @param array<\Google\Cloud\Asset\V1\ResourceSearchResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\ResourceSearchResult::class); + $this->results = $arr; + + return $this; + } + + /** + * If there are more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there are more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TableFieldSchema.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TableFieldSchema.php new file mode 100644 index 000000000000..16e9d9f4bf28 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TableFieldSchema.php @@ -0,0 +1,241 @@ +google.cloud.asset.v1.TableFieldSchema + */ +class TableFieldSchema extends \Google\Protobuf\Internal\Message +{ + /** + * The field name. The name must contain only letters (a-z, A-Z), + * numbers (0-9), or underscores (_), and must start with a letter or + * underscore. The maximum length is 128 characters. + * + * Generated from protobuf field string field = 1; + */ + protected $field = ''; + /** + * The field data type. Possible values include + * * STRING + * * BYTES + * * INTEGER + * * FLOAT + * * BOOLEAN + * * TIMESTAMP + * * DATE + * * TIME + * * DATETIME + * * GEOGRAPHY, + * * NUMERIC, + * * BIGNUMERIC, + * * RECORD + * (where RECORD indicates that the field contains a nested schema). + * + * Generated from protobuf field string type = 2; + */ + protected $type = ''; + /** + * The field mode. Possible values include NULLABLE, REQUIRED and + * REPEATED. The default value is NULLABLE. + * + * Generated from protobuf field string mode = 3; + */ + protected $mode = ''; + /** + * Describes the nested schema fields if the type property is set + * to RECORD. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.TableFieldSchema fields = 4; + */ + private $fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field + * The field name. The name must contain only letters (a-z, A-Z), + * numbers (0-9), or underscores (_), and must start with a letter or + * underscore. The maximum length is 128 characters. + * @type string $type + * The field data type. Possible values include + * * STRING + * * BYTES + * * INTEGER + * * FLOAT + * * BOOLEAN + * * TIMESTAMP + * * DATE + * * TIME + * * DATETIME + * * GEOGRAPHY, + * * NUMERIC, + * * BIGNUMERIC, + * * RECORD + * (where RECORD indicates that the field contains a nested schema). + * @type string $mode + * The field mode. Possible values include NULLABLE, REQUIRED and + * REPEATED. The default value is NULLABLE. + * @type array<\Google\Cloud\Asset\V1\TableFieldSchema>|\Google\Protobuf\Internal\RepeatedField $fields + * Describes the nested schema fields if the type property is set + * to RECORD. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * The field name. The name must contain only letters (a-z, A-Z), + * numbers (0-9), or underscores (_), and must start with a letter or + * underscore. The maximum length is 128 characters. + * + * Generated from protobuf field string field = 1; + * @return string + */ + public function getField() + { + return $this->field; + } + + /** + * The field name. The name must contain only letters (a-z, A-Z), + * numbers (0-9), or underscores (_), and must start with a letter or + * underscore. The maximum length is 128 characters. + * + * Generated from protobuf field string field = 1; + * @param string $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkString($var, True); + $this->field = $var; + + return $this; + } + + /** + * The field data type. Possible values include + * * STRING + * * BYTES + * * INTEGER + * * FLOAT + * * BOOLEAN + * * TIMESTAMP + * * DATE + * * TIME + * * DATETIME + * * GEOGRAPHY, + * * NUMERIC, + * * BIGNUMERIC, + * * RECORD + * (where RECORD indicates that the field contains a nested schema). + * + * Generated from protobuf field string type = 2; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The field data type. Possible values include + * * STRING + * * BYTES + * * INTEGER + * * FLOAT + * * BOOLEAN + * * TIMESTAMP + * * DATE + * * TIME + * * DATETIME + * * GEOGRAPHY, + * * NUMERIC, + * * BIGNUMERIC, + * * RECORD + * (where RECORD indicates that the field contains a nested schema). + * + * Generated from protobuf field string type = 2; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The field mode. Possible values include NULLABLE, REQUIRED and + * REPEATED. The default value is NULLABLE. + * + * Generated from protobuf field string mode = 3; + * @return string + */ + public function getMode() + { + return $this->mode; + } + + /** + * The field mode. Possible values include NULLABLE, REQUIRED and + * REPEATED. The default value is NULLABLE. + * + * Generated from protobuf field string mode = 3; + * @param string $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkString($var, True); + $this->mode = $var; + + return $this; + } + + /** + * Describes the nested schema fields if the type property is set + * to RECORD. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.TableFieldSchema fields = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * Describes the nested schema fields if the type property is set + * to RECORD. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.TableFieldSchema fields = 4; + * @param array<\Google\Cloud\Asset\V1\TableFieldSchema>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\TableFieldSchema::class); + $this->fields = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TableSchema.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TableSchema.php new file mode 100644 index 000000000000..b987755cd551 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TableSchema.php @@ -0,0 +1,67 @@ +google.cloud.asset.v1.TableSchema + */ +class TableSchema extends \Google\Protobuf\Internal\Message +{ + /** + * Describes the fields in a table. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.TableFieldSchema fields = 1; + */ + private $fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Asset\V1\TableFieldSchema>|\Google\Protobuf\Internal\RepeatedField $fields + * Describes the fields in a table. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Describes the fields in a table. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.TableFieldSchema fields = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * Describes the fields in a table. + * + * Generated from protobuf field repeated .google.cloud.asset.v1.TableFieldSchema fields = 1; + * @param array<\Google\Cloud\Asset\V1\TableFieldSchema>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\TableFieldSchema::class); + $this->fields = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Tag.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Tag.php new file mode 100644 index 000000000000..63be120eea87 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/Tag.php @@ -0,0 +1,214 @@ +google.cloud.asset.v1.Tag + */ +class Tag extends \Google\Protobuf\Internal\Message +{ + /** + * TagKey namespaced name, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + * + * Generated from protobuf field optional string tag_key = 1; + */ + protected $tag_key = null; + /** + * TagKey ID, in the format of tagKeys/{TAG_KEY_ID}. + * + * Generated from protobuf field optional string tag_key_id = 2; + */ + protected $tag_key_id = null; + /** + * TagValue namespaced name, in the format of + * {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + * + * Generated from protobuf field optional string tag_value = 3; + */ + protected $tag_value = null; + /** + * TagValue ID, in the format of tagValues/{TAG_VALUE_ID}. + * + * Generated from protobuf field optional string tag_value_id = 4; + */ + protected $tag_value_id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $tag_key + * TagKey namespaced name, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + * @type string $tag_key_id + * TagKey ID, in the format of tagKeys/{TAG_KEY_ID}. + * @type string $tag_value + * TagValue namespaced name, in the format of + * {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + * @type string $tag_value_id + * TagValue ID, in the format of tagValues/{TAG_VALUE_ID}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * TagKey namespaced name, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + * + * Generated from protobuf field optional string tag_key = 1; + * @return string + */ + public function getTagKey() + { + return isset($this->tag_key) ? $this->tag_key : ''; + } + + public function hasTagKey() + { + return isset($this->tag_key); + } + + public function clearTagKey() + { + unset($this->tag_key); + } + + /** + * TagKey namespaced name, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + * + * Generated from protobuf field optional string tag_key = 1; + * @param string $var + * @return $this + */ + public function setTagKey($var) + { + GPBUtil::checkString($var, True); + $this->tag_key = $var; + + return $this; + } + + /** + * TagKey ID, in the format of tagKeys/{TAG_KEY_ID}. + * + * Generated from protobuf field optional string tag_key_id = 2; + * @return string + */ + public function getTagKeyId() + { + return isset($this->tag_key_id) ? $this->tag_key_id : ''; + } + + public function hasTagKeyId() + { + return isset($this->tag_key_id); + } + + public function clearTagKeyId() + { + unset($this->tag_key_id); + } + + /** + * TagKey ID, in the format of tagKeys/{TAG_KEY_ID}. + * + * Generated from protobuf field optional string tag_key_id = 2; + * @param string $var + * @return $this + */ + public function setTagKeyId($var) + { + GPBUtil::checkString($var, True); + $this->tag_key_id = $var; + + return $this; + } + + /** + * TagValue namespaced name, in the format of + * {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + * + * Generated from protobuf field optional string tag_value = 3; + * @return string + */ + public function getTagValue() + { + return isset($this->tag_value) ? $this->tag_value : ''; + } + + public function hasTagValue() + { + return isset($this->tag_value); + } + + public function clearTagValue() + { + unset($this->tag_value); + } + + /** + * TagValue namespaced name, in the format of + * {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + * + * Generated from protobuf field optional string tag_value = 3; + * @param string $var + * @return $this + */ + public function setTagValue($var) + { + GPBUtil::checkString($var, True); + $this->tag_value = $var; + + return $this; + } + + /** + * TagValue ID, in the format of tagValues/{TAG_VALUE_ID}. + * + * Generated from protobuf field optional string tag_value_id = 4; + * @return string + */ + public function getTagValueId() + { + return isset($this->tag_value_id) ? $this->tag_value_id : ''; + } + + public function hasTagValueId() + { + return isset($this->tag_value_id); + } + + public function clearTagValueId() + { + unset($this->tag_value_id); + } + + /** + * TagValue ID, in the format of tagValues/{TAG_VALUE_ID}. + * + * Generated from protobuf field optional string tag_value_id = 4; + * @param string $var + * @return $this + */ + public function setTagValueId($var) + { + GPBUtil::checkString($var, True); + $this->tag_value_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TemporalAsset.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TemporalAsset.php new file mode 100644 index 000000000000..b3996645ed09 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TemporalAsset.php @@ -0,0 +1,238 @@ +google.cloud.asset.v1.TemporalAsset + */ +class TemporalAsset extends \Google\Protobuf\Internal\Message +{ + /** + * The time window when the asset data and state was observed. + * + * Generated from protobuf field .google.cloud.asset.v1.TimeWindow window = 1; + */ + protected $window = null; + /** + * Whether the asset has been deleted or not. + * + * Generated from protobuf field bool deleted = 2; + */ + protected $deleted = false; + /** + * An asset in Google Cloud. + * + * Generated from protobuf field .google.cloud.asset.v1.Asset asset = 3; + */ + protected $asset = null; + /** + * State of prior_asset. + * + * Generated from protobuf field .google.cloud.asset.v1.TemporalAsset.PriorAssetState prior_asset_state = 4; + */ + protected $prior_asset_state = 0; + /** + * Prior copy of the asset. Populated if prior_asset_state is PRESENT. + * Currently this is only set for responses in Real-Time Feed. + * + * Generated from protobuf field .google.cloud.asset.v1.Asset prior_asset = 5; + */ + protected $prior_asset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\TimeWindow $window + * The time window when the asset data and state was observed. + * @type bool $deleted + * Whether the asset has been deleted or not. + * @type \Google\Cloud\Asset\V1\Asset $asset + * An asset in Google Cloud. + * @type int $prior_asset_state + * State of prior_asset. + * @type \Google\Cloud\Asset\V1\Asset $prior_asset + * Prior copy of the asset. Populated if prior_asset_state is PRESENT. + * Currently this is only set for responses in Real-Time Feed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * The time window when the asset data and state was observed. + * + * Generated from protobuf field .google.cloud.asset.v1.TimeWindow window = 1; + * @return \Google\Cloud\Asset\V1\TimeWindow|null + */ + public function getWindow() + { + return $this->window; + } + + public function hasWindow() + { + return isset($this->window); + } + + public function clearWindow() + { + unset($this->window); + } + + /** + * The time window when the asset data and state was observed. + * + * Generated from protobuf field .google.cloud.asset.v1.TimeWindow window = 1; + * @param \Google\Cloud\Asset\V1\TimeWindow $var + * @return $this + */ + public function setWindow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\TimeWindow::class); + $this->window = $var; + + return $this; + } + + /** + * Whether the asset has been deleted or not. + * + * Generated from protobuf field bool deleted = 2; + * @return bool + */ + public function getDeleted() + { + return $this->deleted; + } + + /** + * Whether the asset has been deleted or not. + * + * Generated from protobuf field bool deleted = 2; + * @param bool $var + * @return $this + */ + public function setDeleted($var) + { + GPBUtil::checkBool($var); + $this->deleted = $var; + + return $this; + } + + /** + * An asset in Google Cloud. + * + * Generated from protobuf field .google.cloud.asset.v1.Asset asset = 3; + * @return \Google\Cloud\Asset\V1\Asset|null + */ + public function getAsset() + { + return $this->asset; + } + + public function hasAsset() + { + return isset($this->asset); + } + + public function clearAsset() + { + unset($this->asset); + } + + /** + * An asset in Google Cloud. + * + * Generated from protobuf field .google.cloud.asset.v1.Asset asset = 3; + * @param \Google\Cloud\Asset\V1\Asset $var + * @return $this + */ + public function setAsset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\Asset::class); + $this->asset = $var; + + return $this; + } + + /** + * State of prior_asset. + * + * Generated from protobuf field .google.cloud.asset.v1.TemporalAsset.PriorAssetState prior_asset_state = 4; + * @return int + */ + public function getPriorAssetState() + { + return $this->prior_asset_state; + } + + /** + * State of prior_asset. + * + * Generated from protobuf field .google.cloud.asset.v1.TemporalAsset.PriorAssetState prior_asset_state = 4; + * @param int $var + * @return $this + */ + public function setPriorAssetState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Asset\V1\TemporalAsset\PriorAssetState::class); + $this->prior_asset_state = $var; + + return $this; + } + + /** + * Prior copy of the asset. Populated if prior_asset_state is PRESENT. + * Currently this is only set for responses in Real-Time Feed. + * + * Generated from protobuf field .google.cloud.asset.v1.Asset prior_asset = 5; + * @return \Google\Cloud\Asset\V1\Asset|null + */ + public function getPriorAsset() + { + return $this->prior_asset; + } + + public function hasPriorAsset() + { + return isset($this->prior_asset); + } + + public function clearPriorAsset() + { + unset($this->prior_asset); + } + + /** + * Prior copy of the asset. Populated if prior_asset_state is PRESENT. + * Currently this is only set for responses in Real-Time Feed. + * + * Generated from protobuf field .google.cloud.asset.v1.Asset prior_asset = 5; + * @param \Google\Cloud\Asset\V1\Asset $var + * @return $this + */ + public function setPriorAsset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\Asset::class); + $this->prior_asset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TemporalAsset/PriorAssetState.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TemporalAsset/PriorAssetState.php new file mode 100644 index 000000000000..f20c1d628b9c --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TemporalAsset/PriorAssetState.php @@ -0,0 +1,78 @@ +google.cloud.asset.v1.TemporalAsset.PriorAssetState + */ +class PriorAssetState +{ + /** + * prior_asset is not applicable for the current asset. + * + * Generated from protobuf enum PRIOR_ASSET_STATE_UNSPECIFIED = 0; + */ + const PRIOR_ASSET_STATE_UNSPECIFIED = 0; + /** + * prior_asset is populated correctly. + * + * Generated from protobuf enum PRESENT = 1; + */ + const PRESENT = 1; + /** + * Failed to set prior_asset. + * + * Generated from protobuf enum INVALID = 2; + */ + const INVALID = 2; + /** + * Current asset is the first known state. + * + * Generated from protobuf enum DOES_NOT_EXIST = 3; + */ + const DOES_NOT_EXIST = 3; + /** + * prior_asset is a deletion. + * + * Generated from protobuf enum DELETED = 4; + */ + const DELETED = 4; + + private static $valueToName = [ + self::PRIOR_ASSET_STATE_UNSPECIFIED => 'PRIOR_ASSET_STATE_UNSPECIFIED', + self::PRESENT => 'PRESENT', + self::INVALID => 'INVALID', + self::DOES_NOT_EXIST => 'DOES_NOT_EXIST', + self::DELETED => 'DELETED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PriorAssetState::class, \Google\Cloud\Asset\V1\TemporalAsset_PriorAssetState::class); + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TimeWindow.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TimeWindow.php new file mode 100644 index 000000000000..ddaa9aebfee5 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/TimeWindow.php @@ -0,0 +1,125 @@ +google.cloud.asset.v1.TimeWindow + */ +class TimeWindow extends \Google\Protobuf\Internal\Message +{ + /** + * Start time of the time window (exclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * End time of the time window (inclusive). If not specified, the current + * timestamp is used instead. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Start time of the time window (exclusive). + * @type \Google\Protobuf\Timestamp $end_time + * End time of the time window (inclusive). If not specified, the current + * timestamp is used instead. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * Start time of the time window (exclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Start time of the time window (exclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * End time of the time window (inclusive). If not specified, the current + * timestamp is used instead. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * End time of the time window (inclusive). If not specified, the current + * timestamp is used instead. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/UpdateFeedRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/UpdateFeedRequest.php new file mode 100644 index 000000000000..484371b1a06b --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/UpdateFeedRequest.php @@ -0,0 +1,162 @@ +google.cloud.asset.v1.UpdateFeedRequest + */ +class UpdateFeedRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * + * Generated from protobuf field .google.cloud.asset.v1.Feed feed = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $feed = null; + /** + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Asset\V1\Feed $feed Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * + * @return \Google\Cloud\Asset\V1\UpdateFeedRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Asset\V1\Feed $feed): self + { + return (new self()) + ->setFeed($feed); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\Feed $feed + * Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * + * Generated from protobuf field .google.cloud.asset.v1.Feed feed = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Asset\V1\Feed|null + */ + public function getFeed() + { + return $this->feed; + } + + public function hasFeed() + { + return isset($this->feed); + } + + public function clearFeed() + { + unset($this->feed); + } + + /** + * Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * + * Generated from protobuf field .google.cloud.asset.v1.Feed feed = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Asset\V1\Feed $var + * @return $this + */ + public function setFeed($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\Feed::class); + $this->feed = $var; + + return $this; + } + + /** + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/UpdateSavedQueryRequest.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/UpdateSavedQueryRequest.php new file mode 100644 index 000000000000..ba87744907e0 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/UpdateSavedQueryRequest.php @@ -0,0 +1,163 @@ +google.cloud.asset.v1.UpdateSavedQueryRequest + */ +class UpdateSavedQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The saved query to update. + * The saved query's `name` field is used to identify the one to update, + * which has format as below: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field .google.cloud.asset.v1.SavedQuery saved_query = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $saved_query = null; + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Asset\V1\SavedQuery $savedQuery Required. The saved query to update. + * + * The saved query's `name` field is used to identify the one to update, + * which has format as below: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to update. + * + * @return \Google\Cloud\Asset\V1\UpdateSavedQueryRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Asset\V1\SavedQuery $savedQuery, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSavedQuery($savedQuery) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Asset\V1\SavedQuery $saved_query + * Required. The saved query to update. + * The saved query's `name` field is used to identify the one to update, + * which has format as below: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The saved query to update. + * The saved query's `name` field is used to identify the one to update, + * which has format as below: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field .google.cloud.asset.v1.SavedQuery saved_query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Asset\V1\SavedQuery|null + */ + public function getSavedQuery() + { + return $this->saved_query; + } + + public function hasSavedQuery() + { + return isset($this->saved_query); + } + + public function clearSavedQuery() + { + unset($this->saved_query); + } + + /** + * Required. The saved query to update. + * The saved query's `name` field is used to identify the one to update, + * which has format as below: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * Generated from protobuf field .google.cloud.asset.v1.SavedQuery saved_query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Asset\V1\SavedQuery $var + * @return $this + */ + public function setSavedQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\SavedQuery::class); + $this->saved_query = $var; + + return $this; + } + + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/VersionedResource.php b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/VersionedResource.php new file mode 100644 index 000000000000..09ceb2e0a744 --- /dev/null +++ b/owl-bot-staging/Asset/v1/proto/src/Google/Cloud/Asset/V1/VersionedResource.php @@ -0,0 +1,164 @@ +google.cloud.asset.v1.VersionedResource + */ +class VersionedResource extends \Google\Protobuf\Internal\Message +{ + /** + * API version of the resource. + * Example: + * If the resource is an instance provided by Compute Engine v1 API as defined + * in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`, + * version will be "v1". + * + * Generated from protobuf field string version = 1; + */ + protected $version = ''; + /** + * JSON representation of the resource as defined by the corresponding + * service providing this resource. + * Example: + * If the resource is an instance provided by Compute Engine, this field will + * contain the JSON representation of the instance as defined by Compute + * Engine: + * `https://cloud.google.com/compute/docs/reference/rest/v1/instances`. + * You can find the resource definition for each supported resource type in + * this table: + * `https://cloud.google.com/asset-inventory/docs/supported-asset-types` + * + * Generated from protobuf field .google.protobuf.Struct resource = 2; + */ + protected $resource = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $version + * API version of the resource. + * Example: + * If the resource is an instance provided by Compute Engine v1 API as defined + * in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`, + * version will be "v1". + * @type \Google\Protobuf\Struct $resource + * JSON representation of the resource as defined by the corresponding + * service providing this resource. + * Example: + * If the resource is an instance provided by Compute Engine, this field will + * contain the JSON representation of the instance as defined by Compute + * Engine: + * `https://cloud.google.com/compute/docs/reference/rest/v1/instances`. + * You can find the resource definition for each supported resource type in + * this table: + * `https://cloud.google.com/asset-inventory/docs/supported-asset-types` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce(); + parent::__construct($data); + } + + /** + * API version of the resource. + * Example: + * If the resource is an instance provided by Compute Engine v1 API as defined + * in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`, + * version will be "v1". + * + * Generated from protobuf field string version = 1; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * API version of the resource. + * Example: + * If the resource is an instance provided by Compute Engine v1 API as defined + * in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`, + * version will be "v1". + * + * Generated from protobuf field string version = 1; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * JSON representation of the resource as defined by the corresponding + * service providing this resource. + * Example: + * If the resource is an instance provided by Compute Engine, this field will + * contain the JSON representation of the instance as defined by Compute + * Engine: + * `https://cloud.google.com/compute/docs/reference/rest/v1/instances`. + * You can find the resource definition for each supported resource type in + * this table: + * `https://cloud.google.com/asset-inventory/docs/supported-asset-types` + * + * Generated from protobuf field .google.protobuf.Struct resource = 2; + * @return \Google\Protobuf\Struct|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * JSON representation of the resource as defined by the corresponding + * service providing this resource. + * Example: + * If the resource is an instance provided by Compute Engine, this field will + * contain the JSON representation of the instance as defined by Compute + * Engine: + * `https://cloud.google.com/compute/docs/reference/rest/v1/instances`. + * You can find the resource definition for each supported resource type in + * this table: + * `https://cloud.google.com/asset-inventory/docs/supported-asset-types` + * + * Generated from protobuf field .google.protobuf.Struct resource = 2; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_iam_policy.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_iam_policy.php new file mode 100644 index 000000000000..a0846e032f8c --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_iam_policy.php @@ -0,0 +1,85 @@ +setScope($analysisQueryScope); + $request = (new AnalyzeIamPolicyRequest()) + ->setAnalysisQuery($analysisQuery); + + // Call the API and handle any network failures. + try { + /** @var AnalyzeIamPolicyResponse $response */ + $response = $assetServiceClient->analyzeIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $analysisQueryScope = '[SCOPE]'; + + analyze_iam_policy_sample($analysisQueryScope); +} +// [END cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_iam_policy_longrunning.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_iam_policy_longrunning.php new file mode 100644 index 000000000000..63808cf33542 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_iam_policy_longrunning.php @@ -0,0 +1,108 @@ +setScope($analysisQueryScope); + $outputConfig = new IamPolicyAnalysisOutputConfig(); + $request = (new AnalyzeIamPolicyLongrunningRequest()) + ->setAnalysisQuery($analysisQuery) + ->setOutputConfig($outputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $assetServiceClient->analyzeIamPolicyLongrunning($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AnalyzeIamPolicyLongrunningResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $analysisQueryScope = '[SCOPE]'; + + analyze_iam_policy_longrunning_sample($analysisQueryScope); +} +// [END cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_move.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_move.php new file mode 100644 index 000000000000..6fa609bf3d7f --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_move.php @@ -0,0 +1,85 @@ +setResource($formattedResource) + ->setDestinationParent($destinationParent); + + // Call the API and handle any network failures. + try { + /** @var AnalyzeMoveResponse $response */ + $response = $assetServiceClient->analyzeMove($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedResource = AssetServiceClient::projectName('[PROJECT]'); + $destinationParent = '[DESTINATION_PARENT]'; + + analyze_move_sample($formattedResource, $destinationParent); +} +// [END cloudasset_v1_generated_AssetService_AnalyzeMove_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_org_policies.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_org_policies.php new file mode 100644 index 000000000000..21f5dbe75964 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_org_policies.php @@ -0,0 +1,83 @@ +setScope($scope) + ->setConstraint($constraint); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $assetServiceClient->analyzeOrgPolicies($request); + + /** @var OrgPolicyResult $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $scope = '[SCOPE]'; + $constraint = '[CONSTRAINT]'; + + analyze_org_policies_sample($scope, $constraint); +} +// [END cloudasset_v1_generated_AssetService_AnalyzeOrgPolicies_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_org_policy_governed_assets.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_org_policy_governed_assets.php new file mode 100644 index 000000000000..789a887d378e --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_org_policy_governed_assets.php @@ -0,0 +1,133 @@ +setScope($scope) + ->setConstraint($constraint); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $assetServiceClient->analyzeOrgPolicyGovernedAssets($request); + + /** @var GovernedAsset $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $scope = '[SCOPE]'; + $constraint = '[CONSTRAINT]'; + + analyze_org_policy_governed_assets_sample($scope, $constraint); +} +// [END cloudasset_v1_generated_AssetService_AnalyzeOrgPolicyGovernedAssets_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_org_policy_governed_containers.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_org_policy_governed_containers.php new file mode 100644 index 000000000000..97713c0767b8 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/analyze_org_policy_governed_containers.php @@ -0,0 +1,86 @@ +setScope($scope) + ->setConstraint($constraint); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $assetServiceClient->analyzeOrgPolicyGovernedContainers($request); + + /** @var GovernedContainer $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $scope = '[SCOPE]'; + $constraint = '[CONSTRAINT]'; + + analyze_org_policy_governed_containers_sample($scope, $constraint); +} +// [END cloudasset_v1_generated_AssetService_AnalyzeOrgPolicyGovernedContainers_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/batch_get_assets_history.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/batch_get_assets_history.php new file mode 100644 index 000000000000..6e878fb7c64c --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/batch_get_assets_history.php @@ -0,0 +1,85 @@ +setParent($parent) + ->setContentType($contentType) + ->setReadTimeWindow($readTimeWindow); + + // Call the API and handle any network failures. + try { + /** @var BatchGetAssetsHistoryResponse $response */ + $response = $assetServiceClient->batchGetAssetsHistory($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $contentType = ContentType::CONTENT_TYPE_UNSPECIFIED; + + batch_get_assets_history_sample($parent, $contentType); +} +// [END cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/batch_get_effective_iam_policies.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/batch_get_effective_iam_policies.php new file mode 100644 index 000000000000..04f9181c08a8 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/batch_get_effective_iam_policies.php @@ -0,0 +1,88 @@ +setScope($scope) + ->setNames($names); + + // Call the API and handle any network failures. + try { + /** @var BatchGetEffectiveIamPoliciesResponse $response */ + $response = $assetServiceClient->batchGetEffectiveIamPolicies($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $scope = '[SCOPE]'; + $namesElement = '[NAMES]'; + + batch_get_effective_iam_policies_sample($scope, $namesElement); +} +// [END cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/create_feed.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/create_feed.php new file mode 100644 index 000000000000..302ed9c76b26 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/create_feed.php @@ -0,0 +1,93 @@ +setName($feedName) + ->setFeedOutputConfig($feedFeedOutputConfig); + $request = (new CreateFeedRequest()) + ->setParent($parent) + ->setFeedId($feedId) + ->setFeed($feed); + + // Call the API and handle any network failures. + try { + /** @var Feed $response */ + $response = $assetServiceClient->createFeed($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $feedId = '[FEED_ID]'; + $feedName = '[NAME]'; + + create_feed_sample($parent, $feedId, $feedName); +} +// [END cloudasset_v1_generated_AssetService_CreateFeed_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/create_saved_query.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/create_saved_query.php new file mode 100644 index 000000000000..1256b5ff4f0a --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/create_saved_query.php @@ -0,0 +1,88 @@ +setParent($formattedParent) + ->setSavedQuery($savedQuery) + ->setSavedQueryId($savedQueryId); + + // Call the API and handle any network failures. + try { + /** @var SavedQuery $response */ + $response = $assetServiceClient->createSavedQuery($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AssetServiceClient::projectName('[PROJECT]'); + $savedQueryId = '[SAVED_QUERY_ID]'; + + create_saved_query_sample($formattedParent, $savedQueryId); +} +// [END cloudasset_v1_generated_AssetService_CreateSavedQuery_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/delete_feed.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/delete_feed.php new file mode 100644 index 000000000000..61e2b3d40712 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/delete_feed.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $assetServiceClient->deleteFeed($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AssetServiceClient::feedName('[PROJECT]', '[FEED]'); + + delete_feed_sample($formattedName); +} +// [END cloudasset_v1_generated_AssetService_DeleteFeed_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/delete_saved_query.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/delete_saved_query.php new file mode 100644 index 000000000000..f26af88ac8a2 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/delete_saved_query.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $assetServiceClient->deleteSavedQuery($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AssetServiceClient::savedQueryName('[PROJECT]', '[SAVED_QUERY]'); + + delete_saved_query_sample($formattedName); +} +// [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/export_assets.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/export_assets.php new file mode 100644 index 000000000000..9e9488e8dc9f --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/export_assets.php @@ -0,0 +1,98 @@ +setParent($parent) + ->setOutputConfig($outputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $assetServiceClient->exportAssets($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ExportAssetsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + export_assets_sample($parent); +} +// [END cloudasset_v1_generated_AssetService_ExportAssets_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/get_feed.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/get_feed.php new file mode 100644 index 000000000000..f30a24190f83 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/get_feed.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Feed $response */ + $response = $assetServiceClient->getFeed($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AssetServiceClient::feedName('[PROJECT]', '[FEED]'); + + get_feed_sample($formattedName); +} +// [END cloudasset_v1_generated_AssetService_GetFeed_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/get_saved_query.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/get_saved_query.php new file mode 100644 index 000000000000..bf9996e18809 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/get_saved_query.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SavedQuery $response */ + $response = $assetServiceClient->getSavedQuery($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AssetServiceClient::savedQueryName('[PROJECT]', '[SAVED_QUERY]'); + + get_saved_query_sample($formattedName); +} +// [END cloudasset_v1_generated_AssetService_GetSavedQuery_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/list_assets.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/list_assets.php new file mode 100644 index 000000000000..6403d446c771 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/list_assets.php @@ -0,0 +1,80 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $assetServiceClient->listAssets($request); + + /** @var Asset $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_assets_sample($parent); +} +// [END cloudasset_v1_generated_AssetService_ListAssets_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/list_feeds.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/list_feeds.php new file mode 100644 index 000000000000..1d4deea1ab11 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/list_feeds.php @@ -0,0 +1,72 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var ListFeedsResponse $response */ + $response = $assetServiceClient->listFeeds($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_feeds_sample($parent); +} +// [END cloudasset_v1_generated_AssetService_ListFeeds_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/list_saved_queries.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/list_saved_queries.php new file mode 100644 index 000000000000..acb7ff749d56 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/list_saved_queries.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $assetServiceClient->listSavedQueries($request); + + /** @var SavedQuery $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AssetServiceClient::projectName('[PROJECT]'); + + list_saved_queries_sample($formattedParent); +} +// [END cloudasset_v1_generated_AssetService_ListSavedQueries_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/query_assets.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/query_assets.php new file mode 100644 index 000000000000..3e1f4c5d93cf --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/query_assets.php @@ -0,0 +1,86 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var QueryAssetsResponse $response */ + $response = $assetServiceClient->queryAssets($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + query_assets_sample($parent); +} +// [END cloudasset_v1_generated_AssetService_QueryAssets_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/search_all_iam_policies.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/search_all_iam_policies.php new file mode 100644 index 000000000000..4fc4e19ecbd0 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/search_all_iam_policies.php @@ -0,0 +1,89 @@ +setScope($scope); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $assetServiceClient->searchAllIamPolicies($request); + + /** @var IamPolicySearchResult $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $scope = '[SCOPE]'; + + search_all_iam_policies_sample($scope); +} +// [END cloudasset_v1_generated_AssetService_SearchAllIamPolicies_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/search_all_resources.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/search_all_resources.php new file mode 100644 index 000000000000..f338d2e4f57b --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/search_all_resources.php @@ -0,0 +1,89 @@ +setScope($scope); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $assetServiceClient->searchAllResources($request); + + /** @var ResourceSearchResult $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $scope = '[SCOPE]'; + + search_all_resources_sample($scope); +} +// [END cloudasset_v1_generated_AssetService_SearchAllResources_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/update_feed.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/update_feed.php new file mode 100644 index 000000000000..d037cbd8faf3 --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/update_feed.php @@ -0,0 +1,84 @@ +setName($feedName) + ->setFeedOutputConfig($feedFeedOutputConfig); + $updateMask = new FieldMask(); + $request = (new UpdateFeedRequest()) + ->setFeed($feed) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Feed $response */ + $response = $assetServiceClient->updateFeed($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $feedName = '[NAME]'; + + update_feed_sample($feedName); +} +// [END cloudasset_v1_generated_AssetService_UpdateFeed_sync] diff --git a/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/update_saved_query.php b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/update_saved_query.php new file mode 100644 index 000000000000..3ba9f0ee02ed --- /dev/null +++ b/owl-bot-staging/Asset/v1/samples/V1/AssetServiceClient/update_saved_query.php @@ -0,0 +1,62 @@ +setSavedQuery($savedQuery) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var SavedQuery $response */ + $response = $assetServiceClient->updateSavedQuery($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudasset_v1_generated_AssetService_UpdateSavedQuery_sync] diff --git a/owl-bot-staging/Asset/v1/src/V1/Client/AssetServiceClient.php b/owl-bot-staging/Asset/v1/src/V1/Client/AssetServiceClient.php new file mode 100644 index 000000000000..6288d820b2e7 --- /dev/null +++ b/owl-bot-staging/Asset/v1/src/V1/Client/AssetServiceClient.php @@ -0,0 +1,1191 @@ + analyzeIamPolicyAsync(AnalyzeIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface analyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest $request, array $optionalArgs = []) + * @method PromiseInterface analyzeMoveAsync(AnalyzeMoveRequest $request, array $optionalArgs = []) + * @method PromiseInterface analyzeOrgPoliciesAsync(AnalyzeOrgPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface analyzeOrgPolicyGovernedAssetsAsync(AnalyzeOrgPolicyGovernedAssetsRequest $request, array $optionalArgs = []) + * @method PromiseInterface analyzeOrgPolicyGovernedContainersAsync(AnalyzeOrgPolicyGovernedContainersRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchGetAssetsHistoryAsync(BatchGetAssetsHistoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchGetEffectiveIamPoliciesAsync(BatchGetEffectiveIamPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface createFeedAsync(CreateFeedRequest $request, array $optionalArgs = []) + * @method PromiseInterface createSavedQueryAsync(CreateSavedQueryRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteFeedAsync(DeleteFeedRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSavedQueryAsync(DeleteSavedQueryRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportAssetsAsync(ExportAssetsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getFeedAsync(GetFeedRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSavedQueryAsync(GetSavedQueryRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAssetsAsync(ListAssetsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listFeedsAsync(ListFeedsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSavedQueriesAsync(ListSavedQueriesRequest $request, array $optionalArgs = []) + * @method PromiseInterface queryAssetsAsync(QueryAssetsRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchAllIamPoliciesAsync(SearchAllIamPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchAllResourcesAsync(SearchAllResourcesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateFeedAsync(UpdateFeedRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateSavedQueryAsync(UpdateSavedQueryRequest $request, array $optionalArgs = []) + */ +final class AssetServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.asset.v1.AssetService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudasset.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudasset.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/asset_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/asset_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/asset_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/asset_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a feed + * resource. + * + * @param string $project + * @param string $feed + * + * @return string The formatted feed resource. + */ + public static function feedName(string $project, string $feed): string + { + return self::getPathTemplate('feed')->render([ + 'project' => $project, + 'feed' => $feed, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a folder + * resource. + * + * @param string $folder + * + * @return string The formatted folder resource. + */ + public static function folderName(string $folder): string + { + return self::getPathTemplate('folder')->render([ + 'folder' => $folder, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a folder_feed + * resource. + * + * @param string $folder + * @param string $feed + * + * @return string The formatted folder_feed resource. + */ + public static function folderFeedName(string $folder, string $feed): string + { + return self::getPathTemplate('folderFeed')->render([ + 'folder' => $folder, + 'feed' => $feed, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_saved_query resource. + * + * @param string $folder + * @param string $savedQuery + * + * @return string The formatted folder_saved_query resource. + */ + public static function folderSavedQueryName(string $folder, string $savedQuery): string + { + return self::getPathTemplate('folderSavedQuery')->render([ + 'folder' => $folder, + 'saved_query' => $savedQuery, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a organization + * resource. + * + * @param string $organization + * + * @return string The formatted organization resource. + */ + public static function organizationName(string $organization): string + { + return self::getPathTemplate('organization')->render([ + 'organization' => $organization, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_feed resource. + * + * @param string $organization + * @param string $feed + * + * @return string The formatted organization_feed resource. + */ + public static function organizationFeedName(string $organization, string $feed): string + { + return self::getPathTemplate('organizationFeed')->render([ + 'organization' => $organization, + 'feed' => $feed, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_saved_query resource. + * + * @param string $organization + * @param string $savedQuery + * + * @return string The formatted organization_saved_query resource. + */ + public static function organizationSavedQueryName(string $organization, string $savedQuery): string + { + return self::getPathTemplate('organizationSavedQuery')->render([ + 'organization' => $organization, + 'saved_query' => $savedQuery, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project_feed + * resource. + * + * @param string $project + * @param string $feed + * + * @return string The formatted project_feed resource. + */ + public static function projectFeedName(string $project, string $feed): string + { + return self::getPathTemplate('projectFeed')->render([ + 'project' => $project, + 'feed' => $feed, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_saved_query resource. + * + * @param string $project + * @param string $savedQuery + * + * @return string The formatted project_saved_query resource. + */ + public static function projectSavedQueryName(string $project, string $savedQuery): string + { + return self::getPathTemplate('projectSavedQuery')->render([ + 'project' => $project, + 'saved_query' => $savedQuery, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a saved_query + * resource. + * + * @param string $project + * @param string $savedQuery + * + * @return string The formatted saved_query resource. + */ + public static function savedQueryName(string $project, string $savedQuery): string + { + return self::getPathTemplate('savedQuery')->render([ + 'project' => $project, + 'saved_query' => $savedQuery, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - feed: projects/{project}/feeds/{feed} + * - folder: folders/{folder} + * - folderFeed: folders/{folder}/feeds/{feed} + * - folderSavedQuery: folders/{folder}/savedQueries/{saved_query} + * - organization: organizations/{organization} + * - organizationFeed: organizations/{organization}/feeds/{feed} + * - organizationSavedQuery: organizations/{organization}/savedQueries/{saved_query} + * - project: projects/{project} + * - projectFeed: projects/{project}/feeds/{feed} + * - projectSavedQuery: projects/{project}/savedQueries/{saved_query} + * - savedQuery: projects/{project}/savedQueries/{saved_query} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudasset.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Analyzes IAM policies to answer which identities have what accesses on + * which resources. + * + * The async variant is {@see AssetServiceClient::analyzeIamPolicyAsync()} . + * + * @example samples/V1/AssetServiceClient/analyze_iam_policy.php + * + * @param AnalyzeIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnalyzeIamPolicyResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function analyzeIamPolicy(AnalyzeIamPolicyRequest $request, array $callOptions = []): AnalyzeIamPolicyResponse + { + return $this->startApiCall('AnalyzeIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Analyzes IAM policies asynchronously to answer which identities have what + * accesses on which resources, and writes the analysis results to a Google + * Cloud Storage or a BigQuery destination. For Cloud Storage destination, the + * output format is the JSON format that represents a + * [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. + * This method implements the + * [google.longrunning.Operation][google.longrunning.Operation], which allows + * you to track the operation status. We recommend intervals of at least 2 + * seconds with exponential backoff retry to poll the operation result. The + * metadata contains the metadata for the long-running operation. + * + * The async variant is + * {@see AssetServiceClient::analyzeIamPolicyLongrunningAsync()} . + * + * @example samples/V1/AssetServiceClient/analyze_iam_policy_longrunning.php + * + * @param AnalyzeIamPolicyLongrunningRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function analyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AnalyzeIamPolicyLongrunning', $request, $callOptions)->wait(); + } + + /** + * Analyze moving a resource to a specified destination without kicking off + * the actual move. The analysis is best effort depending on the user's + * permissions of viewing different hierarchical policies and configurations. + * The policies and configuration are subject to change before the actual + * resource migration takes place. + * + * The async variant is {@see AssetServiceClient::analyzeMoveAsync()} . + * + * @example samples/V1/AssetServiceClient/analyze_move.php + * + * @param AnalyzeMoveRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnalyzeMoveResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function analyzeMove(AnalyzeMoveRequest $request, array $callOptions = []): AnalyzeMoveResponse + { + return $this->startApiCall('AnalyzeMove', $request, $callOptions)->wait(); + } + + /** + * Analyzes organization policies under a scope. + * + * The async variant is {@see AssetServiceClient::analyzeOrgPoliciesAsync()} . + * + * @example samples/V1/AssetServiceClient/analyze_org_policies.php + * + * @param AnalyzeOrgPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function analyzeOrgPolicies(AnalyzeOrgPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AnalyzeOrgPolicies', $request, $callOptions); + } + + /** + * Analyzes organization policies governed assets (Google Cloud resources or + * policies) under a scope. This RPC supports custom constraints and the + * following canned constraints: + * + * * constraints/ainotebooks.accessMode + * * constraints/ainotebooks.disableFileDownloads + * * constraints/ainotebooks.disableRootAccess + * * constraints/ainotebooks.disableTerminal + * * constraints/ainotebooks.environmentOptions + * * constraints/ainotebooks.requireAutoUpgradeSchedule + * * constraints/ainotebooks.restrictVpcNetworks + * * constraints/compute.disableGuestAttributesAccess + * * constraints/compute.disableInstanceDataAccessApis + * * constraints/compute.disableNestedVirtualization + * * constraints/compute.disableSerialPortAccess + * * constraints/compute.disableSerialPortLogging + * * constraints/compute.disableVpcExternalIpv6 + * * constraints/compute.requireOsLogin + * * constraints/compute.requireShieldedVm + * * constraints/compute.restrictLoadBalancerCreationForTypes + * * constraints/compute.restrictProtocolForwardingCreationForTypes + * * constraints/compute.restrictXpnProjectLienRemoval + * * constraints/compute.setNewProjectDefaultToZonalDNSOnly + * * constraints/compute.skipDefaultNetworkCreation + * * constraints/compute.trustedImageProjects + * * constraints/compute.vmCanIpForward + * * constraints/compute.vmExternalIpAccess + * * constraints/gcp.detailedAuditLoggingMode + * * constraints/gcp.resourceLocations + * * constraints/iam.allowedPolicyMemberDomains + * * constraints/iam.automaticIamGrantsForDefaultServiceAccounts + * * constraints/iam.disableServiceAccountCreation + * * constraints/iam.disableServiceAccountKeyCreation + * * constraints/iam.disableServiceAccountKeyUpload + * * constraints/iam.restrictCrossProjectServiceAccountLienRemoval + * * constraints/iam.serviceAccountKeyExpiryHours + * * constraints/resourcemanager.accessBoundaries + * * constraints/resourcemanager.allowedExportDestinations + * * constraints/sql.restrictAuthorizedNetworks + * * constraints/sql.restrictNoncompliantDiagnosticDataAccess + * * constraints/sql.restrictNoncompliantResourceCreation + * * constraints/sql.restrictPublicIp + * * constraints/storage.publicAccessPrevention + * * constraints/storage.restrictAuthTypes + * * constraints/storage.uniformBucketLevelAccess + * + * This RPC only returns either resources of types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * or IAM policies. + * + * The async variant is + * {@see AssetServiceClient::analyzeOrgPolicyGovernedAssetsAsync()} . + * + * @example samples/V1/AssetServiceClient/analyze_org_policy_governed_assets.php + * + * @param AnalyzeOrgPolicyGovernedAssetsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function analyzeOrgPolicyGovernedAssets(AnalyzeOrgPolicyGovernedAssetsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AnalyzeOrgPolicyGovernedAssets', $request, $callOptions); + } + + /** + * Analyzes organization policies governed containers (projects, folders or + * organization) under a scope. + * + * The async variant is + * {@see AssetServiceClient::analyzeOrgPolicyGovernedContainersAsync()} . + * + * @example samples/V1/AssetServiceClient/analyze_org_policy_governed_containers.php + * + * @param AnalyzeOrgPolicyGovernedContainersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function analyzeOrgPolicyGovernedContainers(AnalyzeOrgPolicyGovernedContainersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AnalyzeOrgPolicyGovernedContainers', $request, $callOptions); + } + + /** + * Batch gets the update history of assets that overlap a time window. + * For IAM_POLICY content, this API outputs history when the asset and its + * attached IAM POLICY both exist. This can create gaps in the output history. + * Otherwise, this API outputs history with asset in both non-delete or + * deleted status. + * If a specified asset does not exist, this API returns an INVALID_ARGUMENT + * error. + * + * The async variant is {@see AssetServiceClient::batchGetAssetsHistoryAsync()} . + * + * @example samples/V1/AssetServiceClient/batch_get_assets_history.php + * + * @param BatchGetAssetsHistoryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BatchGetAssetsHistoryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchGetAssetsHistory(BatchGetAssetsHistoryRequest $request, array $callOptions = []): BatchGetAssetsHistoryResponse + { + return $this->startApiCall('BatchGetAssetsHistory', $request, $callOptions)->wait(); + } + + /** + * Gets effective IAM policies for a batch of resources. + * + * The async variant is + * {@see AssetServiceClient::batchGetEffectiveIamPoliciesAsync()} . + * + * @example samples/V1/AssetServiceClient/batch_get_effective_iam_policies.php + * + * @param BatchGetEffectiveIamPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BatchGetEffectiveIamPoliciesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchGetEffectiveIamPolicies(BatchGetEffectiveIamPoliciesRequest $request, array $callOptions = []): BatchGetEffectiveIamPoliciesResponse + { + return $this->startApiCall('BatchGetEffectiveIamPolicies', $request, $callOptions)->wait(); + } + + /** + * Creates a feed in a parent project/folder/organization to listen to its + * asset updates. + * + * The async variant is {@see AssetServiceClient::createFeedAsync()} . + * + * @example samples/V1/AssetServiceClient/create_feed.php + * + * @param CreateFeedRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Feed + * + * @throws ApiException Thrown if the API call fails. + */ + public function createFeed(CreateFeedRequest $request, array $callOptions = []): Feed + { + return $this->startApiCall('CreateFeed', $request, $callOptions)->wait(); + } + + /** + * Creates a saved query in a parent project/folder/organization. + * + * The async variant is {@see AssetServiceClient::createSavedQueryAsync()} . + * + * @example samples/V1/AssetServiceClient/create_saved_query.php + * + * @param CreateSavedQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SavedQuery + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSavedQuery(CreateSavedQueryRequest $request, array $callOptions = []): SavedQuery + { + return $this->startApiCall('CreateSavedQuery', $request, $callOptions)->wait(); + } + + /** + * Deletes an asset feed. + * + * The async variant is {@see AssetServiceClient::deleteFeedAsync()} . + * + * @example samples/V1/AssetServiceClient/delete_feed.php + * + * @param DeleteFeedRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteFeed(DeleteFeedRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteFeed', $request, $callOptions)->wait(); + } + + /** + * Deletes a saved query. + * + * The async variant is {@see AssetServiceClient::deleteSavedQueryAsync()} . + * + * @example samples/V1/AssetServiceClient/delete_saved_query.php + * + * @param DeleteSavedQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSavedQuery(DeleteSavedQueryRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSavedQuery', $request, $callOptions)->wait(); + } + + /** + * Exports assets with time and resource types to a given Cloud Storage + * location/BigQuery table. For Cloud Storage location destinations, the + * output format is newline-delimited JSON. Each line represents a + * [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON + * format; for BigQuery table destinations, the output table stores the fields + * in asset Protobuf as columns. This API implements the + * [google.longrunning.Operation][google.longrunning.Operation] API, which + * allows you to keep track of the export. We recommend intervals of at least + * 2 seconds with exponential retry to poll the export operation result. For + * regular-size resource parent, the export operation usually finishes within + * 5 minutes. + * + * The async variant is {@see AssetServiceClient::exportAssetsAsync()} . + * + * @example samples/V1/AssetServiceClient/export_assets.php + * + * @param ExportAssetsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportAssets(ExportAssetsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportAssets', $request, $callOptions)->wait(); + } + + /** + * Gets details about an asset feed. + * + * The async variant is {@see AssetServiceClient::getFeedAsync()} . + * + * @example samples/V1/AssetServiceClient/get_feed.php + * + * @param GetFeedRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Feed + * + * @throws ApiException Thrown if the API call fails. + */ + public function getFeed(GetFeedRequest $request, array $callOptions = []): Feed + { + return $this->startApiCall('GetFeed', $request, $callOptions)->wait(); + } + + /** + * Gets details about a saved query. + * + * The async variant is {@see AssetServiceClient::getSavedQueryAsync()} . + * + * @example samples/V1/AssetServiceClient/get_saved_query.php + * + * @param GetSavedQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SavedQuery + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSavedQuery(GetSavedQueryRequest $request, array $callOptions = []): SavedQuery + { + return $this->startApiCall('GetSavedQuery', $request, $callOptions)->wait(); + } + + /** + * Lists assets with time and resource types and returns paged results in + * response. + * + * The async variant is {@see AssetServiceClient::listAssetsAsync()} . + * + * @example samples/V1/AssetServiceClient/list_assets.php + * + * @param ListAssetsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAssets(ListAssetsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAssets', $request, $callOptions); + } + + /** + * Lists all asset feeds in a parent project/folder/organization. + * + * The async variant is {@see AssetServiceClient::listFeedsAsync()} . + * + * @example samples/V1/AssetServiceClient/list_feeds.php + * + * @param ListFeedsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ListFeedsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listFeeds(ListFeedsRequest $request, array $callOptions = []): ListFeedsResponse + { + return $this->startApiCall('ListFeeds', $request, $callOptions)->wait(); + } + + /** + * Lists all saved queries in a parent project/folder/organization. + * + * The async variant is {@see AssetServiceClient::listSavedQueriesAsync()} . + * + * @example samples/V1/AssetServiceClient/list_saved_queries.php + * + * @param ListSavedQueriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSavedQueries(ListSavedQueriesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSavedQueries', $request, $callOptions); + } + + /** + * Issue a job that queries assets using a SQL statement compatible with + * [BigQuery SQL](https://cloud.google.com/bigquery/docs/introduction-sql). + * + * If the query execution finishes within timeout and there's no pagination, + * the full query results will be returned in the `QueryAssetsResponse`. + * + * Otherwise, full query results can be obtained by issuing extra requests + * with the `job_reference` from the a previous `QueryAssets` call. + * + * Note, the query result has approximately 10 GB limitation enforced by + * [BigQuery](https://cloud.google.com/bigquery/docs/best-practices-performance-output). + * Queries return larger results will result in errors. + * + * The async variant is {@see AssetServiceClient::queryAssetsAsync()} . + * + * @example samples/V1/AssetServiceClient/query_assets.php + * + * @param QueryAssetsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return QueryAssetsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function queryAssets(QueryAssetsRequest $request, array $callOptions = []): QueryAssetsResponse + { + return $this->startApiCall('QueryAssets', $request, $callOptions)->wait(); + } + + /** + * Searches all IAM policies within the specified scope, such as a project, + * folder, or organization. The caller must be granted the + * `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, + * otherwise the request will be rejected. + * + * The async variant is {@see AssetServiceClient::searchAllIamPoliciesAsync()} . + * + * @example samples/V1/AssetServiceClient/search_all_iam_policies.php + * + * @param SearchAllIamPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchAllIamPolicies(SearchAllIamPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchAllIamPolicies', $request, $callOptions); + } + + /** + * Searches all Google Cloud resources within the specified scope, such as a + * project, folder, or organization. The caller must be granted the + * `cloudasset.assets.searchAllResources` permission on the desired scope, + * otherwise the request will be rejected. + * + * The async variant is {@see AssetServiceClient::searchAllResourcesAsync()} . + * + * @example samples/V1/AssetServiceClient/search_all_resources.php + * + * @param SearchAllResourcesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchAllResources(SearchAllResourcesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchAllResources', $request, $callOptions); + } + + /** + * Updates an asset feed configuration. + * + * The async variant is {@see AssetServiceClient::updateFeedAsync()} . + * + * @example samples/V1/AssetServiceClient/update_feed.php + * + * @param UpdateFeedRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Feed + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateFeed(UpdateFeedRequest $request, array $callOptions = []): Feed + { + return $this->startApiCall('UpdateFeed', $request, $callOptions)->wait(); + } + + /** + * Updates a saved query. + * + * The async variant is {@see AssetServiceClient::updateSavedQueryAsync()} . + * + * @example samples/V1/AssetServiceClient/update_saved_query.php + * + * @param UpdateSavedQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SavedQuery + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSavedQuery(UpdateSavedQueryRequest $request, array $callOptions = []): SavedQuery + { + return $this->startApiCall('UpdateSavedQuery', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Asset/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Asset/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..d82ed6c640f9 --- /dev/null +++ b/owl-bot-staging/Asset/v1/src/V1/gapic_metadata.json @@ -0,0 +1,133 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.asset.v1", + "libraryPackage": "Google\\Cloud\\Asset\\V1", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "AssetServiceGapicClient", + "rpcs": { + "AnalyzeIamPolicy": { + "methods": [ + "analyzeIamPolicy" + ] + }, + "AnalyzeIamPolicyLongrunning": { + "methods": [ + "analyzeIamPolicyLongrunning" + ] + }, + "AnalyzeMove": { + "methods": [ + "analyzeMove" + ] + }, + "AnalyzeOrgPolicies": { + "methods": [ + "analyzeOrgPolicies" + ] + }, + "AnalyzeOrgPolicyGovernedAssets": { + "methods": [ + "analyzeOrgPolicyGovernedAssets" + ] + }, + "AnalyzeOrgPolicyGovernedContainers": { + "methods": [ + "analyzeOrgPolicyGovernedContainers" + ] + }, + "BatchGetAssetsHistory": { + "methods": [ + "batchGetAssetsHistory" + ] + }, + "BatchGetEffectiveIamPolicies": { + "methods": [ + "batchGetEffectiveIamPolicies" + ] + }, + "CreateFeed": { + "methods": [ + "createFeed" + ] + }, + "CreateSavedQuery": { + "methods": [ + "createSavedQuery" + ] + }, + "DeleteFeed": { + "methods": [ + "deleteFeed" + ] + }, + "DeleteSavedQuery": { + "methods": [ + "deleteSavedQuery" + ] + }, + "ExportAssets": { + "methods": [ + "exportAssets" + ] + }, + "GetFeed": { + "methods": [ + "getFeed" + ] + }, + "GetSavedQuery": { + "methods": [ + "getSavedQuery" + ] + }, + "ListAssets": { + "methods": [ + "listAssets" + ] + }, + "ListFeeds": { + "methods": [ + "listFeeds" + ] + }, + "ListSavedQueries": { + "methods": [ + "listSavedQueries" + ] + }, + "QueryAssets": { + "methods": [ + "queryAssets" + ] + }, + "SearchAllIamPolicies": { + "methods": [ + "searchAllIamPolicies" + ] + }, + "SearchAllResources": { + "methods": [ + "searchAllResources" + ] + }, + "UpdateFeed": { + "methods": [ + "updateFeed" + ] + }, + "UpdateSavedQuery": { + "methods": [ + "updateSavedQuery" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Asset/v1/src/V1/resources/asset_service_client_config.json b/owl-bot-staging/Asset/v1/src/V1/resources/asset_service_client_config.json new file mode 100644 index 000000000000..a77774f9f074 --- /dev/null +++ b/owl-bot-staging/Asset/v1/src/V1/resources/asset_service_client_config.json @@ -0,0 +1,244 @@ +{ + "interfaces": { + "google.cloud.asset.v1.AssetService": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ], + "retry_policy_3_codes": [ + "UNAVAILABLE" + ], + "retry_policy_4_codes": [ + "UNAVAILABLE" + ], + "retry_policy_5_codes": [ + "UNAVAILABLE" + ], + "retry_policy_6_codes": [ + "UNAVAILABLE" + ], + "retry_policy_7_codes": [ + "UNAVAILABLE" + ], + "retry_policy_8_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + }, + "retry_policy_3_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + }, + "retry_policy_4_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 200000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 200000, + "total_timeout_millis": 200000 + }, + "retry_policy_5_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 10000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 + }, + "retry_policy_6_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + }, + "retry_policy_7_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_8_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "AnalyzeIamPolicy": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "AnalyzeIamPolicyLongrunning": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "AnalyzeMove": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "AnalyzeOrgPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "AnalyzeOrgPolicyGovernedAssets": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "AnalyzeOrgPolicyGovernedContainers": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchGetAssetsHistory": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchGetEffectiveIamPolicies": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "CreateFeed": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSavedQuery": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteFeed": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteSavedQuery": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ExportAssets": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetFeed": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetSavedQuery": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListAssets": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListFeeds": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSavedQueries": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "QueryAssets": { + "timeout_millis": 200000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "SearchAllIamPolicies": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "SearchAllResources": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "UpdateFeed": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateSavedQuery": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Asset/v1/src/V1/resources/asset_service_descriptor_config.php b/owl-bot-staging/Asset/v1/src/V1/resources/asset_service_descriptor_config.php new file mode 100644 index 000000000000..964b0a52ce33 --- /dev/null +++ b/owl-bot-staging/Asset/v1/src/V1/resources/asset_service_descriptor_config.php @@ -0,0 +1,391 @@ + [ + 'google.cloud.asset.v1.AssetService' => [ + 'AnalyzeIamPolicyLongrunning' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Asset\V1\AnalyzeIamPolicyLongrunningResponse', + 'metadataReturnType' => '\Google\Cloud\Asset\V1\AnalyzeIamPolicyLongrunningMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'analysis_query.scope', + 'fieldAccessors' => [ + 'getAnalysisQuery', + 'getScope', + ], + ], + ], + ], + 'ExportAssets' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Asset\V1\ExportAssetsResponse', + 'metadataReturnType' => '\Google\Cloud\Asset\V1\ExportAssetsRequest', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'AnalyzeIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse', + 'headerParams' => [ + [ + 'keyName' => 'analysis_query.scope', + 'fieldAccessors' => [ + 'getAnalysisQuery', + 'getScope', + ], + ], + ], + ], + 'AnalyzeMove' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\AnalyzeMoveResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'AnalyzeOrgPolicies' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getOrgPolicyResults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\AnalyzeOrgPoliciesResponse', + 'headerParams' => [ + [ + 'keyName' => 'scope', + 'fieldAccessors' => [ + 'getScope', + ], + ], + ], + ], + 'AnalyzeOrgPolicyGovernedAssets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGovernedAssets', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsResponse', + 'headerParams' => [ + [ + 'keyName' => 'scope', + 'fieldAccessors' => [ + 'getScope', + ], + ], + ], + ], + 'AnalyzeOrgPolicyGovernedContainers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGovernedContainers', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedContainersResponse', + 'headerParams' => [ + [ + 'keyName' => 'scope', + 'fieldAccessors' => [ + 'getScope', + ], + ], + ], + ], + 'BatchGetAssetsHistory' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\BatchGetAssetsHistoryResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchGetEffectiveIamPolicies' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\BatchGetEffectiveIamPoliciesResponse', + 'headerParams' => [ + [ + 'keyName' => 'scope', + 'fieldAccessors' => [ + 'getScope', + ], + ], + ], + ], + 'CreateFeed' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\Feed', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSavedQuery' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\SavedQuery', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteFeed' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSavedQuery' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetFeed' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\Feed', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSavedQuery' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\SavedQuery', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAssets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAssets', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\ListAssetsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListFeeds' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\ListFeedsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListSavedQueries' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSavedQueries', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\ListSavedQueriesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'QueryAssets' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\QueryAssetsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SearchAllIamPolicies' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\SearchAllIamPoliciesResponse', + 'headerParams' => [ + [ + 'keyName' => 'scope', + 'fieldAccessors' => [ + 'getScope', + ], + ], + ], + ], + 'SearchAllResources' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\SearchAllResourcesResponse', + 'headerParams' => [ + [ + 'keyName' => 'scope', + 'fieldAccessors' => [ + 'getScope', + ], + ], + ], + ], + 'UpdateFeed' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\Feed', + 'headerParams' => [ + [ + 'keyName' => 'feed.name', + 'fieldAccessors' => [ + 'getFeed', + 'getName', + ], + ], + ], + ], + 'UpdateSavedQuery' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Asset\V1\SavedQuery', + 'headerParams' => [ + [ + 'keyName' => 'saved_query.name', + 'fieldAccessors' => [ + 'getSavedQuery', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'feed' => 'projects/{project}/feeds/{feed}', + 'folder' => 'folders/{folder}', + 'folderFeed' => 'folders/{folder}/feeds/{feed}', + 'folderSavedQuery' => 'folders/{folder}/savedQueries/{saved_query}', + 'organization' => 'organizations/{organization}', + 'organizationFeed' => 'organizations/{organization}/feeds/{feed}', + 'organizationSavedQuery' => 'organizations/{organization}/savedQueries/{saved_query}', + 'project' => 'projects/{project}', + 'projectFeed' => 'projects/{project}/feeds/{feed}', + 'projectSavedQuery' => 'projects/{project}/savedQueries/{saved_query}', + 'savedQuery' => 'projects/{project}/savedQueries/{saved_query}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Asset/v1/src/V1/resources/asset_service_rest_client_config.php b/owl-bot-staging/Asset/v1/src/V1/resources/asset_service_rest_client_config.php new file mode 100644 index 000000000000..fd1b7fd66247 --- /dev/null +++ b/owl-bot-staging/Asset/v1/src/V1/resources/asset_service_rest_client_config.php @@ -0,0 +1,312 @@ + [ + 'google.cloud.asset.v1.AssetService' => [ + 'AnalyzeIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{analysis_query.scope=*/*}:analyzeIamPolicy', + 'placeholders' => [ + 'analysis_query.scope' => [ + 'getters' => [ + 'getAnalysisQuery', + 'getScope', + ], + ], + ], + ], + 'AnalyzeIamPolicyLongrunning' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning', + 'body' => '*', + 'placeholders' => [ + 'analysis_query.scope' => [ + 'getters' => [ + 'getAnalysisQuery', + 'getScope', + ], + ], + ], + ], + 'AnalyzeMove' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=*/*}:analyzeMove', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'AnalyzeOrgPolicies' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{scope=*/*}:analyzeOrgPolicies', + 'placeholders' => [ + 'scope' => [ + 'getters' => [ + 'getScope', + ], + ], + ], + ], + 'AnalyzeOrgPolicyGovernedAssets' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{scope=*/*}:analyzeOrgPolicyGovernedAssets', + 'placeholders' => [ + 'scope' => [ + 'getters' => [ + 'getScope', + ], + ], + ], + ], + 'AnalyzeOrgPolicyGovernedContainers' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{scope=*/*}:analyzeOrgPolicyGovernedContainers', + 'placeholders' => [ + 'scope' => [ + 'getters' => [ + 'getScope', + ], + ], + ], + ], + 'BatchGetAssetsHistory' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=*/*}:batchGetAssetsHistory', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchGetEffectiveIamPolicies' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{scope=*/*}/effectiveIamPolicies:batchGet', + 'placeholders' => [ + 'scope' => [ + 'getters' => [ + 'getScope', + ], + ], + ], + ], + 'CreateFeed' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=*/*}/feeds', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSavedQuery' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=*/*}/savedQueries', + 'body' => 'saved_query', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'saved_query_id', + ], + ], + 'DeleteFeed' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=*/*/feeds/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSavedQuery' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=*/*/savedQueries/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportAssets' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=*/*}:exportAssets', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetFeed' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=*/*/feeds/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSavedQuery' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=*/*/savedQueries/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListAssets' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=*/*}/assets', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListFeeds' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=*/*}/feeds', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSavedQueries' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=*/*}/savedQueries', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'QueryAssets' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=*/*}:queryAssets', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SearchAllIamPolicies' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{scope=*/*}:searchAllIamPolicies', + 'placeholders' => [ + 'scope' => [ + 'getters' => [ + 'getScope', + ], + ], + ], + ], + 'SearchAllResources' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{scope=*/*}:searchAllResources', + 'placeholders' => [ + 'scope' => [ + 'getters' => [ + 'getScope', + ], + ], + ], + ], + 'UpdateFeed' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{feed.name=*/*/feeds/*}', + 'body' => '*', + 'placeholders' => [ + 'feed.name' => [ + 'getters' => [ + 'getFeed', + 'getName', + ], + ], + ], + ], + 'UpdateSavedQuery' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{saved_query.name=*/*/savedQueries/*}', + 'body' => 'saved_query', + 'placeholders' => [ + 'saved_query.name' => [ + 'getters' => [ + 'getSavedQuery', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=*/*/operations/*/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Asset/v1/tests/Unit/V1/Client/AssetServiceClientTest.php b/owl-bot-staging/Asset/v1/tests/Unit/V1/Client/AssetServiceClientTest.php new file mode 100644 index 000000000000..aeaf0907eed3 --- /dev/null +++ b/owl-bot-staging/Asset/v1/tests/Unit/V1/Client/AssetServiceClientTest.php @@ -0,0 +1,1911 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AssetServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AssetServiceClient($options); + } + + /** @test */ + public function analyzeIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $fullyExplored = true; + $expectedResponse = new AnalyzeIamPolicyResponse(); + $expectedResponse->setFullyExplored($fullyExplored); + $transport->addResponse($expectedResponse); + // Mock request + $analysisQuery = new IamPolicyAnalysisQuery(); + $analysisQueryScope = 'analysisQueryScope-495018392'; + $analysisQuery->setScope($analysisQueryScope); + $request = (new AnalyzeIamPolicyRequest()) + ->setAnalysisQuery($analysisQuery); + $response = $gapicClient->analyzeIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/AnalyzeIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getAnalysisQuery(); + $this->assertProtobufEquals($analysisQuery, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $analysisQuery = new IamPolicyAnalysisQuery(); + $analysisQueryScope = 'analysisQueryScope-495018392'; + $analysisQuery->setScope($analysisQueryScope); + $request = (new AnalyzeIamPolicyRequest()) + ->setAnalysisQuery($analysisQuery); + try { + $gapicClient->analyzeIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeIamPolicyLongrunningTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/analyzeIamPolicyLongrunningTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new AnalyzeIamPolicyLongrunningResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/analyzeIamPolicyLongrunningTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $analysisQuery = new IamPolicyAnalysisQuery(); + $analysisQueryScope = 'analysisQueryScope-495018392'; + $analysisQuery->setScope($analysisQueryScope); + $outputConfig = new IamPolicyAnalysisOutputConfig(); + $request = (new AnalyzeIamPolicyLongrunningRequest()) + ->setAnalysisQuery($analysisQuery) + ->setOutputConfig($outputConfig); + $response = $gapicClient->analyzeIamPolicyLongrunning($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/AnalyzeIamPolicyLongrunning', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAnalysisQuery(); + $this->assertProtobufEquals($analysisQuery, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/analyzeIamPolicyLongrunningTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function analyzeIamPolicyLongrunningExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/analyzeIamPolicyLongrunningTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $analysisQuery = new IamPolicyAnalysisQuery(); + $analysisQueryScope = 'analysisQueryScope-495018392'; + $analysisQuery->setScope($analysisQueryScope); + $outputConfig = new IamPolicyAnalysisOutputConfig(); + $request = (new AnalyzeIamPolicyLongrunningRequest()) + ->setAnalysisQuery($analysisQuery) + ->setOutputConfig($outputConfig); + $response = $gapicClient->analyzeIamPolicyLongrunning($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/analyzeIamPolicyLongrunningTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function analyzeMoveTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AnalyzeMoveResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedResource = $gapicClient->projectName('[PROJECT]'); + $destinationParent = 'destinationParent-1362053637'; + $request = (new AnalyzeMoveRequest()) + ->setResource($formattedResource) + ->setDestinationParent($destinationParent); + $response = $gapicClient->analyzeMove($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/AnalyzeMove', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($formattedResource, $actualValue); + $actualValue = $actualRequestObject->getDestinationParent(); + $this->assertProtobufEquals($destinationParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeMoveExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedResource = $gapicClient->projectName('[PROJECT]'); + $destinationParent = 'destinationParent-1362053637'; + $request = (new AnalyzeMoveRequest()) + ->setResource($formattedResource) + ->setDestinationParent($destinationParent); + try { + $gapicClient->analyzeMove($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeOrgPoliciesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $orgPolicyResultsElement = new OrgPolicyResult(); + $orgPolicyResults = [ + $orgPolicyResultsElement, + ]; + $expectedResponse = new AnalyzeOrgPoliciesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setOrgPolicyResults($orgPolicyResults); + $transport->addResponse($expectedResponse); + // Mock request + $scope = 'scope109264468'; + $constraint = 'constraint-190376483'; + $request = (new AnalyzeOrgPoliciesRequest()) + ->setScope($scope) + ->setConstraint($constraint); + $response = $gapicClient->analyzeOrgPolicies($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getOrgPolicyResults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/AnalyzeOrgPolicies', $actualFuncCall); + $actualValue = $actualRequestObject->getScope(); + $this->assertProtobufEquals($scope, $actualValue); + $actualValue = $actualRequestObject->getConstraint(); + $this->assertProtobufEquals($constraint, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeOrgPoliciesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $scope = 'scope109264468'; + $constraint = 'constraint-190376483'; + $request = (new AnalyzeOrgPoliciesRequest()) + ->setScope($scope) + ->setConstraint($constraint); + try { + $gapicClient->analyzeOrgPolicies($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeOrgPolicyGovernedAssetsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $governedAssetsElement = new GovernedAsset(); + $governedAssets = [ + $governedAssetsElement, + ]; + $expectedResponse = new AnalyzeOrgPolicyGovernedAssetsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGovernedAssets($governedAssets); + $transport->addResponse($expectedResponse); + // Mock request + $scope = 'scope109264468'; + $constraint = 'constraint-190376483'; + $request = (new AnalyzeOrgPolicyGovernedAssetsRequest()) + ->setScope($scope) + ->setConstraint($constraint); + $response = $gapicClient->analyzeOrgPolicyGovernedAssets($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGovernedAssets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/AnalyzeOrgPolicyGovernedAssets', $actualFuncCall); + $actualValue = $actualRequestObject->getScope(); + $this->assertProtobufEquals($scope, $actualValue); + $actualValue = $actualRequestObject->getConstraint(); + $this->assertProtobufEquals($constraint, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeOrgPolicyGovernedAssetsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $scope = 'scope109264468'; + $constraint = 'constraint-190376483'; + $request = (new AnalyzeOrgPolicyGovernedAssetsRequest()) + ->setScope($scope) + ->setConstraint($constraint); + try { + $gapicClient->analyzeOrgPolicyGovernedAssets($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeOrgPolicyGovernedContainersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $governedContainersElement = new GovernedContainer(); + $governedContainers = [ + $governedContainersElement, + ]; + $expectedResponse = new AnalyzeOrgPolicyGovernedContainersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGovernedContainers($governedContainers); + $transport->addResponse($expectedResponse); + // Mock request + $scope = 'scope109264468'; + $constraint = 'constraint-190376483'; + $request = (new AnalyzeOrgPolicyGovernedContainersRequest()) + ->setScope($scope) + ->setConstraint($constraint); + $response = $gapicClient->analyzeOrgPolicyGovernedContainers($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGovernedContainers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/AnalyzeOrgPolicyGovernedContainers', $actualFuncCall); + $actualValue = $actualRequestObject->getScope(); + $this->assertProtobufEquals($scope, $actualValue); + $actualValue = $actualRequestObject->getConstraint(); + $this->assertProtobufEquals($constraint, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeOrgPolicyGovernedContainersExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $scope = 'scope109264468'; + $constraint = 'constraint-190376483'; + $request = (new AnalyzeOrgPolicyGovernedContainersRequest()) + ->setScope($scope) + ->setConstraint($constraint); + try { + $gapicClient->analyzeOrgPolicyGovernedContainers($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchGetAssetsHistoryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchGetAssetsHistoryResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $contentType = ContentType::CONTENT_TYPE_UNSPECIFIED; + $readTimeWindow = new TimeWindow(); + $request = (new BatchGetAssetsHistoryRequest()) + ->setParent($parent) + ->setContentType($contentType) + ->setReadTimeWindow($readTimeWindow); + $response = $gapicClient->batchGetAssetsHistory($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/BatchGetAssetsHistory', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getContentType(); + $this->assertProtobufEquals($contentType, $actualValue); + $actualValue = $actualRequestObject->getReadTimeWindow(); + $this->assertProtobufEquals($readTimeWindow, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchGetAssetsHistoryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $contentType = ContentType::CONTENT_TYPE_UNSPECIFIED; + $readTimeWindow = new TimeWindow(); + $request = (new BatchGetAssetsHistoryRequest()) + ->setParent($parent) + ->setContentType($contentType) + ->setReadTimeWindow($readTimeWindow); + try { + $gapicClient->batchGetAssetsHistory($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchGetEffectiveIamPoliciesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchGetEffectiveIamPoliciesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $scope = 'scope109264468'; + $names = []; + $request = (new BatchGetEffectiveIamPoliciesRequest()) + ->setScope($scope) + ->setNames($names); + $response = $gapicClient->batchGetEffectiveIamPolicies($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/BatchGetEffectiveIamPolicies', $actualFuncCall); + $actualValue = $actualRequestObject->getScope(); + $this->assertProtobufEquals($scope, $actualValue); + $actualValue = $actualRequestObject->getNames(); + $this->assertProtobufEquals($names, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchGetEffectiveIamPoliciesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $scope = 'scope109264468'; + $names = []; + $request = (new BatchGetEffectiveIamPoliciesRequest()) + ->setScope($scope) + ->setNames($names); + try { + $gapicClient->batchGetEffectiveIamPolicies($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createFeedTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Feed(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $feedId = 'feedId-976011428'; + $feed = new Feed(); + $feedName = 'feedName-192096951'; + $feed->setName($feedName); + $feedFeedOutputConfig = new FeedOutputConfig(); + $feed->setFeedOutputConfig($feedFeedOutputConfig); + $request = (new CreateFeedRequest()) + ->setParent($parent) + ->setFeedId($feedId) + ->setFeed($feed); + $response = $gapicClient->createFeed($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/CreateFeed', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getFeedId(); + $this->assertProtobufEquals($feedId, $actualValue); + $actualValue = $actualRequestObject->getFeed(); + $this->assertProtobufEquals($feed, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createFeedExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $feedId = 'feedId-976011428'; + $feed = new Feed(); + $feedName = 'feedName-192096951'; + $feed->setName($feedName); + $feedFeedOutputConfig = new FeedOutputConfig(); + $feed->setFeedOutputConfig($feedFeedOutputConfig); + $request = (new CreateFeedRequest()) + ->setParent($parent) + ->setFeedId($feedId) + ->setFeed($feed); + try { + $gapicClient->createFeed($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSavedQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $creator = 'creator1028554796'; + $lastUpdater = 'lastUpdater338699296'; + $expectedResponse = new SavedQuery(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastUpdater($lastUpdater); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $savedQuery = new SavedQuery(); + $savedQueryId = 'savedQueryId1290759850'; + $request = (new CreateSavedQueryRequest()) + ->setParent($formattedParent) + ->setSavedQuery($savedQuery) + ->setSavedQueryId($savedQueryId); + $response = $gapicClient->createSavedQuery($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/CreateSavedQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSavedQuery(); + $this->assertProtobufEquals($savedQuery, $actualValue); + $actualValue = $actualRequestObject->getSavedQueryId(); + $this->assertProtobufEquals($savedQueryId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSavedQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $savedQuery = new SavedQuery(); + $savedQueryId = 'savedQueryId1290759850'; + $request = (new CreateSavedQueryRequest()) + ->setParent($formattedParent) + ->setSavedQuery($savedQuery) + ->setSavedQueryId($savedQueryId); + try { + $gapicClient->createSavedQuery($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteFeedTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->feedName('[PROJECT]', '[FEED]'); + $request = (new DeleteFeedRequest()) + ->setName($formattedName); + $gapicClient->deleteFeed($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/DeleteFeed', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteFeedExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->feedName('[PROJECT]', '[FEED]'); + $request = (new DeleteFeedRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteFeed($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSavedQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->savedQueryName('[PROJECT]', '[SAVED_QUERY]'); + $request = (new DeleteSavedQueryRequest()) + ->setName($formattedName); + $gapicClient->deleteSavedQuery($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/DeleteSavedQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSavedQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->savedQueryName('[PROJECT]', '[SAVED_QUERY]'); + $request = (new DeleteSavedQueryRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteSavedQuery($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function exportAssetsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportAssetsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ExportAssetsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportAssetsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $outputConfig = new OutputConfig(); + $request = (new ExportAssetsRequest()) + ->setParent($parent) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportAssets($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/ExportAssets', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportAssetsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportAssetsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportAssetsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $outputConfig = new OutputConfig(); + $request = (new ExportAssetsRequest()) + ->setParent($parent) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportAssets($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportAssetsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getFeedTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Feed(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->feedName('[PROJECT]', '[FEED]'); + $request = (new GetFeedRequest()) + ->setName($formattedName); + $response = $gapicClient->getFeed($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/GetFeed', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFeedExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->feedName('[PROJECT]', '[FEED]'); + $request = (new GetFeedRequest()) + ->setName($formattedName); + try { + $gapicClient->getFeed($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSavedQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $creator = 'creator1028554796'; + $lastUpdater = 'lastUpdater338699296'; + $expectedResponse = new SavedQuery(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastUpdater($lastUpdater); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->savedQueryName('[PROJECT]', '[SAVED_QUERY]'); + $request = (new GetSavedQueryRequest()) + ->setName($formattedName); + $response = $gapicClient->getSavedQuery($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/GetSavedQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSavedQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->savedQueryName('[PROJECT]', '[SAVED_QUERY]'); + $request = (new GetSavedQueryRequest()) + ->setName($formattedName); + try { + $gapicClient->getSavedQuery($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAssetsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $assetsElement = new Asset(); + $assets = [ + $assetsElement, + ]; + $expectedResponse = new ListAssetsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAssets($assets); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListAssetsRequest()) + ->setParent($parent); + $response = $gapicClient->listAssets($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAssets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/ListAssets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAssetsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListAssetsRequest()) + ->setParent($parent); + try { + $gapicClient->listAssets($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFeedsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListFeedsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListFeedsRequest()) + ->setParent($parent); + $response = $gapicClient->listFeeds($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/ListFeeds', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFeedsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListFeedsRequest()) + ->setParent($parent); + try { + $gapicClient->listFeeds($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSavedQueriesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $savedQueriesElement = new SavedQuery(); + $savedQueries = [ + $savedQueriesElement, + ]; + $expectedResponse = new ListSavedQueriesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSavedQueries($savedQueries); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListSavedQueriesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listSavedQueries($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSavedQueries()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/ListSavedQueries', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSavedQueriesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListSavedQueriesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listSavedQueries($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function queryAssetsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $jobReference = 'jobReference-2014311095'; + $done = true; + $expectedResponse = new QueryAssetsResponse(); + $expectedResponse->setJobReference($jobReference); + $expectedResponse->setDone($done); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new QueryAssetsRequest()) + ->setParent($parent); + $response = $gapicClient->queryAssets($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/QueryAssets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function queryAssetsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new QueryAssetsRequest()) + ->setParent($parent); + try { + $gapicClient->queryAssets($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchAllIamPoliciesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $resultsElement = new IamPolicySearchResult(); + $results = [ + $resultsElement, + ]; + $expectedResponse = new SearchAllIamPoliciesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResults($results); + $transport->addResponse($expectedResponse); + // Mock request + $scope = 'scope109264468'; + $request = (new SearchAllIamPoliciesRequest()) + ->setScope($scope); + $response = $gapicClient->searchAllIamPolicies($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/SearchAllIamPolicies', $actualFuncCall); + $actualValue = $actualRequestObject->getScope(); + $this->assertProtobufEquals($scope, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchAllIamPoliciesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $scope = 'scope109264468'; + $request = (new SearchAllIamPoliciesRequest()) + ->setScope($scope); + try { + $gapicClient->searchAllIamPolicies($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchAllResourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $resultsElement = new ResourceSearchResult(); + $results = [ + $resultsElement, + ]; + $expectedResponse = new SearchAllResourcesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResults($results); + $transport->addResponse($expectedResponse); + // Mock request + $scope = 'scope109264468'; + $request = (new SearchAllResourcesRequest()) + ->setScope($scope); + $response = $gapicClient->searchAllResources($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/SearchAllResources', $actualFuncCall); + $actualValue = $actualRequestObject->getScope(); + $this->assertProtobufEquals($scope, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchAllResourcesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $scope = 'scope109264468'; + $request = (new SearchAllResourcesRequest()) + ->setScope($scope); + try { + $gapicClient->searchAllResources($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateFeedTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Feed(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $feed = new Feed(); + $feedName = 'feedName-192096951'; + $feed->setName($feedName); + $feedFeedOutputConfig = new FeedOutputConfig(); + $feed->setFeedOutputConfig($feedFeedOutputConfig); + $updateMask = new FieldMask(); + $request = (new UpdateFeedRequest()) + ->setFeed($feed) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateFeed($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/UpdateFeed', $actualFuncCall); + $actualValue = $actualRequestObject->getFeed(); + $this->assertProtobufEquals($feed, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateFeedExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $feed = new Feed(); + $feedName = 'feedName-192096951'; + $feed->setName($feedName); + $feedFeedOutputConfig = new FeedOutputConfig(); + $feed->setFeedOutputConfig($feedFeedOutputConfig); + $updateMask = new FieldMask(); + $request = (new UpdateFeedRequest()) + ->setFeed($feed) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateFeed($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSavedQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $creator = 'creator1028554796'; + $lastUpdater = 'lastUpdater338699296'; + $expectedResponse = new SavedQuery(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastUpdater($lastUpdater); + $transport->addResponse($expectedResponse); + // Mock request + $savedQuery = new SavedQuery(); + $updateMask = new FieldMask(); + $request = (new UpdateSavedQueryRequest()) + ->setSavedQuery($savedQuery) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateSavedQuery($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/UpdateSavedQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getSavedQuery(); + $this->assertProtobufEquals($savedQuery, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSavedQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $savedQuery = new SavedQuery(); + $updateMask = new FieldMask(); + $request = (new UpdateSavedQueryRequest()) + ->setSavedQuery($savedQuery) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateSavedQuery($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeIamPolicyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $fullyExplored = true; + $expectedResponse = new AnalyzeIamPolicyResponse(); + $expectedResponse->setFullyExplored($fullyExplored); + $transport->addResponse($expectedResponse); + // Mock request + $analysisQuery = new IamPolicyAnalysisQuery(); + $analysisQueryScope = 'analysisQueryScope-495018392'; + $analysisQuery->setScope($analysisQueryScope); + $request = (new AnalyzeIamPolicyRequest()) + ->setAnalysisQuery($analysisQuery); + $response = $gapicClient->analyzeIamPolicyAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.asset.v1.AssetService/AnalyzeIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getAnalysisQuery(); + $this->assertProtobufEquals($analysisQuery, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/GPBMetadata/Google/Cloud/Assuredworkloads/V1/Assuredworkloads.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/GPBMetadata/Google/Cloud/Assuredworkloads/V1/Assuredworkloads.php new file mode 100644 index 000000000000..a1f644afd808 Binary files /dev/null and b/owl-bot-staging/AssuredWorkloads/v1/proto/src/GPBMetadata/Google/Cloud/Assuredworkloads/V1/Assuredworkloads.php differ diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/AcknowledgeViolationRequest.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/AcknowledgeViolationRequest.php new file mode 100644 index 000000000000..0be4636db1af --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/AcknowledgeViolationRequest.php @@ -0,0 +1,173 @@ +google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + */ +class AcknowledgeViolationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Violation to acknowledge. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. Business justification explaining the need for violation acknowledgement + * + * Generated from protobuf field string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $comment = ''; + /** + * Optional. This field is deprecated and will be removed in future version of the API. + * Name of the OrgPolicy which was modified with non-compliant change and + * resulted in this violation. + * Format: + * projects/{project_number}/policies/{constraint_name} + * folders/{folder_id}/policies/{constraint_name} + * organizations/{organization_id}/policies/{constraint_name} + * + * Generated from protobuf field string non_compliant_org_policy = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $non_compliant_org_policy = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Violation to acknowledge. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * @type string $comment + * Required. Business justification explaining the need for violation acknowledgement + * @type string $non_compliant_org_policy + * Optional. This field is deprecated and will be removed in future version of the API. + * Name of the OrgPolicy which was modified with non-compliant change and + * resulted in this violation. + * Format: + * projects/{project_number}/policies/{constraint_name} + * folders/{folder_id}/policies/{constraint_name} + * organizations/{organization_id}/policies/{constraint_name} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Violation to acknowledge. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Violation to acknowledge. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Business justification explaining the need for violation acknowledgement + * + * Generated from protobuf field string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getComment() + { + return $this->comment; + } + + /** + * Required. Business justification explaining the need for violation acknowledgement + * + * Generated from protobuf field string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setComment($var) + { + GPBUtil::checkString($var, True); + $this->comment = $var; + + return $this; + } + + /** + * Optional. This field is deprecated and will be removed in future version of the API. + * Name of the OrgPolicy which was modified with non-compliant change and + * resulted in this violation. + * Format: + * projects/{project_number}/policies/{constraint_name} + * folders/{folder_id}/policies/{constraint_name} + * organizations/{organization_id}/policies/{constraint_name} + * + * Generated from protobuf field string non_compliant_org_policy = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return string + * @deprecated + */ + public function getNonCompliantOrgPolicy() + { + @trigger_error('non_compliant_org_policy is deprecated.', E_USER_DEPRECATED); + return $this->non_compliant_org_policy; + } + + /** + * Optional. This field is deprecated and will be removed in future version of the API. + * Name of the OrgPolicy which was modified with non-compliant change and + * resulted in this violation. + * Format: + * projects/{project_number}/policies/{constraint_name} + * folders/{folder_id}/policies/{constraint_name} + * organizations/{organization_id}/policies/{constraint_name} + * + * Generated from protobuf field string non_compliant_org_policy = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + * @deprecated + */ + public function setNonCompliantOrgPolicy($var) + { + @trigger_error('non_compliant_org_policy is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->non_compliant_org_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/AcknowledgeViolationResponse.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/AcknowledgeViolationResponse.php new file mode 100644 index 000000000000..f8958f14d1b6 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/AcknowledgeViolationResponse.php @@ -0,0 +1,33 @@ +google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + */ +class AcknowledgeViolationResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/CreateWorkloadOperationMetadata.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/CreateWorkloadOperationMetadata.php new file mode 100644 index 000000000000..1a4b40123dbc --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/CreateWorkloadOperationMetadata.php @@ -0,0 +1,183 @@ +google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + */ +class CreateWorkloadOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Time when the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $create_time = null; + /** + * Optional. The display name of the workload. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. The parent of the workload. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $parent = ''; + /** + * Optional. Compliance controls that should be applied to the resources managed by + * the workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $compliance_regime = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Optional. Time when the operation was created. + * @type string $display_name + * Optional. The display name of the workload. + * @type string $parent + * Optional. The parent of the workload. + * @type int $compliance_regime + * Optional. Compliance controls that should be applied to the resources managed by + * the workload. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Time when the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Optional. Time when the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Optional. The display name of the workload. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. The display name of the workload. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The parent of the workload. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Optional. The parent of the workload. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Compliance controls that should be applied to the resources managed by + * the workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getComplianceRegime() + { + return $this->compliance_regime; + } + + /** + * Optional. Compliance controls that should be applied to the resources managed by + * the workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setComplianceRegime($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1\Workload\ComplianceRegime::class); + $this->compliance_regime = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/CreateWorkloadRequest.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/CreateWorkloadRequest.php new file mode 100644 index 000000000000..be66d2add195 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/CreateWorkloadRequest.php @@ -0,0 +1,178 @@ +google.cloud.assuredworkloads.v1.CreateWorkloadRequest + */ +class CreateWorkloadRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Assured Workload to create + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $workload = null; + /** + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * + * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_id = ''; + + /** + * @param string $parent Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. Please see + * {@see AssuredWorkloadsServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\AssuredWorkloads\V1\Workload $workload Required. Assured Workload to create + * + * @return \Google\Cloud\AssuredWorkloads\V1\CreateWorkloadRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AssuredWorkloads\V1\Workload $workload): self + { + return (new self()) + ->setParent($parent) + ->setWorkload($workload); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * @type \Google\Cloud\AssuredWorkloads\V1\Workload $workload + * Required. Assured Workload to create + * @type string $external_id + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Assured Workload to create + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AssuredWorkloads\V1\Workload|null + */ + public function getWorkload() + { + return $this->workload; + } + + public function hasWorkload() + { + return isset($this->workload); + } + + public function clearWorkload() + { + unset($this->workload); + } + + /** + * Required. Assured Workload to create + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AssuredWorkloads\V1\Workload $var + * @return $this + */ + public function setWorkload($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1\Workload::class); + $this->workload = $var; + + return $this; + } + + /** + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * + * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getExternalId() + { + return $this->external_id; + } + + /** + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * + * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setExternalId($var) + { + GPBUtil::checkString($var, True); + $this->external_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/DeleteWorkloadRequest.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/DeleteWorkloadRequest.php new file mode 100644 index 000000000000..2c5dfe38cdf4 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/DeleteWorkloadRequest.php @@ -0,0 +1,129 @@ +google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + */ +class DeleteWorkloadRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * @param string $name Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * Please see {@see AssuredWorkloadsServiceClient::workloadName()} for help formatting this field. + * + * @return \Google\Cloud\AssuredWorkloads\V1\DeleteWorkloadRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @type string $etag + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/GetViolationRequest.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/GetViolationRequest.php new file mode 100644 index 000000000000..6790c069eb29 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/GetViolationRequest.php @@ -0,0 +1,91 @@ +google.cloud.assuredworkloads.v1.GetViolationRequest + */ +class GetViolationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Violation to fetch (ie. Violation.name). + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Violation to fetch (ie. Violation.name). + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * Please see {@see AssuredWorkloadsServiceClient::violationName()} for help formatting this field. + * + * @return \Google\Cloud\AssuredWorkloads\V1\GetViolationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Violation to fetch (ie. Violation.name). + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Violation to fetch (ie. Violation.name). + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Violation to fetch (ie. Violation.name). + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/GetWorkloadRequest.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/GetWorkloadRequest.php new file mode 100644 index 000000000000..96dccb40d104 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/GetWorkloadRequest.php @@ -0,0 +1,101 @@ +google.cloud.assuredworkloads.v1.GetWorkloadRequest + */ +class GetWorkloadRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Workload to fetch. This is the workload's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Workload to fetch. This is the workload's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". Please see + * {@see AssuredWorkloadsServiceClient::workloadName()} for help formatting this field. + * + * @return \Google\Cloud\AssuredWorkloads\V1\GetWorkloadRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Workload to fetch. This is the workload's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Workload to fetch. This is the workload's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Workload to fetch. This is the workload's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListViolationsRequest.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListViolationsRequest.php new file mode 100644 index 000000000000..deeba4814a66 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListViolationsRequest.php @@ -0,0 +1,240 @@ +google.cloud.assuredworkloads.v1.ListViolationsRequest + */ +class ListViolationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Workload name. + * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Specifies the time window for retrieving active Violations. + * When specified, retrieves Violations that were active between start_time + * and end_time. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $interval = null; + /** + * Optional. Page size. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Page token returned from previous request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A custom filter for filtering by the Violations properties. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The Workload name. + * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. Please see + * {@see AssuredWorkloadsServiceClient::workloadName()} for help formatting this field. + * + * @return \Google\Cloud\AssuredWorkloads\V1\ListViolationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The Workload name. + * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. + * @type \Google\Cloud\AssuredWorkloads\V1\TimeWindow $interval + * Optional. Specifies the time window for retrieving active Violations. + * When specified, retrieves Violations that were active between start_time + * and end_time. + * @type int $page_size + * Optional. Page size. + * @type string $page_token + * Optional. Page token returned from previous request. + * @type string $filter + * Optional. A custom filter for filtering by the Violations properties. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Workload name. + * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The Workload name. + * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Specifies the time window for retrieving active Violations. + * When specified, retrieves Violations that were active between start_time + * and end_time. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AssuredWorkloads\V1\TimeWindow|null + */ + public function getInterval() + { + return $this->interval; + } + + public function hasInterval() + { + return isset($this->interval); + } + + public function clearInterval() + { + unset($this->interval); + } + + /** + * Optional. Specifies the time window for retrieving active Violations. + * When specified, retrieves Violations that were active between start_time + * and end_time. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AssuredWorkloads\V1\TimeWindow $var + * @return $this + */ + public function setInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1\TimeWindow::class); + $this->interval = $var; + + return $this; + } + + /** + * Optional. Page size. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Page size. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Page token returned from previous request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Page token returned from previous request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A custom filter for filtering by the Violations properties. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A custom filter for filtering by the Violations properties. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListViolationsResponse.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListViolationsResponse.php new file mode 100644 index 000000000000..9cd32a438855 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListViolationsResponse.php @@ -0,0 +1,101 @@ +google.cloud.assuredworkloads.v1.ListViolationsResponse + */ +class ListViolationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of Violations under a Workload. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + private $violations; + /** + * The next page token. Returns empty if reached the last page. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AssuredWorkloads\V1\Violation>|\Google\Protobuf\Internal\RepeatedField $violations + * List of Violations under a Workload. + * @type string $next_page_token + * The next page token. Returns empty if reached the last page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * List of Violations under a Workload. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getViolations() + { + return $this->violations; + } + + /** + * List of Violations under a Workload. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + * @param array<\Google\Cloud\AssuredWorkloads\V1\Violation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setViolations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1\Violation::class); + $this->violations = $arr; + + return $this; + } + + /** + * The next page token. Returns empty if reached the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The next page token. Returns empty if reached the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListWorkloadsRequest.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListWorkloadsRequest.php new file mode 100644 index 000000000000..fc9101c054ff --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListWorkloadsRequest.php @@ -0,0 +1,200 @@ +google.cloud.assuredworkloads.v1.ListWorkloadsRequest + */ +class ListWorkloadsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + + /** + * @param string $parent Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. Please see + * {@see AssuredWorkloadsServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\AssuredWorkloads\V1\ListWorkloadsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * @type int $page_size + * Page size. + * @type string $page_token + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * @type string $filter + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListWorkloadsResponse.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListWorkloadsResponse.php new file mode 100644 index 000000000000..0c78b8bd31d0 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/ListWorkloadsResponse.php @@ -0,0 +1,101 @@ +google.cloud.assuredworkloads.v1.ListWorkloadsResponse + */ +class ListWorkloadsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of Workloads under a given parent. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload workloads = 1; + */ + private $workloads; + /** + * The next page token. Return empty if reached the last page. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AssuredWorkloads\V1\Workload>|\Google\Protobuf\Internal\RepeatedField $workloads + * List of Workloads under a given parent. + * @type string $next_page_token + * The next page token. Return empty if reached the last page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * List of Workloads under a given parent. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload workloads = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWorkloads() + { + return $this->workloads; + } + + /** + * List of Workloads under a given parent. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload workloads = 1; + * @param array<\Google\Cloud\AssuredWorkloads\V1\Workload>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWorkloads($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1\Workload::class); + $this->workloads = $arr; + + return $this; + } + + /** + * The next page token. Return empty if reached the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The next page token. Return empty if reached the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/RestrictAllowedResourcesRequest.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/RestrictAllowedResourcesRequest.php new file mode 100644 index 000000000000..12940165bbd3 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/RestrictAllowedResourcesRequest.php @@ -0,0 +1,117 @@ +google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + */ +class RestrictAllowedResourcesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The type of restriction for using gcp products in the Workload environment. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $restriction_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @type int $restriction_type + * Required. The type of restriction for using gcp products in the Workload environment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The type of restriction for using gcp products in the Workload environment. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getRestrictionType() + { + return $this->restriction_type; + } + + /** + * Required. The type of restriction for using gcp products in the Workload environment. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setRestrictionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1\RestrictAllowedResourcesRequest\RestrictionType::class); + $this->restriction_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/RestrictAllowedResourcesRequest/RestrictionType.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/RestrictAllowedResourcesRequest/RestrictionType.php new file mode 100644 index 000000000000..630c16506a1c --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/RestrictAllowedResourcesRequest/RestrictionType.php @@ -0,0 +1,68 @@ +google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + */ +class RestrictionType +{ + /** + * Unknown restriction type. + * + * Generated from protobuf enum RESTRICTION_TYPE_UNSPECIFIED = 0; + */ + const RESTRICTION_TYPE_UNSPECIFIED = 0; + /** + * Allow the use all of all gcp products, irrespective of the compliance + * posture. This effectively removes gcp.restrictServiceUsage OrgPolicy + * on the AssuredWorkloads Folder. + * + * Generated from protobuf enum ALLOW_ALL_GCP_RESOURCES = 1; + */ + const ALLOW_ALL_GCP_RESOURCES = 1; + /** + * Based on Workload's compliance regime, allowed list changes. + * See - https://cloud.google.com/assured-workloads/docs/supported-products + * for the list of supported resources. + * + * Generated from protobuf enum ALLOW_COMPLIANT_RESOURCES = 2; + */ + const ALLOW_COMPLIANT_RESOURCES = 2; + + private static $valueToName = [ + self::RESTRICTION_TYPE_UNSPECIFIED => 'RESTRICTION_TYPE_UNSPECIFIED', + self::ALLOW_ALL_GCP_RESOURCES => 'ALLOW_ALL_GCP_RESOURCES', + self::ALLOW_COMPLIANT_RESOURCES => 'ALLOW_COMPLIANT_RESOURCES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RestrictionType::class, \Google\Cloud\AssuredWorkloads\V1\RestrictAllowedResourcesRequest_RestrictionType::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/RestrictAllowedResourcesResponse.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/RestrictAllowedResourcesResponse.php new file mode 100644 index 000000000000..d1fa4eabe5f6 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/RestrictAllowedResourcesResponse.php @@ -0,0 +1,33 @@ +google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + */ +class RestrictAllowedResourcesResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/TimeWindow.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/TimeWindow.php new file mode 100644 index 000000000000..d85b5f8d271b --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/TimeWindow.php @@ -0,0 +1,121 @@ +google.cloud.assuredworkloads.v1.TimeWindow + */ +class TimeWindow extends \Google\Protobuf\Internal\Message +{ + /** + * The start of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The end of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The start of the time window. + * @type \Google\Protobuf\Timestamp $end_time + * The end of the time window. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * The start of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The start of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The end of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The end of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/UpdateWorkloadRequest.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/UpdateWorkloadRequest.php new file mode 100644 index 000000000000..686a9c01e44b --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/UpdateWorkloadRequest.php @@ -0,0 +1,151 @@ +google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + */ +class UpdateWorkloadRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The workload to update. + * The workload's `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $workload = null; + /** + * Required. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\AssuredWorkloads\V1\Workload $workload Required. The workload to update. + * The workload's `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to be updated. + * + * @return \Google\Cloud\AssuredWorkloads\V1\UpdateWorkloadRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AssuredWorkloads\V1\Workload $workload, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setWorkload($workload) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AssuredWorkloads\V1\Workload $workload + * Required. The workload to update. + * The workload's `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The workload to update. + * The workload's `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AssuredWorkloads\V1\Workload|null + */ + public function getWorkload() + { + return $this->workload; + } + + public function hasWorkload() + { + return isset($this->workload); + } + + public function clearWorkload() + { + unset($this->workload); + } + + /** + * Required. The workload to update. + * The workload's `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AssuredWorkloads\V1\Workload $var + * @return $this + */ + public function setWorkload($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1\Workload::class); + $this->workload = $var; + + return $this; + } + + /** + * Required. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation.php new file mode 100644 index 000000000000..513913ec2734 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation.php @@ -0,0 +1,623 @@ +google.cloud.assuredworkloads.v1.Violation + */ +class Violation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Immutable. Name of the Violation. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Output only. Description for the Violation. + * e.g. OrgPolicy gcp.resourceLocations has non compliant value. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = ''; + /** + * Output only. Time of the event which triggered the Violation. + * + * Generated from protobuf field .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $begin_time = null; + /** + * Output only. The last time when the Violation record was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Time of the event which fixed the Violation. + * If the violation is ACTIVE this will be empty. + * + * Generated from protobuf field .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $resolve_time = null; + /** + * Output only. Category under which this violation is mapped. + * e.g. Location, Service Usage, Access, Encryption, etc. + * + * Generated from protobuf field string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $category = ''; + /** + * Output only. State of the violation + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in + * this violation. + * + * Generated from protobuf field string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $org_policy_constraint = ''; + /** + * Output only. Immutable. Audit Log Link for violated resource + * Format: + * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder} + * + * Generated from protobuf field string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $audit_log_link = ''; + /** + * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and + * resulted this violation. + * Format: + * projects/{project_number}/policies/{constraint_name} + * folders/{folder_id}/policies/{constraint_name} + * organizations/{organization_id}/policies/{constraint_name} + * + * Generated from protobuf field string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $non_compliant_org_policy = ''; + /** + * Output only. Compliance violation remediation + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $remediation = null; + /** + * Output only. A boolean that indicates if the violation is acknowledged + * + * Generated from protobuf field bool acknowledged = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $acknowledged = false; + /** + * Optional. Timestamp when this violation was acknowledged last. + * This will be absent when acknowledged field is marked as false. + * + * Generated from protobuf field optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $acknowledgement_time = null; + /** + * Output only. Immutable. Audit Log link to find business justification provided for violation + * exception. Format: + * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization} + * + * Generated from protobuf field string exception_audit_log_link = 16 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $exception_audit_log_link = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Immutable. Name of the Violation. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id} + * @type string $description + * Output only. Description for the Violation. + * e.g. OrgPolicy gcp.resourceLocations has non compliant value. + * @type \Google\Protobuf\Timestamp $begin_time + * Output only. Time of the event which triggered the Violation. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last time when the Violation record was updated. + * @type \Google\Protobuf\Timestamp $resolve_time + * Output only. Time of the event which fixed the Violation. + * If the violation is ACTIVE this will be empty. + * @type string $category + * Output only. Category under which this violation is mapped. + * e.g. Location, Service Usage, Access, Encryption, etc. + * @type int $state + * Output only. State of the violation + * @type string $org_policy_constraint + * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in + * this violation. + * @type string $audit_log_link + * Output only. Immutable. Audit Log Link for violated resource + * Format: + * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder} + * @type string $non_compliant_org_policy + * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and + * resulted this violation. + * Format: + * projects/{project_number}/policies/{constraint_name} + * folders/{folder_id}/policies/{constraint_name} + * organizations/{organization_id}/policies/{constraint_name} + * @type \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation $remediation + * Output only. Compliance violation remediation + * @type bool $acknowledged + * Output only. A boolean that indicates if the violation is acknowledged + * @type \Google\Protobuf\Timestamp $acknowledgement_time + * Optional. Timestamp when this violation was acknowledged last. + * This will be absent when acknowledged field is marked as false. + * @type string $exception_audit_log_link + * Output only. Immutable. Audit Log link to find business justification provided for violation + * exception. Format: + * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Immutable. Name of the Violation. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Immutable. Name of the Violation. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Description for the Violation. + * e.g. OrgPolicy gcp.resourceLocations has non compliant value. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Output only. Description for the Violation. + * e.g. OrgPolicy gcp.resourceLocations has non compliant value. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Time of the event which triggered the Violation. + * + * Generated from protobuf field .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getBeginTime() + { + return $this->begin_time; + } + + public function hasBeginTime() + { + return isset($this->begin_time); + } + + public function clearBeginTime() + { + unset($this->begin_time); + } + + /** + * Output only. Time of the event which triggered the Violation. + * + * Generated from protobuf field .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setBeginTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->begin_time = $var; + + return $this; + } + + /** + * Output only. The last time when the Violation record was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last time when the Violation record was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Time of the event which fixed the Violation. + * If the violation is ACTIVE this will be empty. + * + * Generated from protobuf field .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getResolveTime() + { + return $this->resolve_time; + } + + public function hasResolveTime() + { + return isset($this->resolve_time); + } + + public function clearResolveTime() + { + unset($this->resolve_time); + } + + /** + * Output only. Time of the event which fixed the Violation. + * If the violation is ACTIVE this will be empty. + * + * Generated from protobuf field .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setResolveTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->resolve_time = $var; + + return $this; + } + + /** + * Output only. Category under which this violation is mapped. + * e.g. Location, Service Usage, Access, Encryption, etc. + * + * Generated from protobuf field string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCategory() + { + return $this->category; + } + + /** + * Output only. Category under which this violation is mapped. + * e.g. Location, Service Usage, Access, Encryption, etc. + * + * Generated from protobuf field string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkString($var, True); + $this->category = $var; + + return $this; + } + + /** + * Output only. State of the violation + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the violation + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1\Violation\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in + * this violation. + * + * Generated from protobuf field string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getOrgPolicyConstraint() + { + return $this->org_policy_constraint; + } + + /** + * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in + * this violation. + * + * Generated from protobuf field string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setOrgPolicyConstraint($var) + { + GPBUtil::checkString($var, True); + $this->org_policy_constraint = $var; + + return $this; + } + + /** + * Output only. Immutable. Audit Log Link for violated resource + * Format: + * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder} + * + * Generated from protobuf field string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getAuditLogLink() + { + return $this->audit_log_link; + } + + /** + * Output only. Immutable. Audit Log Link for violated resource + * Format: + * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder} + * + * Generated from protobuf field string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setAuditLogLink($var) + { + GPBUtil::checkString($var, True); + $this->audit_log_link = $var; + + return $this; + } + + /** + * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and + * resulted this violation. + * Format: + * projects/{project_number}/policies/{constraint_name} + * folders/{folder_id}/policies/{constraint_name} + * organizations/{organization_id}/policies/{constraint_name} + * + * Generated from protobuf field string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getNonCompliantOrgPolicy() + { + return $this->non_compliant_org_policy; + } + + /** + * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and + * resulted this violation. + * Format: + * projects/{project_number}/policies/{constraint_name} + * folders/{folder_id}/policies/{constraint_name} + * organizations/{organization_id}/policies/{constraint_name} + * + * Generated from protobuf field string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setNonCompliantOrgPolicy($var) + { + GPBUtil::checkString($var, True); + $this->non_compliant_org_policy = $var; + + return $this; + } + + /** + * Output only. Compliance violation remediation + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation|null + */ + public function getRemediation() + { + return $this->remediation; + } + + public function hasRemediation() + { + return isset($this->remediation); + } + + public function clearRemediation() + { + unset($this->remediation); + } + + /** + * Output only. Compliance violation remediation + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation $var + * @return $this + */ + public function setRemediation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation::class); + $this->remediation = $var; + + return $this; + } + + /** + * Output only. A boolean that indicates if the violation is acknowledged + * + * Generated from protobuf field bool acknowledged = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getAcknowledged() + { + return $this->acknowledged; + } + + /** + * Output only. A boolean that indicates if the violation is acknowledged + * + * Generated from protobuf field bool acknowledged = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setAcknowledged($var) + { + GPBUtil::checkBool($var); + $this->acknowledged = $var; + + return $this; + } + + /** + * Optional. Timestamp when this violation was acknowledged last. + * This will be absent when acknowledged field is marked as false. + * + * Generated from protobuf field optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getAcknowledgementTime() + { + return $this->acknowledgement_time; + } + + public function hasAcknowledgementTime() + { + return isset($this->acknowledgement_time); + } + + public function clearAcknowledgementTime() + { + unset($this->acknowledgement_time); + } + + /** + * Optional. Timestamp when this violation was acknowledged last. + * This will be absent when acknowledged field is marked as false. + * + * Generated from protobuf field optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setAcknowledgementTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->acknowledgement_time = $var; + + return $this; + } + + /** + * Output only. Immutable. Audit Log link to find business justification provided for violation + * exception. Format: + * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization} + * + * Generated from protobuf field string exception_audit_log_link = 16 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getExceptionAuditLogLink() + { + return $this->exception_audit_log_link; + } + + /** + * Output only. Immutable. Audit Log link to find business justification provided for violation + * exception. Format: + * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization} + * + * Generated from protobuf field string exception_audit_log_link = 16 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setExceptionAuditLogLink($var) + { + GPBUtil::checkString($var, True); + $this->exception_audit_log_link = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation.php new file mode 100644 index 000000000000..6a70f24bf5f4 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation.php @@ -0,0 +1,157 @@ +google.cloud.assuredworkloads.v1.Violation.Remediation + */ +class Remediation extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Remediation instructions to resolve violations + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instructions = null; + /** + * Values that can resolve the violation + * For example: for list org policy violations, this will either be the list + * of allowed or denied values + * + * Generated from protobuf field repeated string compliant_values = 2; + */ + private $compliant_values; + /** + * Output only. Reemediation type based on the type of org policy values violated + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $remediation_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions $instructions + * Required. Remediation instructions to resolve violations + * @type array|\Google\Protobuf\Internal\RepeatedField $compliant_values + * Values that can resolve the violation + * For example: for list org policy violations, this will either be the list + * of allowed or denied values + * @type int $remediation_type + * Output only. Reemediation type based on the type of org policy values violated + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. Remediation instructions to resolve violations + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions|null + */ + public function getInstructions() + { + return $this->instructions; + } + + public function hasInstructions() + { + return isset($this->instructions); + } + + public function clearInstructions() + { + unset($this->instructions); + } + + /** + * Required. Remediation instructions to resolve violations + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions $var + * @return $this + */ + public function setInstructions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions::class); + $this->instructions = $var; + + return $this; + } + + /** + * Values that can resolve the violation + * For example: for list org policy violations, this will either be the list + * of allowed or denied values + * + * Generated from protobuf field repeated string compliant_values = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCompliantValues() + { + return $this->compliant_values; + } + + /** + * Values that can resolve the violation + * For example: for list org policy violations, this will either be the list + * of allowed or denied values + * + * Generated from protobuf field repeated string compliant_values = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCompliantValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->compliant_values = $arr; + + return $this; + } + + /** + * Output only. Reemediation type based on the type of org policy values violated + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRemediationType() + { + return $this->remediation_type; + } + + /** + * Output only. Reemediation type based on the type of org policy values violated + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRemediationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\RemediationType::class); + $this->remediation_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Remediation::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/Instructions.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/Instructions.php new file mode 100644 index 000000000000..531bdb233085 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/Instructions.php @@ -0,0 +1,124 @@ +google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + */ +class Instructions extends \Google\Protobuf\Internal\Message +{ + /** + * Remediation instructions to resolve violation via gcloud cli + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + */ + protected $gcloud_instructions = null; + /** + * Remediation instructions to resolve violation via cloud console + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + */ + protected $console_instructions = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions\Gcloud $gcloud_instructions + * Remediation instructions to resolve violation via gcloud cli + * @type \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions\Console $console_instructions + * Remediation instructions to resolve violation via cloud console + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Remediation instructions to resolve violation via gcloud cli + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * @return \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions\Gcloud|null + */ + public function getGcloudInstructions() + { + return $this->gcloud_instructions; + } + + public function hasGcloudInstructions() + { + return isset($this->gcloud_instructions); + } + + public function clearGcloudInstructions() + { + unset($this->gcloud_instructions); + } + + /** + * Remediation instructions to resolve violation via gcloud cli + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * @param \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions\Gcloud $var + * @return $this + */ + public function setGcloudInstructions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions\Gcloud::class); + $this->gcloud_instructions = $var; + + return $this; + } + + /** + * Remediation instructions to resolve violation via cloud console + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * @return \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions\Console|null + */ + public function getConsoleInstructions() + { + return $this->console_instructions; + } + + public function hasConsoleInstructions() + { + return isset($this->console_instructions); + } + + public function clearConsoleInstructions() + { + unset($this->console_instructions); + } + + /** + * Remediation instructions to resolve violation via cloud console + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * @param \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions\Console $var + * @return $this + */ + public function setConsoleInstructions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1\Violation\Remediation\Instructions\Console::class); + $this->console_instructions = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Instructions::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_Instructions::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/Instructions/Console.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/Instructions/Console.php new file mode 100644 index 000000000000..cdf9485e5183 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/Instructions/Console.php @@ -0,0 +1,138 @@ +google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + */ +class Console extends \Google\Protobuf\Internal\Message +{ + /** + * Link to console page where violations can be resolved + * + * Generated from protobuf field repeated string console_uris = 1; + */ + private $console_uris; + /** + * Steps to resolve violation via cloud console + * + * Generated from protobuf field repeated string steps = 2; + */ + private $steps; + /** + * Additional urls for more information about steps + * + * Generated from protobuf field repeated string additional_links = 3; + */ + private $additional_links; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $console_uris + * Link to console page where violations can be resolved + * @type array|\Google\Protobuf\Internal\RepeatedField $steps + * Steps to resolve violation via cloud console + * @type array|\Google\Protobuf\Internal\RepeatedField $additional_links + * Additional urls for more information about steps + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Link to console page where violations can be resolved + * + * Generated from protobuf field repeated string console_uris = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConsoleUris() + { + return $this->console_uris; + } + + /** + * Link to console page where violations can be resolved + * + * Generated from protobuf field repeated string console_uris = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConsoleUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->console_uris = $arr; + + return $this; + } + + /** + * Steps to resolve violation via cloud console + * + * Generated from protobuf field repeated string steps = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSteps() + { + return $this->steps; + } + + /** + * Steps to resolve violation via cloud console + * + * Generated from protobuf field repeated string steps = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSteps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->steps = $arr; + + return $this; + } + + /** + * Additional urls for more information about steps + * + * Generated from protobuf field repeated string additional_links = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdditionalLinks() + { + return $this->additional_links; + } + + /** + * Additional urls for more information about steps + * + * Generated from protobuf field repeated string additional_links = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdditionalLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->additional_links = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Console::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_Instructions_Console::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/Instructions/Gcloud.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/Instructions/Gcloud.php new file mode 100644 index 000000000000..d3d08eceacca --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/Instructions/Gcloud.php @@ -0,0 +1,138 @@ +google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + */ +class Gcloud extends \Google\Protobuf\Internal\Message +{ + /** + * Gcloud command to resolve violation + * + * Generated from protobuf field repeated string gcloud_commands = 1; + */ + private $gcloud_commands; + /** + * Steps to resolve violation via gcloud cli + * + * Generated from protobuf field repeated string steps = 2; + */ + private $steps; + /** + * Additional urls for more information about steps + * + * Generated from protobuf field repeated string additional_links = 3; + */ + private $additional_links; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $gcloud_commands + * Gcloud command to resolve violation + * @type array|\Google\Protobuf\Internal\RepeatedField $steps + * Steps to resolve violation via gcloud cli + * @type array|\Google\Protobuf\Internal\RepeatedField $additional_links + * Additional urls for more information about steps + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Gcloud command to resolve violation + * + * Generated from protobuf field repeated string gcloud_commands = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGcloudCommands() + { + return $this->gcloud_commands; + } + + /** + * Gcloud command to resolve violation + * + * Generated from protobuf field repeated string gcloud_commands = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGcloudCommands($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->gcloud_commands = $arr; + + return $this; + } + + /** + * Steps to resolve violation via gcloud cli + * + * Generated from protobuf field repeated string steps = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSteps() + { + return $this->steps; + } + + /** + * Steps to resolve violation via gcloud cli + * + * Generated from protobuf field repeated string steps = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSteps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->steps = $arr; + + return $this; + } + + /** + * Additional urls for more information about steps + * + * Generated from protobuf field repeated string additional_links = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdditionalLinks() + { + return $this->additional_links; + } + + /** + * Additional urls for more information about steps + * + * Generated from protobuf field repeated string additional_links = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdditionalLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->additional_links = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Gcloud::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_Instructions_Gcloud::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/RemediationType.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/RemediationType.php new file mode 100644 index 000000000000..838ccee58368 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/Remediation/RemediationType.php @@ -0,0 +1,83 @@ +google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType + */ +class RemediationType +{ + /** + * Unspecified remediation type + * + * Generated from protobuf enum REMEDIATION_TYPE_UNSPECIFIED = 0; + */ + const REMEDIATION_TYPE_UNSPECIFIED = 0; + /** + * Remediation type for boolean org policy + * + * Generated from protobuf enum REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + */ + const REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + /** + * Remediation type for list org policy which have allowed values in the + * monitoring rule + * + * Generated from protobuf enum REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + */ + const REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + /** + * Remediation type for list org policy which have denied values in the + * monitoring rule + * + * Generated from protobuf enum REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + */ + const REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + /** + * Remediation type for gcp.restrictCmekCryptoKeyProjects + * + * Generated from protobuf enum REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + */ + const REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + + private static $valueToName = [ + self::REMEDIATION_TYPE_UNSPECIFIED => 'REMEDIATION_TYPE_UNSPECIFIED', + self::REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION => 'REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION', + self::REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION => 'REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION', + self::REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION => 'REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION', + self::REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION => 'REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RemediationType::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_RemediationType::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/State.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/State.php new file mode 100644 index 000000000000..3dffecec7cbf --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Violation/State.php @@ -0,0 +1,71 @@ +google.cloud.assuredworkloads.v1.Violation.State + */ +class State +{ + /** + * Unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Violation is resolved. + * + * Generated from protobuf enum RESOLVED = 2; + */ + const RESOLVED = 2; + /** + * Violation is Unresolved + * + * Generated from protobuf enum UNRESOLVED = 3; + */ + const UNRESOLVED = 3; + /** + * Violation is Exception + * + * Generated from protobuf enum EXCEPTION = 4; + */ + const EXCEPTION = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::RESOLVED => 'RESOLVED', + self::UNRESOLVED => 'UNRESOLVED', + self::EXCEPTION => 'EXCEPTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\AssuredWorkloads\V1\Violation_State::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload.php new file mode 100644 index 000000000000..134a7e8f8a3b --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload.php @@ -0,0 +1,755 @@ +google.cloud.assuredworkloads.v1.Workload + */ +class Workload extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The resource name of the workload. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload} + * Read-only. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Required. The user-assigned display name of the Workload. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, and spaces. + * Example: My Workload + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Output only. The resources associated with this workload. + * These resources will be created when creating the workload. + * If any of the projects already exist, the workload creation will fail. + * Always read only. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $resources; + /** + * Required. Immutable. Compliance Regime associated with this workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $compliance_regime = 0; + /** + * Output only. Immutable. The Workload creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $create_time = null; + /** + * Optional. The billing account used for the resources which are + * direct children of workload. This billing account is initially associated + * with the resources created as part of Workload creation. + * After the initial creation of these resources, the customer can change + * the assigned billing account. + * The resource name has the form + * `billingAccounts/{billing_account_id}`. For example, + * `billingAccounts/012345-567890-ABCDEF`. + * + * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $billing_account = ''; + /** + * Optional. ETag of the workload, it is calculated on the basis + * of the Workload contents. It will be used in Update & Delete operations. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. Labels applied to the workload. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Input only. The parent resource for the resources managed by this Assured Workload. May + * be either empty or a folder resource which is a child of the + * Workload parent. If not specified all resources are created under the + * parent organization. + * Format: + * folders/{folder_id} + * + * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $provisioned_resources_parent = ''; + /** + * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS + * CMEK key is provisioned. + * This field is deprecated as of Feb 28, 2022. + * In order to create a Keyring, callers should specify, + * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @deprecated + */ + protected $kms_settings = null; + /** + * Input only. Resource properties that are used to customize workload resources. + * These properties (such as custom project id) will be used to create + * workload resources if possible. This field is optional. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private $resource_settings; + /** + * Output only. Represents the KAJ enrollment state of the given workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $kaj_enrollment_state = 0; + /** + * Optional. Indicates the sovereignty status of the given workload. + * Currently meant to be used by Europe/Canada customers. + * + * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_sovereign_controls = false; + /** + * Output only. Represents the SAA enrollment response of the given workload. + * SAA enrollment response is queried during GetWorkload call. + * In failure cases, user friendly error message is shown in SAA details page. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $saa_enrollment_response = null; + /** + * Output only. Urls for services which are compliant for this Assured Workload, but which + * are currently disallowed by the ResourceUsageRestriction org policy. + * Invoke RestrictAllowedResources endpoint to allow your project developers + * to use these services in their environment." + * + * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $compliant_but_disallowed_services; + /** + * Optional. Compliance Regime associated with this workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $partner = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The resource name of the workload. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload} + * Read-only. + * @type string $display_name + * Required. The user-assigned display name of the Workload. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, and spaces. + * Example: My Workload + * @type array<\Google\Cloud\AssuredWorkloads\V1\Workload\ResourceInfo>|\Google\Protobuf\Internal\RepeatedField $resources + * Output only. The resources associated with this workload. + * These resources will be created when creating the workload. + * If any of the projects already exist, the workload creation will fail. + * Always read only. + * @type int $compliance_regime + * Required. Immutable. Compliance Regime associated with this workload. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Immutable. The Workload creation timestamp. + * @type string $billing_account + * Optional. The billing account used for the resources which are + * direct children of workload. This billing account is initially associated + * with the resources created as part of Workload creation. + * After the initial creation of these resources, the customer can change + * the assigned billing account. + * The resource name has the form + * `billingAccounts/{billing_account_id}`. For example, + * `billingAccounts/012345-567890-ABCDEF`. + * @type string $etag + * Optional. ETag of the workload, it is calculated on the basis + * of the Workload contents. It will be used in Update & Delete operations. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels applied to the workload. + * @type string $provisioned_resources_parent + * Input only. The parent resource for the resources managed by this Assured Workload. May + * be either empty or a folder resource which is a child of the + * Workload parent. If not specified all resources are created under the + * parent organization. + * Format: + * folders/{folder_id} + * @type \Google\Cloud\AssuredWorkloads\V1\Workload\KMSSettings $kms_settings + * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS + * CMEK key is provisioned. + * This field is deprecated as of Feb 28, 2022. + * In order to create a Keyring, callers should specify, + * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. + * @type array<\Google\Cloud\AssuredWorkloads\V1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $resource_settings + * Input only. Resource properties that are used to customize workload resources. + * These properties (such as custom project id) will be used to create + * workload resources if possible. This field is optional. + * @type int $kaj_enrollment_state + * Output only. Represents the KAJ enrollment state of the given workload. + * @type bool $enable_sovereign_controls + * Optional. Indicates the sovereignty status of the given workload. + * Currently meant to be used by Europe/Canada customers. + * @type \Google\Cloud\AssuredWorkloads\V1\Workload\SaaEnrollmentResponse $saa_enrollment_response + * Output only. Represents the SAA enrollment response of the given workload. + * SAA enrollment response is queried during GetWorkload call. + * In failure cases, user friendly error message is shown in SAA details page. + * @type array|\Google\Protobuf\Internal\RepeatedField $compliant_but_disallowed_services + * Output only. Urls for services which are compliant for this Assured Workload, but which + * are currently disallowed by the ResourceUsageRestriction org policy. + * Invoke RestrictAllowedResources endpoint to allow your project developers + * to use these services in their environment." + * @type int $partner + * Optional. Compliance Regime associated with this workload. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The resource name of the workload. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload} + * Read-only. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The resource name of the workload. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload} + * Read-only. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The user-assigned display name of the Workload. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, and spaces. + * Example: My Workload + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The user-assigned display name of the Workload. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, and spaces. + * Example: My Workload + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The resources associated with this workload. + * These resources will be created when creating the workload. + * If any of the projects already exist, the workload creation will fail. + * Always read only. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResources() + { + return $this->resources; + } + + /** + * Output only. The resources associated with this workload. + * These resources will be created when creating the workload. + * If any of the projects already exist, the workload creation will fail. + * Always read only. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\AssuredWorkloads\V1\Workload\ResourceInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1\Workload\ResourceInfo::class); + $this->resources = $arr; + + return $this; + } + + /** + * Required. Immutable. Compliance Regime associated with this workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getComplianceRegime() + { + return $this->compliance_regime; + } + + /** + * Required. Immutable. Compliance Regime associated with this workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setComplianceRegime($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1\Workload\ComplianceRegime::class); + $this->compliance_regime = $var; + + return $this; + } + + /** + * Output only. Immutable. The Workload creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Immutable. The Workload creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Optional. The billing account used for the resources which are + * direct children of workload. This billing account is initially associated + * with the resources created as part of Workload creation. + * After the initial creation of these resources, the customer can change + * the assigned billing account. + * The resource name has the form + * `billingAccounts/{billing_account_id}`. For example, + * `billingAccounts/012345-567890-ABCDEF`. + * + * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBillingAccount() + { + return $this->billing_account; + } + + /** + * Optional. The billing account used for the resources which are + * direct children of workload. This billing account is initially associated + * with the resources created as part of Workload creation. + * After the initial creation of these resources, the customer can change + * the assigned billing account. + * The resource name has the form + * `billingAccounts/{billing_account_id}`. For example, + * `billingAccounts/012345-567890-ABCDEF`. + * + * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBillingAccount($var) + { + GPBUtil::checkString($var, True); + $this->billing_account = $var; + + return $this; + } + + /** + * Optional. ETag of the workload, it is calculated on the basis + * of the Workload contents. It will be used in Update & Delete operations. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. ETag of the workload, it is calculated on the basis + * of the Workload contents. It will be used in Update & Delete operations. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. Labels applied to the workload. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels applied to the workload. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Input only. The parent resource for the resources managed by this Assured Workload. May + * be either empty or a folder resource which is a child of the + * Workload parent. If not specified all resources are created under the + * parent organization. + * Format: + * folders/{folder_id} + * + * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getProvisionedResourcesParent() + { + return $this->provisioned_resources_parent; + } + + /** + * Input only. The parent resource for the resources managed by this Assured Workload. May + * be either empty or a folder resource which is a child of the + * Workload parent. If not specified all resources are created under the + * parent organization. + * Format: + * folders/{folder_id} + * + * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setProvisionedResourcesParent($var) + { + GPBUtil::checkString($var, True); + $this->provisioned_resources_parent = $var; + + return $this; + } + + /** + * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS + * CMEK key is provisioned. + * This field is deprecated as of Feb 28, 2022. + * In order to create a Keyring, callers should specify, + * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\AssuredWorkloads\V1\Workload\KMSSettings|null + * @deprecated + */ + public function getKmsSettings() + { + @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); + return $this->kms_settings; + } + + public function hasKmsSettings() + { + @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); + return isset($this->kms_settings); + } + + public function clearKmsSettings() + { + @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); + unset($this->kms_settings); + } + + /** + * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS + * CMEK key is provisioned. + * This field is deprecated as of Feb 28, 2022. + * In order to create a Keyring, callers should specify, + * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\AssuredWorkloads\V1\Workload\KMSSettings $var + * @return $this + * @deprecated + */ + public function setKmsSettings($var) + { + @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1\Workload\KMSSettings::class); + $this->kms_settings = $var; + + return $this; + } + + /** + * Input only. Resource properties that are used to customize workload resources. + * These properties (such as custom project id) will be used to create + * workload resources if possible. This field is optional. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceSettings() + { + return $this->resource_settings; + } + + /** + * Input only. Resource properties that are used to customize workload resources. + * These properties (such as custom project id) will be used to create + * workload resources if possible. This field is optional. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param array<\Google\Cloud\AssuredWorkloads\V1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceSettings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1\Workload\ResourceSettings::class); + $this->resource_settings = $arr; + + return $this; + } + + /** + * Output only. Represents the KAJ enrollment state of the given workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getKajEnrollmentState() + { + return $this->kaj_enrollment_state; + } + + /** + * Output only. Represents the KAJ enrollment state of the given workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setKajEnrollmentState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1\Workload\KajEnrollmentState::class); + $this->kaj_enrollment_state = $var; + + return $this; + } + + /** + * Optional. Indicates the sovereignty status of the given workload. + * Currently meant to be used by Europe/Canada customers. + * + * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableSovereignControls() + { + return $this->enable_sovereign_controls; + } + + /** + * Optional. Indicates the sovereignty status of the given workload. + * Currently meant to be used by Europe/Canada customers. + * + * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableSovereignControls($var) + { + GPBUtil::checkBool($var); + $this->enable_sovereign_controls = $var; + + return $this; + } + + /** + * Output only. Represents the SAA enrollment response of the given workload. + * SAA enrollment response is queried during GetWorkload call. + * In failure cases, user friendly error message is shown in SAA details page. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AssuredWorkloads\V1\Workload\SaaEnrollmentResponse|null + */ + public function getSaaEnrollmentResponse() + { + return $this->saa_enrollment_response; + } + + public function hasSaaEnrollmentResponse() + { + return isset($this->saa_enrollment_response); + } + + public function clearSaaEnrollmentResponse() + { + unset($this->saa_enrollment_response); + } + + /** + * Output only. Represents the SAA enrollment response of the given workload. + * SAA enrollment response is queried during GetWorkload call. + * In failure cases, user friendly error message is shown in SAA details page. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AssuredWorkloads\V1\Workload\SaaEnrollmentResponse $var + * @return $this + */ + public function setSaaEnrollmentResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1\Workload\SaaEnrollmentResponse::class); + $this->saa_enrollment_response = $var; + + return $this; + } + + /** + * Output only. Urls for services which are compliant for this Assured Workload, but which + * are currently disallowed by the ResourceUsageRestriction org policy. + * Invoke RestrictAllowedResources endpoint to allow your project developers + * to use these services in their environment." + * + * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCompliantButDisallowedServices() + { + return $this->compliant_but_disallowed_services; + } + + /** + * Output only. Urls for services which are compliant for this Assured Workload, but which + * are currently disallowed by the ResourceUsageRestriction org policy. + * Invoke RestrictAllowedResources endpoint to allow your project developers + * to use these services in their environment." + * + * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCompliantButDisallowedServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->compliant_but_disallowed_services = $arr; + + return $this; + } + + /** + * Optional. Compliance Regime associated with this workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPartner() + { + return $this->partner; + } + + /** + * Optional. Compliance Regime associated with this workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPartner($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1\Workload\Partner::class); + $this->partner = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ComplianceRegime.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ComplianceRegime.php new file mode 100644 index 000000000000..f921eaced85e --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ComplianceRegime.php @@ -0,0 +1,136 @@ +google.cloud.assuredworkloads.v1.Workload.ComplianceRegime + */ +class ComplianceRegime +{ + /** + * Unknown compliance regime. + * + * Generated from protobuf enum COMPLIANCE_REGIME_UNSPECIFIED = 0; + */ + const COMPLIANCE_REGIME_UNSPECIFIED = 0; + /** + * Information protection as per DoD IL4 requirements. + * + * Generated from protobuf enum IL4 = 1; + */ + const IL4 = 1; + /** + * Criminal Justice Information Services (CJIS) Security policies. + * + * Generated from protobuf enum CJIS = 2; + */ + const CJIS = 2; + /** + * FedRAMP High data protection controls + * + * Generated from protobuf enum FEDRAMP_HIGH = 3; + */ + const FEDRAMP_HIGH = 3; + /** + * FedRAMP Moderate data protection controls + * + * Generated from protobuf enum FEDRAMP_MODERATE = 4; + */ + const FEDRAMP_MODERATE = 4; + /** + * Assured Workloads For US Regions data protection controls + * + * Generated from protobuf enum US_REGIONAL_ACCESS = 5; + */ + const US_REGIONAL_ACCESS = 5; + /** + * Health Insurance Portability and Accountability Act controls + * + * Generated from protobuf enum HIPAA = 6; + */ + const HIPAA = 6; + /** + * Health Information Trust Alliance controls + * + * Generated from protobuf enum HITRUST = 7; + */ + const HITRUST = 7; + /** + * Assured Workloads For EU Regions and Support controls + * + * Generated from protobuf enum EU_REGIONS_AND_SUPPORT = 8; + */ + const EU_REGIONS_AND_SUPPORT = 8; + /** + * Assured Workloads For Canada Regions and Support controls + * + * Generated from protobuf enum CA_REGIONS_AND_SUPPORT = 9; + */ + const CA_REGIONS_AND_SUPPORT = 9; + /** + * International Traffic in Arms Regulations + * + * Generated from protobuf enum ITAR = 10; + */ + const ITAR = 10; + /** + * Assured Workloads for Australia Regions and Support controls + * Available for public preview consumption. + * Don't create production workloads. + * + * Generated from protobuf enum AU_REGIONS_AND_US_SUPPORT = 11; + */ + const AU_REGIONS_AND_US_SUPPORT = 11; + /** + * Assured Workloads for Partners + * + * Generated from protobuf enum ASSURED_WORKLOADS_FOR_PARTNERS = 12; + */ + const ASSURED_WORKLOADS_FOR_PARTNERS = 12; + + private static $valueToName = [ + self::COMPLIANCE_REGIME_UNSPECIFIED => 'COMPLIANCE_REGIME_UNSPECIFIED', + self::IL4 => 'IL4', + self::CJIS => 'CJIS', + self::FEDRAMP_HIGH => 'FEDRAMP_HIGH', + self::FEDRAMP_MODERATE => 'FEDRAMP_MODERATE', + self::US_REGIONAL_ACCESS => 'US_REGIONAL_ACCESS', + self::HIPAA => 'HIPAA', + self::HITRUST => 'HITRUST', + self::EU_REGIONS_AND_SUPPORT => 'EU_REGIONS_AND_SUPPORT', + self::CA_REGIONS_AND_SUPPORT => 'CA_REGIONS_AND_SUPPORT', + self::ITAR => 'ITAR', + self::AU_REGIONS_AND_US_SUPPORT => 'AU_REGIONS_AND_US_SUPPORT', + self::ASSURED_WORKLOADS_FOR_PARTNERS => 'ASSURED_WORKLOADS_FOR_PARTNERS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ComplianceRegime::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ComplianceRegime::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/KMSSettings.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/KMSSettings.php new file mode 100644 index 000000000000..ff277045e5cb --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/KMSSettings.php @@ -0,0 +1,140 @@ +google.cloud.assuredworkloads.v1.Workload.KMSSettings + */ +class KMSSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + * new version of the crypto key and mark it as the primary. + * + * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $next_rotation_time = null; + /** + * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + * Management Service automatically rotates a key. Must be at least 24 hours + * and at most 876,000 hours. + * + * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $rotation_period = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $next_rotation_time + * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + * new version of the crypto key and mark it as the primary. + * @type \Google\Protobuf\Duration $rotation_period + * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + * Management Service automatically rotates a key. Must be at least 24 hours + * and at most 876,000 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + * new version of the crypto key and mark it as the primary. + * + * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getNextRotationTime() + { + return $this->next_rotation_time; + } + + public function hasNextRotationTime() + { + return isset($this->next_rotation_time); + } + + public function clearNextRotationTime() + { + unset($this->next_rotation_time); + } + + /** + * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + * new version of the crypto key and mark it as the primary. + * + * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setNextRotationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->next_rotation_time = $var; + + return $this; + } + + /** + * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + * Management Service automatically rotates a key. Must be at least 24 hours + * and at most 876,000 hours. + * + * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Duration|null + */ + public function getRotationPeriod() + { + return $this->rotation_period; + } + + public function hasRotationPeriod() + { + return isset($this->rotation_period); + } + + public function clearRotationPeriod() + { + unset($this->rotation_period); + } + + /** + * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + * Management Service automatically rotates a key. Must be at least 24 hours + * and at most 876,000 hours. + * + * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRotationPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->rotation_period = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KMSSettings::class, \Google\Cloud\AssuredWorkloads\V1\Workload_KMSSettings::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/KajEnrollmentState.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/KajEnrollmentState.php new file mode 100644 index 000000000000..5daeeb90a74f --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/KajEnrollmentState.php @@ -0,0 +1,64 @@ +google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState + */ +class KajEnrollmentState +{ + /** + * Default State for KAJ Enrollment. + * + * Generated from protobuf enum KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; + */ + const KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; + /** + * Pending State for KAJ Enrollment. + * + * Generated from protobuf enum KAJ_ENROLLMENT_STATE_PENDING = 1; + */ + const KAJ_ENROLLMENT_STATE_PENDING = 1; + /** + * Complete State for KAJ Enrollment. + * + * Generated from protobuf enum KAJ_ENROLLMENT_STATE_COMPLETE = 2; + */ + const KAJ_ENROLLMENT_STATE_COMPLETE = 2; + + private static $valueToName = [ + self::KAJ_ENROLLMENT_STATE_UNSPECIFIED => 'KAJ_ENROLLMENT_STATE_UNSPECIFIED', + self::KAJ_ENROLLMENT_STATE_PENDING => 'KAJ_ENROLLMENT_STATE_PENDING', + self::KAJ_ENROLLMENT_STATE_COMPLETE => 'KAJ_ENROLLMENT_STATE_COMPLETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KajEnrollmentState::class, \Google\Cloud\AssuredWorkloads\V1\Workload_KajEnrollmentState::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/Partner.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/Partner.php new file mode 100644 index 000000000000..b3ab77303ba3 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/Partner.php @@ -0,0 +1,57 @@ +google.cloud.assuredworkloads.v1.Workload.Partner + */ +class Partner +{ + /** + * Unknown partner regime/controls. + * + * Generated from protobuf enum PARTNER_UNSPECIFIED = 0; + */ + const PARTNER_UNSPECIFIED = 0; + /** + * S3NS regime/controls. + * + * Generated from protobuf enum LOCAL_CONTROLS_BY_S3NS = 1; + */ + const LOCAL_CONTROLS_BY_S3NS = 1; + + private static $valueToName = [ + self::PARTNER_UNSPECIFIED => 'PARTNER_UNSPECIFIED', + self::LOCAL_CONTROLS_BY_S3NS => 'LOCAL_CONTROLS_BY_S3NS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Partner::class, \Google\Cloud\AssuredWorkloads\V1\Workload_Partner::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ResourceInfo.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ResourceInfo.php new file mode 100644 index 000000000000..7d1d6d014207 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ResourceInfo.php @@ -0,0 +1,108 @@ +google.cloud.assuredworkloads.v1.Workload.ResourceInfo + */ +class ResourceInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Resource identifier. + * For a project this represents project_number. + * + * Generated from protobuf field int64 resource_id = 1; + */ + protected $resource_id = 0; + /** + * Indicates the type of resource. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType resource_type = 2; + */ + protected $resource_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $resource_id + * Resource identifier. + * For a project this represents project_number. + * @type int $resource_type + * Indicates the type of resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Resource identifier. + * For a project this represents project_number. + * + * Generated from protobuf field int64 resource_id = 1; + * @return int|string + */ + public function getResourceId() + { + return $this->resource_id; + } + + /** + * Resource identifier. + * For a project this represents project_number. + * + * Generated from protobuf field int64 resource_id = 1; + * @param int|string $var + * @return $this + */ + public function setResourceId($var) + { + GPBUtil::checkInt64($var); + $this->resource_id = $var; + + return $this; + } + + /** + * Indicates the type of resource. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType resource_type = 2; + * @return int + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * Indicates the type of resource. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType resource_type = 2; + * @param int $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1\Workload\ResourceInfo\ResourceType::class); + $this->resource_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResourceInfo::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ResourceInfo::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ResourceInfo/ResourceType.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ResourceInfo/ResourceType.php new file mode 100644 index 000000000000..dc3182744b09 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ResourceInfo/ResourceType.php @@ -0,0 +1,82 @@ +google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType + */ +class ResourceType +{ + /** + * Unknown resource type. + * + * Generated from protobuf enum RESOURCE_TYPE_UNSPECIFIED = 0; + */ + const RESOURCE_TYPE_UNSPECIFIED = 0; + /** + * Consumer project. + * AssuredWorkloads Projects are no longer supported. This field will be + * ignored only in CreateWorkload requests. ListWorkloads and GetWorkload + * will continue to provide projects information. + * Use CONSUMER_FOLDER instead. + * + * Generated from protobuf enum CONSUMER_PROJECT = 1 [deprecated = true]; + */ + const CONSUMER_PROJECT = 1; + /** + * Consumer Folder. + * + * Generated from protobuf enum CONSUMER_FOLDER = 4; + */ + const CONSUMER_FOLDER = 4; + /** + * Consumer project containing encryption keys. + * + * Generated from protobuf enum ENCRYPTION_KEYS_PROJECT = 2; + */ + const ENCRYPTION_KEYS_PROJECT = 2; + /** + * Keyring resource that hosts encryption keys. + * + * Generated from protobuf enum KEYRING = 3; + */ + const KEYRING = 3; + + private static $valueToName = [ + self::RESOURCE_TYPE_UNSPECIFIED => 'RESOURCE_TYPE_UNSPECIFIED', + self::CONSUMER_PROJECT => 'CONSUMER_PROJECT', + self::CONSUMER_FOLDER => 'CONSUMER_FOLDER', + self::ENCRYPTION_KEYS_PROJECT => 'ENCRYPTION_KEYS_PROJECT', + self::KEYRING => 'KEYRING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResourceType::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ResourceInfo_ResourceType::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ResourceSettings.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ResourceSettings.php new file mode 100644 index 000000000000..8383ef765da3 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/ResourceSettings.php @@ -0,0 +1,170 @@ +google.cloud.assuredworkloads.v1.Workload.ResourceSettings + */ +class ResourceSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Resource identifier. + * For a project this represents project_id. If the project is already + * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. + * + * Generated from protobuf field string resource_id = 1; + */ + protected $resource_id = ''; + /** + * Indicates the type of resource. This field should be specified to + * correspond the id to the right resource type (CONSUMER_FOLDER or + * ENCRYPTION_KEYS_PROJECT) + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType resource_type = 2; + */ + protected $resource_type = 0; + /** + * User-assigned resource display name. + * If not empty it will be used to create a resource with the specified + * name. + * + * Generated from protobuf field string display_name = 3; + */ + protected $display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource_id + * Resource identifier. + * For a project this represents project_id. If the project is already + * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. + * @type int $resource_type + * Indicates the type of resource. This field should be specified to + * correspond the id to the right resource type (CONSUMER_FOLDER or + * ENCRYPTION_KEYS_PROJECT) + * @type string $display_name + * User-assigned resource display name. + * If not empty it will be used to create a resource with the specified + * name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Resource identifier. + * For a project this represents project_id. If the project is already + * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. + * + * Generated from protobuf field string resource_id = 1; + * @return string + */ + public function getResourceId() + { + return $this->resource_id; + } + + /** + * Resource identifier. + * For a project this represents project_id. If the project is already + * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. + * + * Generated from protobuf field string resource_id = 1; + * @param string $var + * @return $this + */ + public function setResourceId($var) + { + GPBUtil::checkString($var, True); + $this->resource_id = $var; + + return $this; + } + + /** + * Indicates the type of resource. This field should be specified to + * correspond the id to the right resource type (CONSUMER_FOLDER or + * ENCRYPTION_KEYS_PROJECT) + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType resource_type = 2; + * @return int + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * Indicates the type of resource. This field should be specified to + * correspond the id to the right resource type (CONSUMER_FOLDER or + * ENCRYPTION_KEYS_PROJECT) + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType resource_type = 2; + * @param int $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1\Workload\ResourceInfo\ResourceType::class); + $this->resource_type = $var; + + return $this; + } + + /** + * User-assigned resource display name. + * If not empty it will be used to create a resource with the specified + * name. + * + * Generated from protobuf field string display_name = 3; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-assigned resource display name. + * If not empty it will be used to create a resource with the specified + * name. + * + * Generated from protobuf field string display_name = 3; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResourceSettings::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ResourceSettings::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/SaaEnrollmentResponse.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/SaaEnrollmentResponse.php new file mode 100644 index 000000000000..2adc6b7d7780 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/SaaEnrollmentResponse.php @@ -0,0 +1,114 @@ +google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + */ +class SaaEnrollmentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates SAA enrollment status of a given workload. + * + * Generated from protobuf field optional .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; + */ + protected $setup_status = null; + /** + * Indicates SAA enrollment setup error if any. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; + */ + private $setup_errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $setup_status + * Indicates SAA enrollment status of a given workload. + * @type array|\Google\Protobuf\Internal\RepeatedField $setup_errors + * Indicates SAA enrollment setup error if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Indicates SAA enrollment status of a given workload. + * + * Generated from protobuf field optional .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; + * @return int + */ + public function getSetupStatus() + { + return isset($this->setup_status) ? $this->setup_status : 0; + } + + public function hasSetupStatus() + { + return isset($this->setup_status); + } + + public function clearSetupStatus() + { + unset($this->setup_status); + } + + /** + * Indicates SAA enrollment status of a given workload. + * + * Generated from protobuf field optional .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; + * @param int $var + * @return $this + */ + public function setSetupStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1\Workload\SaaEnrollmentResponse\SetupState::class); + $this->setup_status = $var; + + return $this; + } + + /** + * Indicates SAA enrollment setup error if any. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSetupErrors() + { + return $this->setup_errors; + } + + /** + * Indicates SAA enrollment setup error if any. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSetupErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\AssuredWorkloads\V1\Workload\SaaEnrollmentResponse\SetupError::class); + $this->setup_errors = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SaaEnrollmentResponse::class, \Google\Cloud\AssuredWorkloads\V1\Workload_SaaEnrollmentResponse::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/SaaEnrollmentResponse/SetupError.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/SaaEnrollmentResponse/SetupError.php new file mode 100644 index 000000000000..6ced16897348 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/SaaEnrollmentResponse/SetupError.php @@ -0,0 +1,81 @@ +google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError + */ +class SetupError +{ + /** + * Unspecified. + * + * Generated from protobuf enum SETUP_ERROR_UNSPECIFIED = 0; + */ + const SETUP_ERROR_UNSPECIFIED = 0; + /** + * Invalid states for all customers, to be redirected to AA UI for + * additional details. + * + * Generated from protobuf enum ERROR_INVALID_BASE_SETUP = 1; + */ + const ERROR_INVALID_BASE_SETUP = 1; + /** + * Returned when there is not an EKM key configured. + * + * Generated from protobuf enum ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; + */ + const ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; + /** + * Returned when there are no enrolled services or the customer is + * enrolled in CAA only for a subset of services. + * + * Generated from protobuf enum ERROR_NOT_ALL_SERVICES_ENROLLED = 3; + */ + const ERROR_NOT_ALL_SERVICES_ENROLLED = 3; + /** + * Returned when exception was encountered during evaluation of other + * criteria. + * + * Generated from protobuf enum ERROR_SETUP_CHECK_FAILED = 4; + */ + const ERROR_SETUP_CHECK_FAILED = 4; + + private static $valueToName = [ + self::SETUP_ERROR_UNSPECIFIED => 'SETUP_ERROR_UNSPECIFIED', + self::ERROR_INVALID_BASE_SETUP => 'ERROR_INVALID_BASE_SETUP', + self::ERROR_MISSING_EXTERNAL_SIGNING_KEY => 'ERROR_MISSING_EXTERNAL_SIGNING_KEY', + self::ERROR_NOT_ALL_SERVICES_ENROLLED => 'ERROR_NOT_ALL_SERVICES_ENROLLED', + self::ERROR_SETUP_CHECK_FAILED => 'ERROR_SETUP_CHECK_FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SetupError::class, \Google\Cloud\AssuredWorkloads\V1\Workload_SaaEnrollmentResponse_SetupError::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/SaaEnrollmentResponse/SetupState.php b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/SaaEnrollmentResponse/SetupState.php new file mode 100644 index 000000000000..27112e59383a --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/proto/src/Google/Cloud/AssuredWorkloads/V1/Workload/SaaEnrollmentResponse/SetupState.php @@ -0,0 +1,64 @@ +google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState + */ +class SetupState +{ + /** + * Unspecified. + * + * Generated from protobuf enum SETUP_STATE_UNSPECIFIED = 0; + */ + const SETUP_STATE_UNSPECIFIED = 0; + /** + * SAA enrollment pending. + * + * Generated from protobuf enum STATUS_PENDING = 1; + */ + const STATUS_PENDING = 1; + /** + * SAA enrollment comopleted. + * + * Generated from protobuf enum STATUS_COMPLETE = 2; + */ + const STATUS_COMPLETE = 2; + + private static $valueToName = [ + self::SETUP_STATE_UNSPECIFIED => 'SETUP_STATE_UNSPECIFIED', + self::STATUS_PENDING => 'STATUS_PENDING', + self::STATUS_COMPLETE => 'STATUS_COMPLETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SetupState::class, \Google\Cloud\AssuredWorkloads\V1\Workload_SaaEnrollmentResponse_SetupState::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/acknowledge_violation.php b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/acknowledge_violation.php new file mode 100644 index 000000000000..9fa186961d47 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/acknowledge_violation.php @@ -0,0 +1,78 @@ +setName($name) + ->setComment($comment); + + // Call the API and handle any network failures. + try { + /** @var AcknowledgeViolationResponse $response */ + $response = $assuredWorkloadsServiceClient->acknowledgeViolation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $comment = '[COMMENT]'; + + acknowledge_violation_sample($name, $comment); +} +// [END assuredworkloads_v1_generated_AssuredWorkloadsService_AcknowledgeViolation_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/create_workload.php b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/create_workload.php new file mode 100644 index 000000000000..73d455b3660f --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/create_workload.php @@ -0,0 +1,101 @@ +setDisplayName($workloadDisplayName) + ->setComplianceRegime($workloadComplianceRegime); + $request = (new CreateWorkloadRequest()) + ->setParent($formattedParent) + ->setWorkload($workload); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $assuredWorkloadsServiceClient->createWorkload($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Workload $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AssuredWorkloadsServiceClient::locationName('[ORGANIZATION]', '[LOCATION]'); + $workloadDisplayName = '[DISPLAY_NAME]'; + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + + create_workload_sample($formattedParent, $workloadDisplayName, $workloadComplianceRegime); +} +// [END assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/delete_workload.php b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/delete_workload.php new file mode 100644 index 000000000000..29e6b12a3b8c --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/delete_workload.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $assuredWorkloadsServiceClient->deleteWorkload($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AssuredWorkloadsServiceClient::workloadName( + '[ORGANIZATION]', + '[LOCATION]', + '[WORKLOAD]' + ); + + delete_workload_sample($formattedName); +} +// [END assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/get_violation.php b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/get_violation.php new file mode 100644 index 000000000000..5326a0b9b957 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/get_violation.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Violation $response */ + $response = $assuredWorkloadsServiceClient->getViolation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AssuredWorkloadsServiceClient::violationName( + '[ORGANIZATION]', + '[LOCATION]', + '[WORKLOAD]', + '[VIOLATION]' + ); + + get_violation_sample($formattedName); +} +// [END assuredworkloads_v1_generated_AssuredWorkloadsService_GetViolation_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/get_workload.php b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/get_workload.php new file mode 100644 index 000000000000..b1be4c5a3dc7 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/get_workload.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Workload $response */ + $response = $assuredWorkloadsServiceClient->getWorkload($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AssuredWorkloadsServiceClient::workloadName( + '[ORGANIZATION]', + '[LOCATION]', + '[WORKLOAD]' + ); + + get_workload_sample($formattedName); +} +// [END assuredworkloads_v1_generated_AssuredWorkloadsService_GetWorkload_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/list_violations.php b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/list_violations.php new file mode 100644 index 000000000000..249e4ed2bddd --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/list_violations.php @@ -0,0 +1,85 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $assuredWorkloadsServiceClient->listViolations($request); + + /** @var Violation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AssuredWorkloadsServiceClient::workloadName( + '[ORGANIZATION]', + '[LOCATION]', + '[WORKLOAD]' + ); + + list_violations_sample($formattedParent); +} +// [END assuredworkloads_v1_generated_AssuredWorkloadsService_ListViolations_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/list_workloads.php b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/list_workloads.php new file mode 100644 index 000000000000..4eb61c7f4e44 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/list_workloads.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $assuredWorkloadsServiceClient->listWorkloads($request); + + /** @var Workload $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AssuredWorkloadsServiceClient::locationName('[ORGANIZATION]', '[LOCATION]'); + + list_workloads_sample($formattedParent); +} +// [END assuredworkloads_v1_generated_AssuredWorkloadsService_ListWorkloads_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/restrict_allowed_resources.php b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/restrict_allowed_resources.php new file mode 100644 index 000000000000..f990cf50b7e5 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/restrict_allowed_resources.php @@ -0,0 +1,83 @@ +setName($name) + ->setRestrictionType($restrictionType); + + // Call the API and handle any network failures. + try { + /** @var RestrictAllowedResourcesResponse $response */ + $response = $assuredWorkloadsServiceClient->restrictAllowedResources($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; + + restrict_allowed_resources_sample($name, $restrictionType); +} +// [END assuredworkloads_v1_generated_AssuredWorkloadsService_RestrictAllowedResources_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/update_workload.php b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/update_workload.php new file mode 100644 index 000000000000..dd70542a994c --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/samples/V1/AssuredWorkloadsServiceClient/update_workload.php @@ -0,0 +1,87 @@ +setDisplayName($workloadDisplayName) + ->setComplianceRegime($workloadComplianceRegime); + $updateMask = new FieldMask(); + $request = (new UpdateWorkloadRequest()) + ->setWorkload($workload) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Workload $response */ + $response = $assuredWorkloadsServiceClient->updateWorkload($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $workloadDisplayName = '[DISPLAY_NAME]'; + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + + update_workload_sample($workloadDisplayName, $workloadComplianceRegime); +} +// [END assuredworkloads_v1_generated_AssuredWorkloadsService_UpdateWorkload_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1/src/V1/Client/AssuredWorkloadsServiceClient.php b/owl-bot-staging/AssuredWorkloads/v1/src/V1/Client/AssuredWorkloadsServiceClient.php new file mode 100644 index 000000000000..861ea3c828b9 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/src/V1/Client/AssuredWorkloadsServiceClient.php @@ -0,0 +1,587 @@ + acknowledgeViolationAsync(AcknowledgeViolationRequest $request, array $optionalArgs = []) + * @method PromiseInterface createWorkloadAsync(CreateWorkloadRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteWorkloadAsync(DeleteWorkloadRequest $request, array $optionalArgs = []) + * @method PromiseInterface getViolationAsync(GetViolationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getWorkloadAsync(GetWorkloadRequest $request, array $optionalArgs = []) + * @method PromiseInterface listViolationsAsync(ListViolationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listWorkloadsAsync(ListWorkloadsRequest $request, array $optionalArgs = []) + * @method PromiseInterface restrictAllowedResourcesAsync(RestrictAllowedResourcesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateWorkloadAsync(UpdateWorkloadRequest $request, array $optionalArgs = []) + */ +final class AssuredWorkloadsServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.assuredworkloads.v1.AssuredWorkloadsService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'assuredworkloads.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'assuredworkloads.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/assured_workloads_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/assured_workloads_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/assured_workloads_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/assured_workloads_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $organization + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $organization, string $location): string + { + return self::getPathTemplate('location')->render([ + 'organization' => $organization, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a violation + * resource. + * + * @param string $organization + * @param string $location + * @param string $workload + * @param string $violation + * + * @return string The formatted violation resource. + */ + public static function violationName(string $organization, string $location, string $workload, string $violation): string + { + return self::getPathTemplate('violation')->render([ + 'organization' => $organization, + 'location' => $location, + 'workload' => $workload, + 'violation' => $violation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a workload + * resource. + * + * @param string $organization + * @param string $location + * @param string $workload + * + * @return string The formatted workload resource. + */ + public static function workloadName(string $organization, string $location, string $workload): string + { + return self::getPathTemplate('workload')->render([ + 'organization' => $organization, + 'location' => $location, + 'workload' => $workload, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: organizations/{organization}/locations/{location} + * - violation: organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * - workload: organizations/{organization}/locations/{location}/workloads/{workload} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'assuredworkloads.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Acknowledges an existing violation. By acknowledging a violation, users + * acknowledge the existence of a compliance violation in their workload and + * decide to ignore it due to a valid business justification. Acknowledgement + * is a permanent operation and it cannot be reverted. + * + * The async variant is + * {@see AssuredWorkloadsServiceClient::acknowledgeViolationAsync()} . + * + * @example samples/V1/AssuredWorkloadsServiceClient/acknowledge_violation.php + * + * @param AcknowledgeViolationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AcknowledgeViolationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function acknowledgeViolation(AcknowledgeViolationRequest $request, array $callOptions = []): AcknowledgeViolationResponse + { + return $this->startApiCall('AcknowledgeViolation', $request, $callOptions)->wait(); + } + + /** + * Creates Assured Workload. + * + * The async variant is {@see AssuredWorkloadsServiceClient::createWorkloadAsync()} + * . + * + * @example samples/V1/AssuredWorkloadsServiceClient/create_workload.php + * + * @param CreateWorkloadRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createWorkload(CreateWorkloadRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateWorkload', $request, $callOptions)->wait(); + } + + /** + * Deletes the workload. Make sure that workload's direct children are already + * in a deleted state, otherwise the request will fail with a + * FAILED_PRECONDITION error. + * + * The async variant is {@see AssuredWorkloadsServiceClient::deleteWorkloadAsync()} + * . + * + * @example samples/V1/AssuredWorkloadsServiceClient/delete_workload.php + * + * @param DeleteWorkloadRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteWorkload(DeleteWorkloadRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteWorkload', $request, $callOptions)->wait(); + } + + /** + * Retrieves Assured Workload Violation based on ID. + * + * The async variant is {@see AssuredWorkloadsServiceClient::getViolationAsync()} . + * + * @example samples/V1/AssuredWorkloadsServiceClient/get_violation.php + * + * @param GetViolationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Violation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getViolation(GetViolationRequest $request, array $callOptions = []): Violation + { + return $this->startApiCall('GetViolation', $request, $callOptions)->wait(); + } + + /** + * Gets Assured Workload associated with a CRM Node + * + * The async variant is {@see AssuredWorkloadsServiceClient::getWorkloadAsync()} . + * + * @example samples/V1/AssuredWorkloadsServiceClient/get_workload.php + * + * @param GetWorkloadRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Workload + * + * @throws ApiException Thrown if the API call fails. + */ + public function getWorkload(GetWorkloadRequest $request, array $callOptions = []): Workload + { + return $this->startApiCall('GetWorkload', $request, $callOptions)->wait(); + } + + /** + * Lists the Violations in the AssuredWorkload Environment. + * Callers may also choose to read across multiple Workloads as per + * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash + * character) as a wildcard character instead of workload-id in the parent. + * Format `organizations/{org_id}/locations/{location}/workloads/-` + * + * The async variant is {@see AssuredWorkloadsServiceClient::listViolationsAsync()} + * . + * + * @example samples/V1/AssuredWorkloadsServiceClient/list_violations.php + * + * @param ListViolationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listViolations(ListViolationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListViolations', $request, $callOptions); + } + + /** + * Lists Assured Workloads under a CRM Node. + * + * The async variant is {@see AssuredWorkloadsServiceClient::listWorkloadsAsync()} + * . + * + * @example samples/V1/AssuredWorkloadsServiceClient/list_workloads.php + * + * @param ListWorkloadsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listWorkloads(ListWorkloadsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListWorkloads', $request, $callOptions); + } + + /** + * Restrict the list of resources allowed in the Workload environment. + * The current list of allowed products can be found at + * https://cloud.google.com/assured-workloads/docs/supported-products + * In addition to assuredworkloads.workload.update permission, the user should + * also have orgpolicy.policy.set permission on the folder resource + * to use this functionality. + * + * The async variant is + * {@see AssuredWorkloadsServiceClient::restrictAllowedResourcesAsync()} . + * + * @example samples/V1/AssuredWorkloadsServiceClient/restrict_allowed_resources.php + * + * @param RestrictAllowedResourcesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return RestrictAllowedResourcesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function restrictAllowedResources(RestrictAllowedResourcesRequest $request, array $callOptions = []): RestrictAllowedResourcesResponse + { + return $this->startApiCall('RestrictAllowedResources', $request, $callOptions)->wait(); + } + + /** + * Updates an existing workload. + * Currently allows updating of workload display_name and labels. + * For force updates don't set etag field in the Workload. + * Only one update operation per workload can be in progress. + * + * The async variant is {@see AssuredWorkloadsServiceClient::updateWorkloadAsync()} + * . + * + * @example samples/V1/AssuredWorkloadsServiceClient/update_workload.php + * + * @param UpdateWorkloadRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Workload + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateWorkload(UpdateWorkloadRequest $request, array $callOptions = []): Workload + { + return $this->startApiCall('UpdateWorkload', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/AssuredWorkloads/v1/src/V1/gapic_metadata.json b/owl-bot-staging/AssuredWorkloads/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..5f904fcdc771 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/src/V1/gapic_metadata.json @@ -0,0 +1,63 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.assuredworkloads.v1", + "libraryPackage": "Google\\Cloud\\AssuredWorkloads\\V1", + "services": { + "AssuredWorkloadsService": { + "clients": { + "grpc": { + "libraryClient": "AssuredWorkloadsServiceGapicClient", + "rpcs": { + "AcknowledgeViolation": { + "methods": [ + "acknowledgeViolation" + ] + }, + "CreateWorkload": { + "methods": [ + "createWorkload" + ] + }, + "DeleteWorkload": { + "methods": [ + "deleteWorkload" + ] + }, + "GetViolation": { + "methods": [ + "getViolation" + ] + }, + "GetWorkload": { + "methods": [ + "getWorkload" + ] + }, + "ListViolations": { + "methods": [ + "listViolations" + ] + }, + "ListWorkloads": { + "methods": [ + "listWorkloads" + ] + }, + "RestrictAllowedResources": { + "methods": [ + "restrictAllowedResources" + ] + }, + "UpdateWorkload": { + "methods": [ + "updateWorkload" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/AssuredWorkloads/v1/src/V1/resources/assured_workloads_service_client_config.json b/owl-bot-staging/AssuredWorkloads/v1/src/V1/resources/assured_workloads_service_client_config.json new file mode 100644 index 000000000000..c74cd9d05ff9 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/src/V1/resources/assured_workloads_service_client_config.json @@ -0,0 +1,77 @@ +{ + "interfaces": { + "google.cloud.assuredworkloads.v1.AssuredWorkloadsService": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "AcknowledgeViolation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetViolation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListViolations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListWorkloads": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RestrictAllowedResources": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/AssuredWorkloads/v1/src/V1/resources/assured_workloads_service_descriptor_config.php b/owl-bot-staging/AssuredWorkloads/v1/src/V1/resources/assured_workloads_service_descriptor_config.php new file mode 100644 index 000000000000..add3dde579db --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/src/V1/resources/assured_workloads_service_descriptor_config.php @@ -0,0 +1,141 @@ + [ + 'google.cloud.assuredworkloads.v1.AssuredWorkloadsService' => [ + 'CreateWorkload' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AssuredWorkloads\V1\Workload', + 'metadataReturnType' => '\Google\Cloud\AssuredWorkloads\V1\CreateWorkloadOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'AcknowledgeViolation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1\AcknowledgeViolationResponse', + ], + 'DeleteWorkload' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetViolation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1\Violation', + ], + 'GetWorkload' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1\Workload', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListViolations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getViolations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1\ListViolationsResponse', + ], + 'ListWorkloads' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getWorkloads', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1\ListWorkloadsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RestrictAllowedResources' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1\RestrictAllowedResourcesResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateWorkload' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1\Workload', + 'headerParams' => [ + [ + 'keyName' => 'workload.name', + 'fieldAccessors' => [ + 'getWorkload', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'location' => 'organizations/{organization}/locations/{location}', + 'violation' => 'organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}', + 'workload' => 'organizations/{organization}/locations/{location}/workloads/{workload}', + ], + ], + ], +]; diff --git a/owl-bot-staging/AssuredWorkloads/v1/src/V1/resources/assured_workloads_service_rest_client_config.php b/owl-bot-staging/AssuredWorkloads/v1/src/V1/resources/assured_workloads_service_rest_client_config.php new file mode 100644 index 000000000000..ad506b048711 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/src/V1/resources/assured_workloads_service_rest_client_config.php @@ -0,0 +1,126 @@ + [ + 'google.cloud.assuredworkloads.v1.AssuredWorkloadsService' => [ + 'CreateWorkload' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/workloads', + 'body' => 'workload', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteWorkload' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/workloads/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetWorkload' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/workloads/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListWorkloads' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/workloads', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RestrictAllowedResources' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateWorkload' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{workload.name=organizations/*/locations/*/workloads/*}', + 'body' => 'workload', + 'placeholders' => [ + 'workload.name' => [ + 'getters' => [ + 'getWorkload', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/AssuredWorkloads/v1/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.php b/owl-bot-staging/AssuredWorkloads/v1/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.php new file mode 100644 index 000000000000..943dd0949cbf --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.php @@ -0,0 +1,842 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AssuredWorkloadsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AssuredWorkloadsServiceClient($options); + } + + /** @test */ + public function acknowledgeViolationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AcknowledgeViolationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $comment = 'comment950398559'; + $request = (new AcknowledgeViolationRequest()) + ->setName($name) + ->setComment($comment); + $response = $gapicClient->acknowledgeViolation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getComment(); + $this->assertProtobufEquals($comment, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function acknowledgeViolationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $comment = 'comment950398559'; + $request = (new AcknowledgeViolationRequest()) + ->setName($name) + ->setComment($comment); + try { + $gapicClient->acknowledgeViolation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createWorkloadTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createWorkloadTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $billingAccount = 'billingAccount-545871767'; + $etag = 'etag3123477'; + $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; + $enableSovereignControls = false; + $expectedResponse = new Workload(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setBillingAccount($billingAccount); + $expectedResponse->setEtag($etag); + $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); + $expectedResponse->setEnableSovereignControls($enableSovereignControls); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createWorkloadTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); + $workload = new Workload(); + $workloadDisplayName = 'workloadDisplayName191619702'; + $workload->setDisplayName($workloadDisplayName); + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + $workload->setComplianceRegime($workloadComplianceRegime); + $request = (new CreateWorkloadRequest()) + ->setParent($formattedParent) + ->setWorkload($workload); + $response = $gapicClient->createWorkload($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/CreateWorkload', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getWorkload(); + $this->assertProtobufEquals($workload, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createWorkloadTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createWorkloadExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createWorkloadTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); + $workload = new Workload(); + $workloadDisplayName = 'workloadDisplayName191619702'; + $workload->setDisplayName($workloadDisplayName); + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + $workload->setComplianceRegime($workloadComplianceRegime); + $request = (new CreateWorkloadRequest()) + ->setParent($formattedParent) + ->setWorkload($workload); + $response = $gapicClient->createWorkload($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createWorkloadTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteWorkloadTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); + $request = (new DeleteWorkloadRequest()) + ->setName($formattedName); + $gapicClient->deleteWorkload($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/DeleteWorkload', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteWorkloadExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); + $request = (new DeleteWorkloadRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteWorkload($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getViolationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $category = 'category50511102'; + $orgPolicyConstraint = 'orgPolicyConstraint139795055'; + $auditLogLink = 'auditLogLink-657658887'; + $nonCompliantOrgPolicy = 'nonCompliantOrgPolicy-1555127741'; + $acknowledged = true; + $exceptionAuditLogLink = 'exceptionAuditLogLink1901265385'; + $expectedResponse = new Violation(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setCategory($category); + $expectedResponse->setOrgPolicyConstraint($orgPolicyConstraint); + $expectedResponse->setAuditLogLink($auditLogLink); + $expectedResponse->setNonCompliantOrgPolicy($nonCompliantOrgPolicy); + $expectedResponse->setAcknowledged($acknowledged); + $expectedResponse->setExceptionAuditLogLink($exceptionAuditLogLink); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->violationName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]', '[VIOLATION]'); + $request = (new GetViolationRequest()) + ->setName($formattedName); + $response = $gapicClient->getViolation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/GetViolation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getViolationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->violationName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]', '[VIOLATION]'); + $request = (new GetViolationRequest()) + ->setName($formattedName); + try { + $gapicClient->getViolation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getWorkloadTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $billingAccount = 'billingAccount-545871767'; + $etag = 'etag3123477'; + $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; + $enableSovereignControls = false; + $expectedResponse = new Workload(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setBillingAccount($billingAccount); + $expectedResponse->setEtag($etag); + $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); + $expectedResponse->setEnableSovereignControls($enableSovereignControls); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); + $request = (new GetWorkloadRequest()) + ->setName($formattedName); + $response = $gapicClient->getWorkload($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/GetWorkload', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getWorkloadExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); + $request = (new GetWorkloadRequest()) + ->setName($formattedName); + try { + $gapicClient->getWorkload($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listViolationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $violationsElement = new Violation(); + $violations = [ + $violationsElement, + ]; + $expectedResponse = new ListViolationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setViolations($violations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); + $request = (new ListViolationsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listViolations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getViolations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/ListViolations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listViolationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); + $request = (new ListViolationsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listViolations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listWorkloadsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $workloadsElement = new Workload(); + $workloads = [ + $workloadsElement, + ]; + $expectedResponse = new ListWorkloadsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setWorkloads($workloads); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListWorkloadsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listWorkloads($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getWorkloads()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/ListWorkloads', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listWorkloadsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListWorkloadsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listWorkloads($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function restrictAllowedResourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RestrictAllowedResourcesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; + $request = (new RestrictAllowedResourcesRequest()) + ->setName($name) + ->setRestrictionType($restrictionType); + $response = $gapicClient->restrictAllowedResources($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/RestrictAllowedResources', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getRestrictionType(); + $this->assertProtobufEquals($restrictionType, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function restrictAllowedResourcesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; + $request = (new RestrictAllowedResourcesRequest()) + ->setName($name) + ->setRestrictionType($restrictionType); + try { + $gapicClient->restrictAllowedResources($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateWorkloadTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $billingAccount = 'billingAccount-545871767'; + $etag = 'etag3123477'; + $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; + $enableSovereignControls = false; + $expectedResponse = new Workload(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setBillingAccount($billingAccount); + $expectedResponse->setEtag($etag); + $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); + $expectedResponse->setEnableSovereignControls($enableSovereignControls); + $transport->addResponse($expectedResponse); + // Mock request + $workload = new Workload(); + $workloadDisplayName = 'workloadDisplayName191619702'; + $workload->setDisplayName($workloadDisplayName); + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + $workload->setComplianceRegime($workloadComplianceRegime); + $updateMask = new FieldMask(); + $request = (new UpdateWorkloadRequest()) + ->setWorkload($workload) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateWorkload($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/UpdateWorkload', $actualFuncCall); + $actualValue = $actualRequestObject->getWorkload(); + $this->assertProtobufEquals($workload, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateWorkloadExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $workload = new Workload(); + $workloadDisplayName = 'workloadDisplayName191619702'; + $workload->setDisplayName($workloadDisplayName); + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + $workload->setComplianceRegime($workloadComplianceRegime); + $updateMask = new FieldMask(); + $request = (new UpdateWorkloadRequest()) + ->setWorkload($workload) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateWorkload($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function acknowledgeViolationAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AcknowledgeViolationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $comment = 'comment950398559'; + $request = (new AcknowledgeViolationRequest()) + ->setName($name) + ->setComment($comment); + $response = $gapicClient->acknowledgeViolationAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getComment(); + $this->assertProtobufEquals($comment, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/GPBMetadata/Google/Cloud/Assuredworkloads/V1Beta1/Assuredworkloads.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/GPBMetadata/Google/Cloud/Assuredworkloads/V1Beta1/Assuredworkloads.php new file mode 100644 index 000000000000..6ba11ddfa4af Binary files /dev/null and b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/GPBMetadata/Google/Cloud/Assuredworkloads/V1Beta1/Assuredworkloads.php differ diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/GPBMetadata/Google/Cloud/Assuredworkloads/V1Beta1/AssuredworkloadsService.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/GPBMetadata/Google/Cloud/Assuredworkloads/V1Beta1/AssuredworkloadsService.php new file mode 100644 index 000000000000..be55b72a2230 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/GPBMetadata/Google/Cloud/Assuredworkloads/V1Beta1/AssuredworkloadsService.php @@ -0,0 +1,41 @@ +internalAddGeneratedFile( + ' +Á +Dgoogle/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto%google.cloud.assuredworkloads.v1beta1google/api/client.protogoogle.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + */ +class AnalyzeWorkloadMoveRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource ID of the folder-based destination workload. This workload is + * where the source project will hypothetically be moved to. Specify the + * workload's relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-2" + * + * Generated from protobuf field string target = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target = ''; + protected $projectOrWorkloadResource; + + /** + * @param string $project The source type is a project. Specify the project's relative resource + * name, formatted as either a project number or a project ID: + * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" + * For example: + * "projects/951040570662" when specifying a project number, or + * "projects/my-project-123" when specifying a project ID. + * @param string $target Required. The resource ID of the folder-based destination workload. This workload is + * where the source project will hypothetically be moved to. Specify the + * workload's relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-2" + * + * @return \Google\Cloud\AssuredWorkloads\V1beta1\AnalyzeWorkloadMoveRequest + * + * @experimental + */ + public static function build(string $project, string $target): self + { + return (new self()) + ->setProject($project) + ->setTarget($target); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $source + * The source type is a project-based workload. Specify the workloads's + * relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-1" + * @type string $project + * The source type is a project. Specify the project's relative resource + * name, formatted as either a project number or a project ID: + * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" + * For example: + * "projects/951040570662" when specifying a project number, or + * "projects/my-project-123" when specifying a project ID. + * @type string $target + * Required. The resource ID of the folder-based destination workload. This workload is + * where the source project will hypothetically be moved to. Specify the + * workload's relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-2" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * The source type is a project-based workload. Specify the workloads's + * relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-1" + * + * Generated from protobuf field string source = 1; + * @return string + */ + public function getSource() + { + return $this->readOneof(1); + } + + public function hasSource() + { + return $this->hasOneof(1); + } + + /** + * The source type is a project-based workload. Specify the workloads's + * relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-1" + * + * Generated from protobuf field string source = 1; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The source type is a project. Specify the project's relative resource + * name, formatted as either a project number or a project ID: + * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" + * For example: + * "projects/951040570662" when specifying a project number, or + * "projects/my-project-123" when specifying a project ID. + * + * Generated from protobuf field string project = 3; + * @return string + */ + public function getProject() + { + return $this->readOneof(3); + } + + public function hasProject() + { + return $this->hasOneof(3); + } + + /** + * The source type is a project. Specify the project's relative resource + * name, formatted as either a project number or a project ID: + * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" + * For example: + * "projects/951040570662" when specifying a project number, or + * "projects/my-project-123" when specifying a project ID. + * + * Generated from protobuf field string project = 3; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. The resource ID of the folder-based destination workload. This workload is + * where the source project will hypothetically be moved to. Specify the + * workload's relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-2" + * + * Generated from protobuf field string target = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Required. The resource ID of the folder-based destination workload. This workload is + * where the source project will hypothetically be moved to. Specify the + * workload's relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-2" + * + * Generated from protobuf field string target = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * @return string + */ + public function getProjectOrWorkloadResource() + { + return $this->whichOneof("projectOrWorkloadResource"); + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/AnalyzeWorkloadMoveResponse.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/AnalyzeWorkloadMoveResponse.php new file mode 100644 index 000000000000..358677fb9f89 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/AnalyzeWorkloadMoveResponse.php @@ -0,0 +1,71 @@ +google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + */ +class AnalyzeWorkloadMoveResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of blockers that should be addressed before moving the source + * project or project-based workload to the destination folder-based workload. + * + * Generated from protobuf field repeated string blockers = 1; + */ + private $blockers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $blockers + * A list of blockers that should be addressed before moving the source + * project or project-based workload to the destination folder-based workload. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * A list of blockers that should be addressed before moving the source + * project or project-based workload to the destination folder-based workload. + * + * Generated from protobuf field repeated string blockers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBlockers() + { + return $this->blockers; + } + + /** + * A list of blockers that should be addressed before moving the source + * project or project-based workload to the destination folder-based workload. + * + * Generated from protobuf field repeated string blockers = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBlockers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->blockers = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/CreateWorkloadOperationMetadata.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/CreateWorkloadOperationMetadata.php new file mode 100644 index 000000000000..fc8e74e5998a --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/CreateWorkloadOperationMetadata.php @@ -0,0 +1,221 @@ +google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + */ +class CreateWorkloadOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Time when the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $create_time = null; + /** + * Optional. The display name of the workload. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. The parent of the workload. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $parent = ''; + /** + * Optional. Compliance controls that should be applied to the resources managed by + * the workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $compliance_regime = 0; + /** + * Optional. Resource properties in the input that are used for creating/customizing + * workload resources. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $resource_settings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Optional. Time when the operation was created. + * @type string $display_name + * Optional. The display name of the workload. + * @type string $parent + * Optional. The parent of the workload. + * @type int $compliance_regime + * Optional. Compliance controls that should be applied to the resources managed by + * the workload. + * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $resource_settings + * Optional. Resource properties in the input that are used for creating/customizing + * workload resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Time when the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Optional. Time when the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Optional. The display name of the workload. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. The display name of the workload. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The parent of the workload. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Optional. The parent of the workload. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Compliance controls that should be applied to the resources managed by + * the workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getComplianceRegime() + { + return $this->compliance_regime; + } + + /** + * Optional. Compliance controls that should be applied to the resources managed by + * the workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setComplianceRegime($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ComplianceRegime::class); + $this->compliance_regime = $var; + + return $this; + } + + /** + * Optional. Resource properties in the input that are used for creating/customizing + * workload resources. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceSettings() + { + return $this->resource_settings; + } + + /** + * Optional. Resource properties in the input that are used for creating/customizing + * workload resources. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceSettings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings::class); + $this->resource_settings = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/CreateWorkloadRequest.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/CreateWorkloadRequest.php new file mode 100644 index 000000000000..65461d55a2b0 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/CreateWorkloadRequest.php @@ -0,0 +1,178 @@ +google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + */ +class CreateWorkloadRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Assured Workload to create + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $workload = null; + /** + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * + * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_id = ''; + + /** + * @param string $parent Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. Please see + * {@see AssuredWorkloadsServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload $workload Required. Assured Workload to create + * + * @return \Google\Cloud\AssuredWorkloads\V1beta1\CreateWorkloadRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AssuredWorkloads\V1beta1\Workload $workload): self + { + return (new self()) + ->setParent($parent) + ->setWorkload($workload); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload $workload + * Required. Assured Workload to create + * @type string $external_id + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Assured Workload to create + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload|null + */ + public function getWorkload() + { + return $this->workload; + } + + public function hasWorkload() + { + return isset($this->workload); + } + + public function clearWorkload() + { + unset($this->workload); + } + + /** + * Required. Assured Workload to create + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload $var + * @return $this + */ + public function setWorkload($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload::class); + $this->workload = $var; + + return $this; + } + + /** + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * + * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getExternalId() + { + return $this->external_id; + } + + /** + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * + * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setExternalId($var) + { + GPBUtil::checkString($var, True); + $this->external_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/DeleteWorkloadRequest.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/DeleteWorkloadRequest.php new file mode 100644 index 000000000000..06ffdd344fa8 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/DeleteWorkloadRequest.php @@ -0,0 +1,129 @@ +google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + */ +class DeleteWorkloadRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * @param string $name Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * Please see {@see AssuredWorkloadsServiceClient::workloadName()} for help formatting this field. + * + * @return \Google\Cloud\AssuredWorkloads\V1beta1\DeleteWorkloadRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @type string $etag + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/GetWorkloadRequest.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/GetWorkloadRequest.php new file mode 100644 index 000000000000..28e30c7b02ba --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/GetWorkloadRequest.php @@ -0,0 +1,101 @@ +google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + */ +class GetWorkloadRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". Please see + * {@see AssuredWorkloadsServiceClient::workloadName()} for help formatting this field. + * + * @return \Google\Cloud\AssuredWorkloads\V1beta1\GetWorkloadRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/ListWorkloadsRequest.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/ListWorkloadsRequest.php new file mode 100644 index 000000000000..ead0ff47b4e2 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/ListWorkloadsRequest.php @@ -0,0 +1,200 @@ +google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + */ +class ListWorkloadsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + + /** + * @param string $parent Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. Please see + * {@see AssuredWorkloadsServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\AssuredWorkloads\V1beta1\ListWorkloadsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * @type int $page_size + * Page size. + * @type string $page_token + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * @type string $filter + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/ListWorkloadsResponse.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/ListWorkloadsResponse.php new file mode 100644 index 000000000000..41c3865caecf --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/ListWorkloadsResponse.php @@ -0,0 +1,101 @@ +google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + */ +class ListWorkloadsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of Workloads under a given parent. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + private $workloads; + /** + * The next page token. Return empty if reached the last page. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload>|\Google\Protobuf\Internal\RepeatedField $workloads + * List of Workloads under a given parent. + * @type string $next_page_token + * The next page token. Return empty if reached the last page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * List of Workloads under a given parent. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWorkloads() + { + return $this->workloads; + } + + /** + * List of Workloads under a given parent. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWorkloads($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload::class); + $this->workloads = $arr; + + return $this; + } + + /** + * The next page token. Return empty if reached the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The next page token. Return empty if reached the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/RestrictAllowedResourcesRequest.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/RestrictAllowedResourcesRequest.php new file mode 100644 index 000000000000..4c34526ed7ef --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/RestrictAllowedResourcesRequest.php @@ -0,0 +1,117 @@ +google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest + */ +class RestrictAllowedResourcesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The type of restriction for using gcp products in the Workload environment. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $restriction_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @type int $restriction_type + * Required. The type of restriction for using gcp products in the Workload environment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The type of restriction for using gcp products in the Workload environment. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getRestrictionType() + { + return $this->restriction_type; + } + + /** + * Required. The type of restriction for using gcp products in the Workload environment. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setRestrictionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest\RestrictionType::class); + $this->restriction_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/RestrictAllowedResourcesRequest/RestrictionType.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/RestrictAllowedResourcesRequest/RestrictionType.php new file mode 100644 index 000000000000..b6587e19dd4d --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/RestrictAllowedResourcesRequest/RestrictionType.php @@ -0,0 +1,68 @@ +google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType + */ +class RestrictionType +{ + /** + * Unknown restriction type. + * + * Generated from protobuf enum RESTRICTION_TYPE_UNSPECIFIED = 0; + */ + const RESTRICTION_TYPE_UNSPECIFIED = 0; + /** + * Allow the use all of all gcp products, irrespective of the compliance + * posture. This effectively removes gcp.restrictServiceUsage OrgPolicy + * on the AssuredWorkloads Folder. + * + * Generated from protobuf enum ALLOW_ALL_GCP_RESOURCES = 1; + */ + const ALLOW_ALL_GCP_RESOURCES = 1; + /** + * Based on Workload's compliance regime, allowed list changes. + * See - https://cloud.google.com/assured-workloads/docs/supported-products + * for the list of supported resources. + * + * Generated from protobuf enum ALLOW_COMPLIANT_RESOURCES = 2; + */ + const ALLOW_COMPLIANT_RESOURCES = 2; + + private static $valueToName = [ + self::RESTRICTION_TYPE_UNSPECIFIED => 'RESTRICTION_TYPE_UNSPECIFIED', + self::ALLOW_ALL_GCP_RESOURCES => 'ALLOW_ALL_GCP_RESOURCES', + self::ALLOW_COMPLIANT_RESOURCES => 'ALLOW_COMPLIANT_RESOURCES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RestrictionType::class, \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest_RestrictionType::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/RestrictAllowedResourcesResponse.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/RestrictAllowedResourcesResponse.php new file mode 100644 index 000000000000..206494d5f65d --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/RestrictAllowedResourcesResponse.php @@ -0,0 +1,33 @@ +google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse + */ +class RestrictAllowedResourcesResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/UpdateWorkloadRequest.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/UpdateWorkloadRequest.php new file mode 100644 index 000000000000..d2102c333654 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/UpdateWorkloadRequest.php @@ -0,0 +1,151 @@ +google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + */ +class UpdateWorkloadRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The workload to update. + * The workload's `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $workload = null; + /** + * Required. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload $workload Required. The workload to update. + * The workload's `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to be updated. + * + * @return \Google\Cloud\AssuredWorkloads\V1beta1\UpdateWorkloadRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AssuredWorkloads\V1beta1\Workload $workload, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setWorkload($workload) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload $workload + * Required. The workload to update. + * The workload's `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. The workload to update. + * The workload's `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload|null + */ + public function getWorkload() + { + return $this->workload; + } + + public function hasWorkload() + { + return isset($this->workload); + } + + public function clearWorkload() + { + unset($this->workload); + } + + /** + * Required. The workload to update. + * The workload's `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload $var + * @return $this + */ + public function setWorkload($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload::class); + $this->workload = $var; + + return $this; + } + + /** + * Required. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload.php new file mode 100644 index 000000000000..e71607673b5a --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload.php @@ -0,0 +1,882 @@ +google.cloud.assuredworkloads.v1beta1.Workload + */ +class Workload extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The resource name of the workload. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload} + * Read-only. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Required. The user-assigned display name of the Workload. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, and spaces. + * Example: My Workload + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Output only. The resources associated with this workload. + * These resources will be created when creating the workload. + * If any of the projects already exist, the workload creation will fail. + * Always read only. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $resources; + /** + * Required. Immutable. Compliance Regime associated with this workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $compliance_regime = 0; + /** + * Output only. Immutable. The Workload creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $create_time = null; + /** + * Output only. The billing account used for the resources which are + * direct children of workload. This billing account is initially associated + * with the resources created as part of Workload creation. + * After the initial creation of these resources, the customer can change + * the assigned billing account. + * The resource name has the form + * `billingAccounts/{billing_account_id}`. For example, + * `billingAccounts/012345-567890-ABCDEF`. + * + * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $billing_account = ''; + /** + * Optional. ETag of the workload, it is calculated on the basis + * of the Workload contents. It will be used in Update & Delete operations. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. Labels applied to the workload. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Input only. The parent resource for the resources managed by this Assured Workload. May + * be either empty or a folder resource which is a child of the + * Workload parent. If not specified all resources are created under the + * parent organization. + * Format: + * folders/{folder_id} + * + * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $provisioned_resources_parent = ''; + /** + * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS + * CMEK key is provisioned. + * This field is deprecated as of Feb 28, 2022. + * In order to create a Keyring, callers should specify, + * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @deprecated + */ + protected $kms_settings = null; + /** + * Input only. Resource properties that are used to customize workload resources. + * These properties (such as custom project id) will be used to create + * workload resources if possible. This field is optional. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private $resource_settings; + /** + * Output only. Represents the KAJ enrollment state of the given workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $kaj_enrollment_state = 0; + /** + * Optional. Indicates the sovereignty status of the given workload. + * Currently meant to be used by Europe/Canada customers. + * + * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_sovereign_controls = false; + /** + * Output only. Represents the SAA enrollment response of the given workload. + * SAA enrollment response is queried during GetWorkload call. + * In failure cases, user friendly error message is shown in SAA details page. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $saa_enrollment_response = null; + /** + * Output only. Urls for services which are compliant for this Assured Workload, but which + * are currently disallowed by the ResourceUsageRestriction org policy. + * Invoke RestrictAllowedResources endpoint to allow your project developers + * to use these services in their environment." + * + * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $compliant_but_disallowed_services; + protected $compliance_regime_settings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The resource name of the workload. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload} + * Read-only. + * @type string $display_name + * Required. The user-assigned display name of the Workload. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, and spaces. + * Example: My Workload + * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo>|\Google\Protobuf\Internal\RepeatedField $resources + * Output only. The resources associated with this workload. + * These resources will be created when creating the workload. + * If any of the projects already exist, the workload creation will fail. + * Always read only. + * @type int $compliance_regime + * Required. Immutable. Compliance Regime associated with this workload. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Immutable. The Workload creation timestamp. + * @type string $billing_account + * Output only. The billing account used for the resources which are + * direct children of workload. This billing account is initially associated + * with the resources created as part of Workload creation. + * After the initial creation of these resources, the customer can change + * the assigned billing account. + * The resource name has the form + * `billingAccounts/{billing_account_id}`. For example, + * `billingAccounts/012345-567890-ABCDEF`. + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings $il4_settings + * Input only. Immutable. Settings specific to resources needed for IL4. + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings $cjis_settings + * Input only. Immutable. Settings specific to resources needed for CJIS. + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings $fedramp_high_settings + * Input only. Immutable. Settings specific to resources needed for FedRAMP High. + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings $fedramp_moderate_settings + * Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. + * @type string $etag + * Optional. ETag of the workload, it is calculated on the basis + * of the Workload contents. It will be used in Update & Delete operations. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels applied to the workload. + * @type string $provisioned_resources_parent + * Input only. The parent resource for the resources managed by this Assured Workload. May + * be either empty or a folder resource which is a child of the + * Workload parent. If not specified all resources are created under the + * parent organization. + * Format: + * folders/{folder_id} + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings + * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS + * CMEK key is provisioned. + * This field is deprecated as of Feb 28, 2022. + * In order to create a Keyring, callers should specify, + * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. + * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $resource_settings + * Input only. Resource properties that are used to customize workload resources. + * These properties (such as custom project id) will be used to create + * workload resources if possible. This field is optional. + * @type int $kaj_enrollment_state + * Output only. Represents the KAJ enrollment state of the given workload. + * @type bool $enable_sovereign_controls + * Optional. Indicates the sovereignty status of the given workload. + * Currently meant to be used by Europe/Canada customers. + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse $saa_enrollment_response + * Output only. Represents the SAA enrollment response of the given workload. + * SAA enrollment response is queried during GetWorkload call. + * In failure cases, user friendly error message is shown in SAA details page. + * @type array|\Google\Protobuf\Internal\RepeatedField $compliant_but_disallowed_services + * Output only. Urls for services which are compliant for this Assured Workload, but which + * are currently disallowed by the ResourceUsageRestriction org policy. + * Invoke RestrictAllowedResources endpoint to allow your project developers + * to use these services in their environment." + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The resource name of the workload. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload} + * Read-only. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The resource name of the workload. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload} + * Read-only. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The user-assigned display name of the Workload. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, and spaces. + * Example: My Workload + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The user-assigned display name of the Workload. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, and spaces. + * Example: My Workload + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The resources associated with this workload. + * These resources will be created when creating the workload. + * If any of the projects already exist, the workload creation will fail. + * Always read only. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResources() + { + return $this->resources; + } + + /** + * Output only. The resources associated with this workload. + * These resources will be created when creating the workload. + * If any of the projects already exist, the workload creation will fail. + * Always read only. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo::class); + $this->resources = $arr; + + return $this; + } + + /** + * Required. Immutable. Compliance Regime associated with this workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getComplianceRegime() + { + return $this->compliance_regime; + } + + /** + * Required. Immutable. Compliance Regime associated with this workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setComplianceRegime($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ComplianceRegime::class); + $this->compliance_regime = $var; + + return $this; + } + + /** + * Output only. Immutable. The Workload creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Immutable. The Workload creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The billing account used for the resources which are + * direct children of workload. This billing account is initially associated + * with the resources created as part of Workload creation. + * After the initial creation of these resources, the customer can change + * the assigned billing account. + * The resource name has the form + * `billingAccounts/{billing_account_id}`. For example, + * `billingAccounts/012345-567890-ABCDEF`. + * + * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getBillingAccount() + { + return $this->billing_account; + } + + /** + * Output only. The billing account used for the resources which are + * direct children of workload. This billing account is initially associated + * with the resources created as part of Workload creation. + * After the initial creation of these resources, the customer can change + * the assigned billing account. + * The resource name has the form + * `billingAccounts/{billing_account_id}`. For example, + * `billingAccounts/012345-567890-ABCDEF`. + * + * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setBillingAccount($var) + { + GPBUtil::checkString($var, True); + $this->billing_account = $var; + + return $this; + } + + /** + * Input only. Immutable. Settings specific to resources needed for IL4. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings|null + * @deprecated + */ + public function getIl4Settings() + { + @trigger_error('il4_settings is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(7); + } + + public function hasIl4Settings() + { + @trigger_error('il4_settings is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(7); + } + + /** + * Input only. Immutable. Settings specific to resources needed for IL4. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings $var + * @return $this + * @deprecated + */ + public function setIl4Settings($var) + { + @trigger_error('il4_settings is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Input only. Immutable. Settings specific to resources needed for CJIS. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings|null + * @deprecated + */ + public function getCjisSettings() + { + @trigger_error('cjis_settings is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(8); + } + + public function hasCjisSettings() + { + @trigger_error('cjis_settings is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(8); + } + + /** + * Input only. Immutable. Settings specific to resources needed for CJIS. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings $var + * @return $this + * @deprecated + */ + public function setCjisSettings($var) + { + @trigger_error('cjis_settings is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Input only. Immutable. Settings specific to resources needed for FedRAMP High. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings|null + * @deprecated + */ + public function getFedrampHighSettings() + { + @trigger_error('fedramp_high_settings is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(11); + } + + public function hasFedrampHighSettings() + { + @trigger_error('fedramp_high_settings is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(11); + } + + /** + * Input only. Immutable. Settings specific to resources needed for FedRAMP High. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings $var + * @return $this + * @deprecated + */ + public function setFedrampHighSettings($var) + { + @trigger_error('fedramp_high_settings is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings|null + * @deprecated + */ + public function getFedrampModerateSettings() + { + @trigger_error('fedramp_moderate_settings is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(12); + } + + public function hasFedrampModerateSettings() + { + @trigger_error('fedramp_moderate_settings is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(12); + } + + /** + * Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings $var + * @return $this + * @deprecated + */ + public function setFedrampModerateSettings($var) + { + @trigger_error('fedramp_moderate_settings is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Optional. ETag of the workload, it is calculated on the basis + * of the Workload contents. It will be used in Update & Delete operations. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. ETag of the workload, it is calculated on the basis + * of the Workload contents. It will be used in Update & Delete operations. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. Labels applied to the workload. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels applied to the workload. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Input only. The parent resource for the resources managed by this Assured Workload. May + * be either empty or a folder resource which is a child of the + * Workload parent. If not specified all resources are created under the + * parent organization. + * Format: + * folders/{folder_id} + * + * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getProvisionedResourcesParent() + { + return $this->provisioned_resources_parent; + } + + /** + * Input only. The parent resource for the resources managed by this Assured Workload. May + * be either empty or a folder resource which is a child of the + * Workload parent. If not specified all resources are created under the + * parent organization. + * Format: + * folders/{folder_id} + * + * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setProvisionedResourcesParent($var) + { + GPBUtil::checkString($var, True); + $this->provisioned_resources_parent = $var; + + return $this; + } + + /** + * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS + * CMEK key is provisioned. + * This field is deprecated as of Feb 28, 2022. + * In order to create a Keyring, callers should specify, + * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null + * @deprecated + */ + public function getKmsSettings() + { + @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); + return $this->kms_settings; + } + + public function hasKmsSettings() + { + @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); + return isset($this->kms_settings); + } + + public function clearKmsSettings() + { + @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); + unset($this->kms_settings); + } + + /** + * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS + * CMEK key is provisioned. + * This field is deprecated as of Feb 28, 2022. + * In order to create a Keyring, callers should specify, + * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var + * @return $this + * @deprecated + */ + public function setKmsSettings($var) + { + @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); + $this->kms_settings = $var; + + return $this; + } + + /** + * Input only. Resource properties that are used to customize workload resources. + * These properties (such as custom project id) will be used to create + * workload resources if possible. This field is optional. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceSettings() + { + return $this->resource_settings; + } + + /** + * Input only. Resource properties that are used to customize workload resources. + * These properties (such as custom project id) will be used to create + * workload resources if possible. This field is optional. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceSettings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings::class); + $this->resource_settings = $arr; + + return $this; + } + + /** + * Output only. Represents the KAJ enrollment state of the given workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getKajEnrollmentState() + { + return $this->kaj_enrollment_state; + } + + /** + * Output only. Represents the KAJ enrollment state of the given workload. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setKajEnrollmentState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KajEnrollmentState::class); + $this->kaj_enrollment_state = $var; + + return $this; + } + + /** + * Optional. Indicates the sovereignty status of the given workload. + * Currently meant to be used by Europe/Canada customers. + * + * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableSovereignControls() + { + return $this->enable_sovereign_controls; + } + + /** + * Optional. Indicates the sovereignty status of the given workload. + * Currently meant to be used by Europe/Canada customers. + * + * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableSovereignControls($var) + { + GPBUtil::checkBool($var); + $this->enable_sovereign_controls = $var; + + return $this; + } + + /** + * Output only. Represents the SAA enrollment response of the given workload. + * SAA enrollment response is queried during GetWorkload call. + * In failure cases, user friendly error message is shown in SAA details page. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse|null + */ + public function getSaaEnrollmentResponse() + { + return $this->saa_enrollment_response; + } + + public function hasSaaEnrollmentResponse() + { + return isset($this->saa_enrollment_response); + } + + public function clearSaaEnrollmentResponse() + { + unset($this->saa_enrollment_response); + } + + /** + * Output only. Represents the SAA enrollment response of the given workload. + * SAA enrollment response is queried during GetWorkload call. + * In failure cases, user friendly error message is shown in SAA details page. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse $var + * @return $this + */ + public function setSaaEnrollmentResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse::class); + $this->saa_enrollment_response = $var; + + return $this; + } + + /** + * Output only. Urls for services which are compliant for this Assured Workload, but which + * are currently disallowed by the ResourceUsageRestriction org policy. + * Invoke RestrictAllowedResources endpoint to allow your project developers + * to use these services in their environment." + * + * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCompliantButDisallowedServices() + { + return $this->compliant_but_disallowed_services; + } + + /** + * Output only. Urls for services which are compliant for this Assured Workload, but which + * are currently disallowed by the ResourceUsageRestriction org policy. + * Invoke RestrictAllowedResources endpoint to allow your project developers + * to use these services in their environment." + * + * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCompliantButDisallowedServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->compliant_but_disallowed_services = $arr; + + return $this; + } + + /** + * @return string + */ + public function getComplianceRegimeSettings() + { + return $this->whichOneof("compliance_regime_settings"); + } + +} + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/CJISSettings.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/CJISSettings.php new file mode 100644 index 000000000000..0d231860e48a --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/CJISSettings.php @@ -0,0 +1,81 @@ +google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + */ +class CJISSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $kms_settings = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings + * Input only. Immutable. Settings used to create a CMEK crypto key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null + */ + public function getKmsSettings() + { + return $this->kms_settings; + } + + public function hasKmsSettings() + { + return isset($this->kms_settings); + } + + public function clearKmsSettings() + { + unset($this->kms_settings); + } + + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var + * @return $this + */ + public function setKmsSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); + $this->kms_settings = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CJISSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_CJISSettings::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ComplianceRegime.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ComplianceRegime.php new file mode 100644 index 000000000000..2a313655a862 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ComplianceRegime.php @@ -0,0 +1,127 @@ +google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime + */ +class ComplianceRegime +{ + /** + * Unknown compliance regime. + * + * Generated from protobuf enum COMPLIANCE_REGIME_UNSPECIFIED = 0; + */ + const COMPLIANCE_REGIME_UNSPECIFIED = 0; + /** + * Information protection as per DoD IL4 requirements. + * + * Generated from protobuf enum IL4 = 1; + */ + const IL4 = 1; + /** + * Criminal Justice Information Services (CJIS) Security policies. + * + * Generated from protobuf enum CJIS = 2; + */ + const CJIS = 2; + /** + * FedRAMP High data protection controls + * + * Generated from protobuf enum FEDRAMP_HIGH = 3; + */ + const FEDRAMP_HIGH = 3; + /** + * FedRAMP Moderate data protection controls + * + * Generated from protobuf enum FEDRAMP_MODERATE = 4; + */ + const FEDRAMP_MODERATE = 4; + /** + * Assured Workloads For US Regions data protection controls + * + * Generated from protobuf enum US_REGIONAL_ACCESS = 5; + */ + const US_REGIONAL_ACCESS = 5; + /** + * Health Insurance Portability and Accountability Act controls + * + * Generated from protobuf enum HIPAA = 6; + */ + const HIPAA = 6; + /** + * Health Information Trust Alliance controls + * + * Generated from protobuf enum HITRUST = 7; + */ + const HITRUST = 7; + /** + * Assured Workloads For EU Regions and Support controls + * + * Generated from protobuf enum EU_REGIONS_AND_SUPPORT = 8; + */ + const EU_REGIONS_AND_SUPPORT = 8; + /** + * Assured Workloads For Canada Regions and Support controls + * + * Generated from protobuf enum CA_REGIONS_AND_SUPPORT = 9; + */ + const CA_REGIONS_AND_SUPPORT = 9; + /** + * International Traffic in Arms Regulations + * + * Generated from protobuf enum ITAR = 10; + */ + const ITAR = 10; + /** + * Assured Workloads for Australia Regions and Support controls + * + * Generated from protobuf enum AU_REGIONS_AND_US_SUPPORT = 11; + */ + const AU_REGIONS_AND_US_SUPPORT = 11; + + private static $valueToName = [ + self::COMPLIANCE_REGIME_UNSPECIFIED => 'COMPLIANCE_REGIME_UNSPECIFIED', + self::IL4 => 'IL4', + self::CJIS => 'CJIS', + self::FEDRAMP_HIGH => 'FEDRAMP_HIGH', + self::FEDRAMP_MODERATE => 'FEDRAMP_MODERATE', + self::US_REGIONAL_ACCESS => 'US_REGIONAL_ACCESS', + self::HIPAA => 'HIPAA', + self::HITRUST => 'HITRUST', + self::EU_REGIONS_AND_SUPPORT => 'EU_REGIONS_AND_SUPPORT', + self::CA_REGIONS_AND_SUPPORT => 'CA_REGIONS_AND_SUPPORT', + self::ITAR => 'ITAR', + self::AU_REGIONS_AND_US_SUPPORT => 'AU_REGIONS_AND_US_SUPPORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ComplianceRegime::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ComplianceRegime::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/FedrampHighSettings.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/FedrampHighSettings.php new file mode 100644 index 000000000000..bbc6ff8eccca --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/FedrampHighSettings.php @@ -0,0 +1,81 @@ +google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + */ +class FedrampHighSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $kms_settings = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings + * Input only. Immutable. Settings used to create a CMEK crypto key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null + */ + public function getKmsSettings() + { + return $this->kms_settings; + } + + public function hasKmsSettings() + { + return isset($this->kms_settings); + } + + public function clearKmsSettings() + { + unset($this->kms_settings); + } + + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var + * @return $this + */ + public function setKmsSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); + $this->kms_settings = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FedrampHighSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_FedrampHighSettings::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/FedrampModerateSettings.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/FedrampModerateSettings.php new file mode 100644 index 000000000000..11083bfa95ae --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/FedrampModerateSettings.php @@ -0,0 +1,81 @@ +google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + */ +class FedrampModerateSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $kms_settings = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings + * Input only. Immutable. Settings used to create a CMEK crypto key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null + */ + public function getKmsSettings() + { + return $this->kms_settings; + } + + public function hasKmsSettings() + { + return isset($this->kms_settings); + } + + public function clearKmsSettings() + { + unset($this->kms_settings); + } + + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var + * @return $this + */ + public function setKmsSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); + $this->kms_settings = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FedrampModerateSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_FedrampModerateSettings::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/IL4Settings.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/IL4Settings.php new file mode 100644 index 000000000000..83a0e87805c8 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/IL4Settings.php @@ -0,0 +1,81 @@ +google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + */ +class IL4Settings extends \Google\Protobuf\Internal\Message +{ + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $kms_settings = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings + * Input only. Immutable. Settings used to create a CMEK crypto key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null + */ + public function getKmsSettings() + { + return $this->kms_settings; + } + + public function hasKmsSettings() + { + return isset($this->kms_settings); + } + + public function clearKmsSettings() + { + unset($this->kms_settings); + } + + /** + * Input only. Immutable. Settings used to create a CMEK crypto key. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var + * @return $this + */ + public function setKmsSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); + $this->kms_settings = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IL4Settings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_IL4Settings::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/KMSSettings.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/KMSSettings.php new file mode 100644 index 000000000000..3c10c5c601b4 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/KMSSettings.php @@ -0,0 +1,137 @@ +google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + */ +class KMSSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + * new version of the crypto key and mark it as the primary. + * + * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $next_rotation_time = null; + /** + * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + * Management Service automatically rotates a key. Must be at least 24 hours + * and at most 876,000 hours. + * + * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $rotation_period = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $next_rotation_time + * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + * new version of the crypto key and mark it as the primary. + * @type \Google\Protobuf\Duration $rotation_period + * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + * Management Service automatically rotates a key. Must be at least 24 hours + * and at most 876,000 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + * new version of the crypto key and mark it as the primary. + * + * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getNextRotationTime() + { + return $this->next_rotation_time; + } + + public function hasNextRotationTime() + { + return isset($this->next_rotation_time); + } + + public function clearNextRotationTime() + { + unset($this->next_rotation_time); + } + + /** + * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + * new version of the crypto key and mark it as the primary. + * + * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setNextRotationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->next_rotation_time = $var; + + return $this; + } + + /** + * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + * Management Service automatically rotates a key. Must be at least 24 hours + * and at most 876,000 hours. + * + * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Duration|null + */ + public function getRotationPeriod() + { + return $this->rotation_period; + } + + public function hasRotationPeriod() + { + return isset($this->rotation_period); + } + + public function clearRotationPeriod() + { + unset($this->rotation_period); + } + + /** + * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + * Management Service automatically rotates a key. Must be at least 24 hours + * and at most 876,000 hours. + * + * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRotationPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->rotation_period = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KMSSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_KMSSettings::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/KajEnrollmentState.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/KajEnrollmentState.php new file mode 100644 index 000000000000..393673186a18 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/KajEnrollmentState.php @@ -0,0 +1,64 @@ +google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState + */ +class KajEnrollmentState +{ + /** + * Default State for KAJ Enrollment. + * + * Generated from protobuf enum KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; + */ + const KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; + /** + * Pending State for KAJ Enrollment. + * + * Generated from protobuf enum KAJ_ENROLLMENT_STATE_PENDING = 1; + */ + const KAJ_ENROLLMENT_STATE_PENDING = 1; + /** + * Complete State for KAJ Enrollment. + * + * Generated from protobuf enum KAJ_ENROLLMENT_STATE_COMPLETE = 2; + */ + const KAJ_ENROLLMENT_STATE_COMPLETE = 2; + + private static $valueToName = [ + self::KAJ_ENROLLMENT_STATE_UNSPECIFIED => 'KAJ_ENROLLMENT_STATE_UNSPECIFIED', + self::KAJ_ENROLLMENT_STATE_PENDING => 'KAJ_ENROLLMENT_STATE_PENDING', + self::KAJ_ENROLLMENT_STATE_COMPLETE => 'KAJ_ENROLLMENT_STATE_COMPLETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KajEnrollmentState::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_KajEnrollmentState::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ResourceInfo.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ResourceInfo.php new file mode 100644 index 000000000000..50fc16731dbc --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ResourceInfo.php @@ -0,0 +1,108 @@ +google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + */ +class ResourceInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Resource identifier. + * For a project this represents project_number. + * + * Generated from protobuf field int64 resource_id = 1; + */ + protected $resource_id = 0; + /** + * Indicates the type of resource. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + */ + protected $resource_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $resource_id + * Resource identifier. + * For a project this represents project_number. + * @type int $resource_type + * Indicates the type of resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Resource identifier. + * For a project this represents project_number. + * + * Generated from protobuf field int64 resource_id = 1; + * @return int|string + */ + public function getResourceId() + { + return $this->resource_id; + } + + /** + * Resource identifier. + * For a project this represents project_number. + * + * Generated from protobuf field int64 resource_id = 1; + * @param int|string $var + * @return $this + */ + public function setResourceId($var) + { + GPBUtil::checkInt64($var); + $this->resource_id = $var; + + return $this; + } + + /** + * Indicates the type of resource. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * @return int + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * Indicates the type of resource. + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * @param int $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo\ResourceType::class); + $this->resource_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResourceInfo::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ResourceInfo::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ResourceInfo/ResourceType.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ResourceInfo/ResourceType.php new file mode 100644 index 000000000000..0e9955769014 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ResourceInfo/ResourceType.php @@ -0,0 +1,79 @@ +google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType + */ +class ResourceType +{ + /** + * Unknown resource type. + * + * Generated from protobuf enum RESOURCE_TYPE_UNSPECIFIED = 0; + */ + const RESOURCE_TYPE_UNSPECIFIED = 0; + /** + * Deprecated. Existing workloads will continue to support this, but new + * CreateWorkloadRequests should not specify this as an input value. + * + * Generated from protobuf enum CONSUMER_PROJECT = 1 [deprecated = true]; + */ + const CONSUMER_PROJECT = 1; + /** + * Consumer Folder. + * + * Generated from protobuf enum CONSUMER_FOLDER = 4; + */ + const CONSUMER_FOLDER = 4; + /** + * Consumer project containing encryption keys. + * + * Generated from protobuf enum ENCRYPTION_KEYS_PROJECT = 2; + */ + const ENCRYPTION_KEYS_PROJECT = 2; + /** + * Keyring resource that hosts encryption keys. + * + * Generated from protobuf enum KEYRING = 3; + */ + const KEYRING = 3; + + private static $valueToName = [ + self::RESOURCE_TYPE_UNSPECIFIED => 'RESOURCE_TYPE_UNSPECIFIED', + self::CONSUMER_PROJECT => 'CONSUMER_PROJECT', + self::CONSUMER_FOLDER => 'CONSUMER_FOLDER', + self::ENCRYPTION_KEYS_PROJECT => 'ENCRYPTION_KEYS_PROJECT', + self::KEYRING => 'KEYRING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResourceType::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ResourceInfo_ResourceType::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ResourceSettings.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ResourceSettings.php new file mode 100644 index 000000000000..6cf59ec7c72f --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/ResourceSettings.php @@ -0,0 +1,170 @@ +google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + */ +class ResourceSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Resource identifier. + * For a project this represents project_id. If the project is already + * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. + * + * Generated from protobuf field string resource_id = 1; + */ + protected $resource_id = ''; + /** + * Indicates the type of resource. This field should be specified to + * correspond the id to the right project type (CONSUMER_PROJECT or + * ENCRYPTION_KEYS_PROJECT) + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + */ + protected $resource_type = 0; + /** + * User-assigned resource display name. + * If not empty it will be used to create a resource with the specified + * name. + * + * Generated from protobuf field string display_name = 3; + */ + protected $display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource_id + * Resource identifier. + * For a project this represents project_id. If the project is already + * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. + * @type int $resource_type + * Indicates the type of resource. This field should be specified to + * correspond the id to the right project type (CONSUMER_PROJECT or + * ENCRYPTION_KEYS_PROJECT) + * @type string $display_name + * User-assigned resource display name. + * If not empty it will be used to create a resource with the specified + * name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Resource identifier. + * For a project this represents project_id. If the project is already + * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. + * + * Generated from protobuf field string resource_id = 1; + * @return string + */ + public function getResourceId() + { + return $this->resource_id; + } + + /** + * Resource identifier. + * For a project this represents project_id. If the project is already + * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. + * + * Generated from protobuf field string resource_id = 1; + * @param string $var + * @return $this + */ + public function setResourceId($var) + { + GPBUtil::checkString($var, True); + $this->resource_id = $var; + + return $this; + } + + /** + * Indicates the type of resource. This field should be specified to + * correspond the id to the right project type (CONSUMER_PROJECT or + * ENCRYPTION_KEYS_PROJECT) + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * @return int + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * Indicates the type of resource. This field should be specified to + * correspond the id to the right project type (CONSUMER_PROJECT or + * ENCRYPTION_KEYS_PROJECT) + * + * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * @param int $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo\ResourceType::class); + $this->resource_type = $var; + + return $this; + } + + /** + * User-assigned resource display name. + * If not empty it will be used to create a resource with the specified + * name. + * + * Generated from protobuf field string display_name = 3; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-assigned resource display name. + * If not empty it will be used to create a resource with the specified + * name. + * + * Generated from protobuf field string display_name = 3; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResourceSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ResourceSettings::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/SaaEnrollmentResponse.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/SaaEnrollmentResponse.php new file mode 100644 index 000000000000..a18d70e9ae5c --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/SaaEnrollmentResponse.php @@ -0,0 +1,114 @@ +google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + */ +class SaaEnrollmentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates SAA enrollment status of a given workload. + * + * Generated from protobuf field optional .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; + */ + protected $setup_status = null; + /** + * Indicates SAA enrollment setup error if any. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; + */ + private $setup_errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $setup_status + * Indicates SAA enrollment status of a given workload. + * @type array|\Google\Protobuf\Internal\RepeatedField $setup_errors + * Indicates SAA enrollment setup error if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); + parent::__construct($data); + } + + /** + * Indicates SAA enrollment status of a given workload. + * + * Generated from protobuf field optional .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; + * @return int + */ + public function getSetupStatus() + { + return isset($this->setup_status) ? $this->setup_status : 0; + } + + public function hasSetupStatus() + { + return isset($this->setup_status); + } + + public function clearSetupStatus() + { + unset($this->setup_status); + } + + /** + * Indicates SAA enrollment status of a given workload. + * + * Generated from protobuf field optional .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; + * @param int $var + * @return $this + */ + public function setSetupStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse\SetupState::class); + $this->setup_status = $var; + + return $this; + } + + /** + * Indicates SAA enrollment setup error if any. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSetupErrors() + { + return $this->setup_errors; + } + + /** + * Indicates SAA enrollment setup error if any. + * + * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSetupErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse\SetupError::class); + $this->setup_errors = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SaaEnrollmentResponse::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_SaaEnrollmentResponse::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/SaaEnrollmentResponse/SetupError.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/SaaEnrollmentResponse/SetupError.php new file mode 100644 index 000000000000..8a777f423600 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/SaaEnrollmentResponse/SetupError.php @@ -0,0 +1,81 @@ +google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError + */ +class SetupError +{ + /** + * Unspecified. + * + * Generated from protobuf enum SETUP_ERROR_UNSPECIFIED = 0; + */ + const SETUP_ERROR_UNSPECIFIED = 0; + /** + * Invalid states for all customers, to be redirected to AA UI for + * additional details. + * + * Generated from protobuf enum ERROR_INVALID_BASE_SETUP = 1; + */ + const ERROR_INVALID_BASE_SETUP = 1; + /** + * Returned when there is not an EKM key configured. + * + * Generated from protobuf enum ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; + */ + const ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; + /** + * Returned when there are no enrolled services or the customer is + * enrolled in CAA only for a subset of services. + * + * Generated from protobuf enum ERROR_NOT_ALL_SERVICES_ENROLLED = 3; + */ + const ERROR_NOT_ALL_SERVICES_ENROLLED = 3; + /** + * Returned when exception was encountered during evaluation of other + * criteria. + * + * Generated from protobuf enum ERROR_SETUP_CHECK_FAILED = 4; + */ + const ERROR_SETUP_CHECK_FAILED = 4; + + private static $valueToName = [ + self::SETUP_ERROR_UNSPECIFIED => 'SETUP_ERROR_UNSPECIFIED', + self::ERROR_INVALID_BASE_SETUP => 'ERROR_INVALID_BASE_SETUP', + self::ERROR_MISSING_EXTERNAL_SIGNING_KEY => 'ERROR_MISSING_EXTERNAL_SIGNING_KEY', + self::ERROR_NOT_ALL_SERVICES_ENROLLED => 'ERROR_NOT_ALL_SERVICES_ENROLLED', + self::ERROR_SETUP_CHECK_FAILED => 'ERROR_SETUP_CHECK_FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SetupError::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_SaaEnrollmentResponse_SetupError::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/SaaEnrollmentResponse/SetupState.php b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/SaaEnrollmentResponse/SetupState.php new file mode 100644 index 000000000000..14bd01931eb5 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/proto/src/Google/Cloud/AssuredWorkloads/V1beta1/Workload/SaaEnrollmentResponse/SetupState.php @@ -0,0 +1,64 @@ +google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState + */ +class SetupState +{ + /** + * Unspecified. + * + * Generated from protobuf enum SETUP_STATE_UNSPECIFIED = 0; + */ + const SETUP_STATE_UNSPECIFIED = 0; + /** + * SAA enrollment pending. + * + * Generated from protobuf enum STATUS_PENDING = 1; + */ + const STATUS_PENDING = 1; + /** + * SAA enrollment comopleted. + * + * Generated from protobuf enum STATUS_COMPLETE = 2; + */ + const STATUS_COMPLETE = 2; + + private static $valueToName = [ + self::SETUP_STATE_UNSPECIFIED => 'SETUP_STATE_UNSPECIFIED', + self::STATUS_PENDING => 'STATUS_PENDING', + self::STATUS_COMPLETE => 'STATUS_COMPLETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SetupState::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_SaaEnrollmentResponse_SetupState::class); + diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/analyze_workload_move.php b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/analyze_workload_move.php new file mode 100644 index 000000000000..c0d32052155e --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/analyze_workload_move.php @@ -0,0 +1,76 @@ +setTarget($target); + + // Call the API and handle any network failures. + try { + /** @var AnalyzeWorkloadMoveResponse $response */ + $response = $assuredWorkloadsServiceClient->analyzeWorkloadMove($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $target = '[TARGET]'; + + analyze_workload_move_sample($target); +} +// [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_AnalyzeWorkloadMove_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/create_workload.php b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/create_workload.php new file mode 100644 index 000000000000..0cf7a6358265 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/create_workload.php @@ -0,0 +1,101 @@ +setDisplayName($workloadDisplayName) + ->setComplianceRegime($workloadComplianceRegime); + $request = (new CreateWorkloadRequest()) + ->setParent($formattedParent) + ->setWorkload($workload); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $assuredWorkloadsServiceClient->createWorkload($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Workload $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AssuredWorkloadsServiceClient::locationName('[ORGANIZATION]', '[LOCATION]'); + $workloadDisplayName = '[DISPLAY_NAME]'; + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + + create_workload_sample($formattedParent, $workloadDisplayName, $workloadComplianceRegime); +} +// [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/delete_workload.php b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/delete_workload.php new file mode 100644 index 000000000000..a6e87ac47c90 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/delete_workload.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $assuredWorkloadsServiceClient->deleteWorkload($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AssuredWorkloadsServiceClient::workloadName( + '[ORGANIZATION]', + '[LOCATION]', + '[WORKLOAD]' + ); + + delete_workload_sample($formattedName); +} +// [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/get_workload.php b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/get_workload.php new file mode 100644 index 000000000000..8264dc04ae18 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/get_workload.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Workload $response */ + $response = $assuredWorkloadsServiceClient->getWorkload($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AssuredWorkloadsServiceClient::workloadName( + '[ORGANIZATION]', + '[LOCATION]', + '[WORKLOAD]' + ); + + get_workload_sample($formattedName); +} +// [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_GetWorkload_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/list_workloads.php b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/list_workloads.php new file mode 100644 index 000000000000..ab0f2400f6a2 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/list_workloads.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $assuredWorkloadsServiceClient->listWorkloads($request); + + /** @var Workload $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AssuredWorkloadsServiceClient::locationName('[ORGANIZATION]', '[LOCATION]'); + + list_workloads_sample($formattedParent); +} +// [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/restrict_allowed_resources.php b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/restrict_allowed_resources.php new file mode 100644 index 000000000000..781f82ef643d --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/restrict_allowed_resources.php @@ -0,0 +1,83 @@ +setName($name) + ->setRestrictionType($restrictionType); + + // Call the API and handle any network failures. + try { + /** @var RestrictAllowedResourcesResponse $response */ + $response = $assuredWorkloadsServiceClient->restrictAllowedResources($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; + + restrict_allowed_resources_sample($name, $restrictionType); +} +// [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedResources_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/update_workload.php b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/update_workload.php new file mode 100644 index 000000000000..9e67b46c56ed --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/samples/V1beta1/AssuredWorkloadsServiceClient/update_workload.php @@ -0,0 +1,87 @@ +setDisplayName($workloadDisplayName) + ->setComplianceRegime($workloadComplianceRegime); + $updateMask = new FieldMask(); + $request = (new UpdateWorkloadRequest()) + ->setWorkload($workload) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Workload $response */ + $response = $assuredWorkloadsServiceClient->updateWorkload($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $workloadDisplayName = '[DISPLAY_NAME]'; + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + + update_workload_sample($workloadDisplayName, $workloadComplianceRegime); +} +// [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_UpdateWorkload_sync] diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/Client/AssuredWorkloadsServiceClient.php b/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/Client/AssuredWorkloadsServiceClient.php new file mode 100644 index 000000000000..86acd45ffa11 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/Client/AssuredWorkloadsServiceClient.php @@ -0,0 +1,534 @@ + analyzeWorkloadMoveAsync(AnalyzeWorkloadMoveRequest $request, array $optionalArgs = []) + * @method PromiseInterface createWorkloadAsync(CreateWorkloadRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteWorkloadAsync(DeleteWorkloadRequest $request, array $optionalArgs = []) + * @method PromiseInterface getWorkloadAsync(GetWorkloadRequest $request, array $optionalArgs = []) + * @method PromiseInterface listWorkloadsAsync(ListWorkloadsRequest $request, array $optionalArgs = []) + * @method PromiseInterface restrictAllowedResourcesAsync(RestrictAllowedResourcesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateWorkloadAsync(UpdateWorkloadRequest $request, array $optionalArgs = []) + */ +final class AssuredWorkloadsServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'assuredworkloads.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'assuredworkloads.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/assured_workloads_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/assured_workloads_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/assured_workloads_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/assured_workloads_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + * + * @experimental + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + * + * @experimental + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $organization + * @param string $location + * + * @return string The formatted location resource. + * + * @experimental + */ + public static function locationName(string $organization, string $location): string + { + return self::getPathTemplate('location')->render([ + 'organization' => $organization, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a workload + * resource. + * + * @param string $organization + * @param string $location + * @param string $workload + * + * @return string The formatted workload resource. + * + * @experimental + */ + public static function workloadName(string $organization, string $location, string $workload): string + { + return self::getPathTemplate('workload')->render([ + 'organization' => $organization, + 'location' => $location, + 'workload' => $workload, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: organizations/{organization}/locations/{location} + * - workload: organizations/{organization}/locations/{location}/workloads/{workload} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'assuredworkloads.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Analyze if the source Assured Workloads can be moved to the target Assured + * Workload + * + * The async variant is + * {@see AssuredWorkloadsServiceClient::analyzeWorkloadMoveAsync()} . + * + * @example samples/V1beta1/AssuredWorkloadsServiceClient/analyze_workload_move.php + * + * @param AnalyzeWorkloadMoveRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnalyzeWorkloadMoveResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function analyzeWorkloadMove(AnalyzeWorkloadMoveRequest $request, array $callOptions = []): AnalyzeWorkloadMoveResponse + { + return $this->startApiCall('AnalyzeWorkloadMove', $request, $callOptions)->wait(); + } + + /** + * Creates Assured Workload. + * + * The async variant is {@see AssuredWorkloadsServiceClient::createWorkloadAsync()} + * . + * + * @example samples/V1beta1/AssuredWorkloadsServiceClient/create_workload.php + * + * @param CreateWorkloadRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createWorkload(CreateWorkloadRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateWorkload', $request, $callOptions)->wait(); + } + + /** + * Deletes the workload. Make sure that workload's direct children are already + * in a deleted state, otherwise the request will fail with a + * FAILED_PRECONDITION error. + * In addition to assuredworkloads.workload.delete permission, the user should + * also have orgpolicy.policy.set permission on the deleted folder to remove + * Assured Workloads OrgPolicies. + * + * The async variant is {@see AssuredWorkloadsServiceClient::deleteWorkloadAsync()} + * . + * + * @example samples/V1beta1/AssuredWorkloadsServiceClient/delete_workload.php + * + * @param DeleteWorkloadRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteWorkload(DeleteWorkloadRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteWorkload', $request, $callOptions)->wait(); + } + + /** + * Gets Assured Workload associated with a CRM Node + * + * The async variant is {@see AssuredWorkloadsServiceClient::getWorkloadAsync()} . + * + * @example samples/V1beta1/AssuredWorkloadsServiceClient/get_workload.php + * + * @param GetWorkloadRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Workload + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getWorkload(GetWorkloadRequest $request, array $callOptions = []): Workload + { + return $this->startApiCall('GetWorkload', $request, $callOptions)->wait(); + } + + /** + * Lists Assured Workloads under a CRM Node. + * + * The async variant is {@see AssuredWorkloadsServiceClient::listWorkloadsAsync()} + * . + * + * @example samples/V1beta1/AssuredWorkloadsServiceClient/list_workloads.php + * + * @param ListWorkloadsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listWorkloads(ListWorkloadsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListWorkloads', $request, $callOptions); + } + + /** + * Restrict the list of resources allowed in the Workload environment. + * The current list of allowed products can be found at + * https://cloud.google.com/assured-workloads/docs/supported-products + * In addition to assuredworkloads.workload.update permission, the user should + * also have orgpolicy.policy.set permission on the folder resource + * to use this functionality. + * + * The async variant is + * {@see AssuredWorkloadsServiceClient::restrictAllowedResourcesAsync()} . + * + * @example samples/V1beta1/AssuredWorkloadsServiceClient/restrict_allowed_resources.php + * + * @param RestrictAllowedResourcesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return RestrictAllowedResourcesResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function restrictAllowedResources(RestrictAllowedResourcesRequest $request, array $callOptions = []): RestrictAllowedResourcesResponse + { + return $this->startApiCall('RestrictAllowedResources', $request, $callOptions)->wait(); + } + + /** + * Updates an existing workload. + * Currently allows updating of workload display_name and labels. + * For force updates don't set etag field in the Workload. + * Only one update operation per workload can be in progress. + * + * The async variant is {@see AssuredWorkloadsServiceClient::updateWorkloadAsync()} + * . + * + * @example samples/V1beta1/AssuredWorkloadsServiceClient/update_workload.php + * + * @param UpdateWorkloadRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Workload + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateWorkload(UpdateWorkloadRequest $request, array $callOptions = []): Workload + { + return $this->startApiCall('UpdateWorkload', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/gapic_metadata.json b/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/gapic_metadata.json new file mode 100644 index 000000000000..da91f5a92bb7 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/gapic_metadata.json @@ -0,0 +1,53 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.assuredworkloads.v1beta1", + "libraryPackage": "Google\\Cloud\\AssuredWorkloads\\V1beta1", + "services": { + "AssuredWorkloadsService": { + "clients": { + "grpc": { + "libraryClient": "AssuredWorkloadsServiceGapicClient", + "rpcs": { + "AnalyzeWorkloadMove": { + "methods": [ + "analyzeWorkloadMove" + ] + }, + "CreateWorkload": { + "methods": [ + "createWorkload" + ] + }, + "DeleteWorkload": { + "methods": [ + "deleteWorkload" + ] + }, + "GetWorkload": { + "methods": [ + "getWorkload" + ] + }, + "ListWorkloads": { + "methods": [ + "listWorkloads" + ] + }, + "RestrictAllowedResources": { + "methods": [ + "restrictAllowedResources" + ] + }, + "UpdateWorkload": { + "methods": [ + "updateWorkload" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/resources/assured_workloads_service_client_config.json b/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/resources/assured_workloads_service_client_config.json new file mode 100644 index 000000000000..947e7ed4a76b --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/resources/assured_workloads_service_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 200, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "AnalyzeWorkloadMove": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListWorkloads": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RestrictAllowedResources": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/resources/assured_workloads_service_descriptor_config.php b/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/resources/assured_workloads_service_descriptor_config.php new file mode 100644 index 000000000000..977c1a614d27 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/resources/assured_workloads_service_descriptor_config.php @@ -0,0 +1,99 @@ + [ + 'google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService' => [ + 'CreateWorkload' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AssuredWorkloads\V1beta1\Workload', + 'metadataReturnType' => '\Google\Cloud\AssuredWorkloads\V1beta1\CreateWorkloadOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'AnalyzeWorkloadMove' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1beta1\AnalyzeWorkloadMoveResponse', + ], + 'DeleteWorkload' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetWorkload' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1beta1\Workload', + ], + 'ListWorkloads' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getWorkloads', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1beta1\ListWorkloadsResponse', + ], + 'RestrictAllowedResources' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateWorkload' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AssuredWorkloads\V1beta1\Workload', + ], + 'templateMap' => [ + 'location' => 'organizations/{organization}/locations/{location}', + 'workload' => 'organizations/{organization}/locations/{location}/workloads/{workload}', + ], + ], + ], +]; diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/resources/assured_workloads_service_rest_client_config.php b/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/resources/assured_workloads_service_rest_client_config.php new file mode 100644 index 000000000000..2148a2339c57 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/src/V1beta1/resources/assured_workloads_service_rest_client_config.php @@ -0,0 +1,88 @@ + [ + 'google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService' => [ + 'CreateWorkload' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=organizations/*/locations/*}/workloads', + 'body' => 'workload', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteWorkload' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*/workloads/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RestrictAllowedResources' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/AssuredWorkloads/v1beta1/tests/Unit/V1beta1/Client/AssuredWorkloadsServiceClientTest.php b/owl-bot-staging/AssuredWorkloads/v1beta1/tests/Unit/V1beta1/Client/AssuredWorkloadsServiceClientTest.php new file mode 100644 index 000000000000..11a512d60171 --- /dev/null +++ b/owl-bot-staging/AssuredWorkloads/v1beta1/tests/Unit/V1beta1/Client/AssuredWorkloadsServiceClientTest.php @@ -0,0 +1,678 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AssuredWorkloadsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AssuredWorkloadsServiceClient($options); + } + + /** @test */ + public function analyzeWorkloadMoveTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AnalyzeWorkloadMoveResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $target = 'target-880905839'; + $request = (new AnalyzeWorkloadMoveRequest()) + ->setTarget($target); + $response = $gapicClient->analyzeWorkloadMove($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/AnalyzeWorkloadMove', $actualFuncCall); + $actualValue = $actualRequestObject->getTarget(); + $this->assertProtobufEquals($target, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeWorkloadMoveExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $target = 'target-880905839'; + $request = (new AnalyzeWorkloadMoveRequest()) + ->setTarget($target); + try { + $gapicClient->analyzeWorkloadMove($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createWorkloadTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createWorkloadTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $billingAccount = 'billingAccount-545871767'; + $etag = 'etag3123477'; + $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; + $enableSovereignControls = false; + $expectedResponse = new Workload(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setBillingAccount($billingAccount); + $expectedResponse->setEtag($etag); + $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); + $expectedResponse->setEnableSovereignControls($enableSovereignControls); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createWorkloadTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); + $workload = new Workload(); + $workloadDisplayName = 'workloadDisplayName191619702'; + $workload->setDisplayName($workloadDisplayName); + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + $workload->setComplianceRegime($workloadComplianceRegime); + $request = (new CreateWorkloadRequest()) + ->setParent($formattedParent) + ->setWorkload($workload); + $response = $gapicClient->createWorkload($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/CreateWorkload', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getWorkload(); + $this->assertProtobufEquals($workload, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createWorkloadTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createWorkloadExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createWorkloadTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); + $workload = new Workload(); + $workloadDisplayName = 'workloadDisplayName191619702'; + $workload->setDisplayName($workloadDisplayName); + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + $workload->setComplianceRegime($workloadComplianceRegime); + $request = (new CreateWorkloadRequest()) + ->setParent($formattedParent) + ->setWorkload($workload); + $response = $gapicClient->createWorkload($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createWorkloadTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteWorkloadTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); + $request = (new DeleteWorkloadRequest()) + ->setName($formattedName); + $gapicClient->deleteWorkload($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/DeleteWorkload', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteWorkloadExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); + $request = (new DeleteWorkloadRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteWorkload($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getWorkloadTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $billingAccount = 'billingAccount-545871767'; + $etag = 'etag3123477'; + $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; + $enableSovereignControls = false; + $expectedResponse = new Workload(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setBillingAccount($billingAccount); + $expectedResponse->setEtag($etag); + $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); + $expectedResponse->setEnableSovereignControls($enableSovereignControls); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); + $request = (new GetWorkloadRequest()) + ->setName($formattedName); + $response = $gapicClient->getWorkload($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/GetWorkload', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getWorkloadExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); + $request = (new GetWorkloadRequest()) + ->setName($formattedName); + try { + $gapicClient->getWorkload($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listWorkloadsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $workloadsElement = new Workload(); + $workloads = [ + $workloadsElement, + ]; + $expectedResponse = new ListWorkloadsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setWorkloads($workloads); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListWorkloadsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listWorkloads($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getWorkloads()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/ListWorkloads', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listWorkloadsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListWorkloadsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listWorkloads($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function restrictAllowedResourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RestrictAllowedResourcesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; + $request = (new RestrictAllowedResourcesRequest()) + ->setName($name) + ->setRestrictionType($restrictionType); + $response = $gapicClient->restrictAllowedResources($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/RestrictAllowedResources', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getRestrictionType(); + $this->assertProtobufEquals($restrictionType, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function restrictAllowedResourcesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; + $request = (new RestrictAllowedResourcesRequest()) + ->setName($name) + ->setRestrictionType($restrictionType); + try { + $gapicClient->restrictAllowedResources($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateWorkloadTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $billingAccount = 'billingAccount-545871767'; + $etag = 'etag3123477'; + $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; + $enableSovereignControls = false; + $expectedResponse = new Workload(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setBillingAccount($billingAccount); + $expectedResponse->setEtag($etag); + $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); + $expectedResponse->setEnableSovereignControls($enableSovereignControls); + $transport->addResponse($expectedResponse); + // Mock request + $workload = new Workload(); + $workloadDisplayName = 'workloadDisplayName191619702'; + $workload->setDisplayName($workloadDisplayName); + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + $workload->setComplianceRegime($workloadComplianceRegime); + $updateMask = new FieldMask(); + $request = (new UpdateWorkloadRequest()) + ->setWorkload($workload) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateWorkload($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/UpdateWorkload', $actualFuncCall); + $actualValue = $actualRequestObject->getWorkload(); + $this->assertProtobufEquals($workload, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateWorkloadExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $workload = new Workload(); + $workloadDisplayName = 'workloadDisplayName191619702'; + $workload->setDisplayName($workloadDisplayName); + $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; + $workload->setComplianceRegime($workloadComplianceRegime); + $updateMask = new FieldMask(); + $request = (new UpdateWorkloadRequest()) + ->setWorkload($workload) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateWorkload($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeWorkloadMoveAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AnalyzeWorkloadMoveResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $target = 'target-880905839'; + $request = (new AnalyzeWorkloadMoveRequest()) + ->setTarget($target); + $response = $gapicClient->analyzeWorkloadMoveAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/AnalyzeWorkloadMove', $actualFuncCall); + $actualValue = $actualRequestObject->getTarget(); + $this->assertProtobufEquals($target, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationPayload.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationPayload.php new file mode 100644 index 000000000000..9e9e65f15492 Binary files /dev/null and b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationPayload.php differ diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationSpec.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationSpec.php new file mode 100644 index 000000000000..cf28095f3918 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationSpec.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' +Ê +,google/cloud/automl/v1/annotation_spec.protogoogle.cloud.automl.v1"Ö +AnnotationSpec +name (  + display_name (  + example_count (:ˆêA„ +$automl.googleapis.com/AnnotationSpec\\projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}B  +com.google.cloud.automl.v1PZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Classification.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Classification.php new file mode 100644 index 000000000000..253a23b5d258 Binary files /dev/null and b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Classification.php differ diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/DataItems.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/DataItems.php new file mode 100644 index 000000000000..bf68a11094d3 Binary files /dev/null and b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/DataItems.php differ diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Dataset.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Dataset.php new file mode 100644 index 000000000000..2ed54c515669 Binary files /dev/null and b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Dataset.php differ diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Detection.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Detection.php new file mode 100644 index 000000000000..05c933b999bd --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Detection.php @@ -0,0 +1,44 @@ +internalAddGeneratedFile( + ' +Ø +&google/cloud/automl/v1/detection.protogoogle.cloud.automl.v1"k +ImageObjectDetectionAnnotation: + bounding_box ( 2$.google.cloud.automl.v1.BoundingPoly +score ("© +BoundingBoxMetricsEntry + iou_threshold ( +mean_average_precision (j +confidence_metrics_entries ( 2F.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryk +ConfidenceMetricsEntry +confidence_threshold ( +recall ( + precision ( +f1_score ("Ñ +%ImageObjectDetectionEvaluationMetrics$ +evaluated_bounding_box_count (U +bounding_box_metrics_entries ( 2/.google.cloud.automl.v1.BoundingBoxMetricsEntry+ +#bounding_box_mean_average_precision (B  +com.google.cloud.automl.v1PZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Geometry.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Geometry.php new file mode 100644 index 000000000000..72db1f5224ca --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Geometry.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' +ë +%google/cloud/automl/v1/geometry.protogoogle.cloud.automl.v1"( +NormalizedVertex +x ( +y ("U + BoundingPolyE +normalized_vertices ( 2(.google.cloud.automl.v1.NormalizedVertexB  +com.google.cloud.automl.v1PZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Image.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Image.php new file mode 100644 index 000000000000..44b8e2623603 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Image.php @@ -0,0 +1,58 @@ +internalAddGeneratedFile( + ' +£ +"google/cloud/automl/v1/image.protogoogle.cloud.automl.v1+google/cloud/automl/v1/classification.proto"r +"ImageClassificationDatasetMetadataL +classification_type (2*.google.cloud.automl.v1.ClassificationTypeBàA"% +#ImageObjectDetectionDatasetMetadata"÷ + ImageClassificationModelMetadata + base_model_id ( BàA* +train_budget_milli_node_hours (BàA( +train_cost_milli_node_hours (BàA + stop_reason ( BàA + +model_type ( BàA +node_qps (BàA + +node_count (BàA"Ü +!ImageObjectDetectionModelMetadata + +model_type ( BàA + +node_count (BàA +node_qps (BàA + stop_reason ( BàA* +train_budget_milli_node_hours (BàA( +train_cost_milli_node_hours (BàA"E +*ImageClassificationModelDeploymentMetadata + +node_count (BàA"F ++ImageObjectDetectionModelDeploymentMetadata + +node_count (BàAB¬ +com.google.cloud.automl.v1B +ImageProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Io.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Io.php new file mode 100644 index 000000000000..36f50727d932 Binary files /dev/null and b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Io.php differ diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Model.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Model.php new file mode 100644 index 000000000000..16324d230031 Binary files /dev/null and b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Model.php differ diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/ModelEvaluation.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/ModelEvaluation.php new file mode 100644 index 000000000000..62c0dee999a7 Binary files /dev/null and b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/ModelEvaluation.php differ diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Operations.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Operations.php new file mode 100644 index 000000000000..7388986ed973 Binary files /dev/null and b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Operations.php differ diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/PredictionService.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/PredictionService.php new file mode 100644 index 000000000000..4d2bbb57bded --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/PredictionService.php @@ -0,0 +1,68 @@ +internalAddGeneratedFile( + ' +ÿ +/google/cloud/automl/v1/prediction_service.protogoogle.cloud.automl.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto/google/cloud/automl/v1/annotation_payload.proto\'google/cloud/automl/v1/data_items.protogoogle/cloud/automl/v1/io.proto#google/longrunning/operations.proto"ô +PredictRequest1 +name ( B#àAúA +automl.googleapis.com/Model< +payload ( 2&.google.cloud.automl.v1.ExamplePayloadBàAB +params ( 22.google.cloud.automl.v1.PredictRequest.ParamsEntry- + ParamsEntry +key (  +value ( :8"‹ +PredictResponse: +payload ( 2).google.cloud.automl.v1.AnnotationPayloadB +preprocessed_input ( 2&.google.cloud.automl.v1.ExamplePayloadG +metadata ( 25.google.cloud.automl.v1.PredictResponse.MetadataEntry/ + MetadataEntry +key (  +value ( :8"Ú +BatchPredictRequest1 +name ( B#àAúA +automl.googleapis.com/ModelJ + input_config ( 2/.google.cloud.automl.v1.BatchPredictInputConfigBàAL + output_config ( 20.google.cloud.automl.v1.BatchPredictOutputConfigBàAG +params ( 27.google.cloud.automl.v1.BatchPredictRequest.ParamsEntry- + ParamsEntry +key (  +value ( :8"‘ +BatchPredictResultJ +metadata ( 28.google.cloud.automl.v1.BatchPredictResult.MetadataEntry/ + MetadataEntry +key (  +value ( :82… +PredictionService¯ +Predict&.google.cloud.automl.v1.PredictRequest\'.google.cloud.automl.v1.PredictResponse"SÚAname,payload,params‚Óä“7"2/v1/{name=projects/*/locations/*/models/*}:predict:*ò + BatchPredict+.google.cloud.automl.v1.BatchPredictRequest.google.longrunning.Operation"•ÊA\' +BatchPredictResultOperationMetadataÚA&name,input_config,output_config,params‚Óä“<"7/v1/{name=projects/*/locations/*/models/*}:batchPredict:*IÊAautoml.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB¸ +com.google.cloud.automl.v1BPredictionServiceProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Service.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Service.php new file mode 100644 index 000000000000..e5cc822384eb Binary files /dev/null and b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Service.php differ diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Text.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Text.php new file mode 100644 index 000000000000..9099b4c7bb52 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Text.php @@ -0,0 +1,37 @@ +internalAddGeneratedFile( + ' +à +!google/cloud/automl/v1/text.protogoogle.cloud.automl.v1"l +!TextClassificationDatasetMetadataG +classification_type (2*.google.cloud.automl.v1.ClassificationType"j +TextClassificationModelMetadataG +classification_type (2*.google.cloud.automl.v1.ClassificationType" +TextExtractionDatasetMetadata" +TextExtractionModelMetadata"5 +TextSentimentDatasetMetadata + sentiment_max (" +TextSentimentModelMetadataB« +com.google.cloud.automl.v1B TextProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextExtraction.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextExtraction.php new file mode 100644 index 000000000000..2243852022ff Binary files /dev/null and b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextExtraction.php differ diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSegment.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSegment.php new file mode 100644 index 000000000000..751b2c2cfe63 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSegment.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' +Ê +)google/cloud/automl/v1/text_segment.protogoogle.cloud.automl.v1"H + TextSegment +content (  + start_offset ( + +end_offset (B² +com.google.cloud.automl.v1BTextSegmentProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSentiment.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSentiment.php new file mode 100644 index 000000000000..4ca9eee82cee --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSentiment.php @@ -0,0 +1,39 @@ +internalAddGeneratedFile( + ' +Õ ++google/cloud/automl/v1/text_sentiment.protogoogle.cloud.automl.v1", +TextSentimentAnnotation + sentiment ("  +TextSentimentEvaluationMetrics + precision ( +recall ( +f1_score ( +mean_absolute_error ( +mean_squared_error ( + linear_kappa ( +quadratic_kappa (a +confusion_matrix ( 2G.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixB´ +com.google.cloud.automl.v1BTextSentimentProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Translation.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Translation.php new file mode 100644 index 000000000000..abb31035d744 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Translation.php @@ -0,0 +1,43 @@ +internalAddGeneratedFile( + ' +Ÿ +(google/cloud/automl/v1/translation.protogoogle.cloud.automl.v1\'google/cloud/automl/v1/data_items.proto"b +TranslationDatasetMetadata! +source_language_code ( BàA! +target_language_code ( BàA"K +TranslationEvaluationMetrics + +bleu_score ( +base_bleu_score ("j +TranslationModelMetadata + +base_model (  +source_language_code (  +target_language_code ( "X +TranslationAnnotation? +translated_content ( 2#.google.cloud.automl.v1.TextSnippetB² +com.google.cloud.automl.v1BTranslationProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationPayload.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationPayload.php new file mode 100644 index 000000000000..f21999b9d69d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationPayload.php @@ -0,0 +1,303 @@ +google.cloud.automl.v1.AnnotationPayload + */ +class AnnotationPayload extends \Google\Protobuf\Internal\Message +{ + /** + * Output only . The resource ID of the annotation spec that + * this annotation pertains to. The annotation spec comes from either an + * ancestor dataset, or the dataset that was used to train the model in use. + * + * Generated from protobuf field string annotation_spec_id = 1; + */ + protected $annotation_spec_id = ''; + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * when the model was trained. Because this field returns a value at model + * training time, for different models trained using the same dataset, the + * returned value could be different as model owner could update the + * `display_name` between any two model training. + * + * Generated from protobuf field string display_name = 5; + */ + protected $display_name = ''; + protected $detail; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TranslationAnnotation $translation + * Annotation details for translation. + * @type \Google\Cloud\AutoMl\V1\ClassificationAnnotation $classification + * Annotation details for content or image classification. + * @type \Google\Cloud\AutoMl\V1\ImageObjectDetectionAnnotation $image_object_detection + * Annotation details for image object detection. + * @type \Google\Cloud\AutoMl\V1\TextExtractionAnnotation $text_extraction + * Annotation details for text extraction. + * @type \Google\Cloud\AutoMl\V1\TextSentimentAnnotation $text_sentiment + * Annotation details for text sentiment. + * @type string $annotation_spec_id + * Output only . The resource ID of the annotation spec that + * this annotation pertains to. The annotation spec comes from either an + * ancestor dataset, or the dataset that was used to train the model in use. + * @type string $display_name + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * when the model was trained. Because this field returns a value at model + * training time, for different models trained using the same dataset, the + * returned value could be different as model owner could update the + * `display_name` between any two model training. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\AnnotationPayload::initOnce(); + parent::__construct($data); + } + + /** + * Annotation details for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationAnnotation translation = 2; + * @return \Google\Cloud\AutoMl\V1\TranslationAnnotation|null + */ + public function getTranslation() + { + return $this->readOneof(2); + } + + public function hasTranslation() + { + return $this->hasOneof(2); + } + + /** + * Annotation details for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationAnnotation translation = 2; + * @param \Google\Cloud\AutoMl\V1\TranslationAnnotation $var + * @return $this + */ + public function setTranslation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TranslationAnnotation::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Annotation details for content or image classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + * @return \Google\Cloud\AutoMl\V1\ClassificationAnnotation|null + */ + public function getClassification() + { + return $this->readOneof(3); + } + + public function hasClassification() + { + return $this->hasOneof(3); + } + + /** + * Annotation details for content or image classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + * @param \Google\Cloud\AutoMl\V1\ClassificationAnnotation $var + * @return $this + */ + public function setClassification($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ClassificationAnnotation::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Annotation details for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * @return \Google\Cloud\AutoMl\V1\ImageObjectDetectionAnnotation|null + */ + public function getImageObjectDetection() + { + return $this->readOneof(4); + } + + public function hasImageObjectDetection() + { + return $this->hasOneof(4); + } + + /** + * Annotation details for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * @param \Google\Cloud\AutoMl\V1\ImageObjectDetectionAnnotation $var + * @return $this + */ + public function setImageObjectDetection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageObjectDetectionAnnotation::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Annotation details for text extraction. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + * @return \Google\Cloud\AutoMl\V1\TextExtractionAnnotation|null + */ + public function getTextExtraction() + { + return $this->readOneof(6); + } + + public function hasTextExtraction() + { + return $this->hasOneof(6); + } + + /** + * Annotation details for text extraction. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + * @param \Google\Cloud\AutoMl\V1\TextExtractionAnnotation $var + * @return $this + */ + public function setTextExtraction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextExtractionAnnotation::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Annotation details for text sentiment. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + * @return \Google\Cloud\AutoMl\V1\TextSentimentAnnotation|null + */ + public function getTextSentiment() + { + return $this->readOneof(7); + } + + public function hasTextSentiment() + { + return $this->hasOneof(7); + } + + /** + * Annotation details for text sentiment. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + * @param \Google\Cloud\AutoMl\V1\TextSentimentAnnotation $var + * @return $this + */ + public function setTextSentiment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSentimentAnnotation::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Output only . The resource ID of the annotation spec that + * this annotation pertains to. The annotation spec comes from either an + * ancestor dataset, or the dataset that was used to train the model in use. + * + * Generated from protobuf field string annotation_spec_id = 1; + * @return string + */ + public function getAnnotationSpecId() + { + return $this->annotation_spec_id; + } + + /** + * Output only . The resource ID of the annotation spec that + * this annotation pertains to. The annotation spec comes from either an + * ancestor dataset, or the dataset that was used to train the model in use. + * + * Generated from protobuf field string annotation_spec_id = 1; + * @param string $var + * @return $this + */ + public function setAnnotationSpecId($var) + { + GPBUtil::checkString($var, True); + $this->annotation_spec_id = $var; + + return $this; + } + + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * when the model was trained. Because this field returns a value at model + * training time, for different models trained using the same dataset, the + * returned value could be different as model owner could update the + * `display_name` between any two model training. + * + * Generated from protobuf field string display_name = 5; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * when the model was trained. Because this field returns a value at model + * training time, for different models trained using the same dataset, the + * returned value could be different as model owner could update the + * `display_name` between any two model training. + * + * Generated from protobuf field string display_name = 5; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * @return string + */ + public function getDetail() + { + return $this->whichOneof("detail"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationSpec.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationSpec.php new file mode 100644 index 000000000000..3bfaaba11c7b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationSpec.php @@ -0,0 +1,151 @@ +google.cloud.automl.v1.AnnotationSpec + */ +class AnnotationSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Resource name of the annotation spec. + * Form: + * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The name of the annotation spec to show in the interface. The name can be + * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Output only. The number of examples in the parent dataset + * labeled by the annotation spec. + * + * Generated from protobuf field int32 example_count = 9; + */ + protected $example_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Resource name of the annotation spec. + * Form: + * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + * @type string $display_name + * Required. The name of the annotation spec to show in the interface. The name can be + * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + * @type int $example_count + * Output only. The number of examples in the parent dataset + * labeled by the annotation spec. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\AnnotationSpec::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Resource name of the annotation spec. + * Form: + * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Resource name of the annotation spec. + * Form: + * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of the annotation spec to show in the interface. The name can be + * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the annotation spec to show in the interface. The name can be + * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The number of examples in the parent dataset + * labeled by the annotation spec. + * + * Generated from protobuf field int32 example_count = 9; + * @return int + */ + public function getExampleCount() + { + return $this->example_count; + } + + /** + * Output only. The number of examples in the parent dataset + * labeled by the annotation spec. + * + * Generated from protobuf field int32 example_count = 9; + * @param int $var + * @return $this + */ + public function setExampleCount($var) + { + GPBUtil::checkInt32($var); + $this->example_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictInputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictInputConfig.php new file mode 100644 index 000000000000..a7c1163a47f4 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictInputConfig.php @@ -0,0 +1,271 @@ + + * "First Name","Last Name","Dob","Addresses" + * "John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]" + * "Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]} + * + * **For bigquery_source:** + * The URI of a BigQuery table. The user data size of the BigQuery + * table must be 100GB or smaller. + * The column names must contain the model's + * [input_feature_column_specs'][google.cloud.automl.v1.TablesModelMetadata.input_feature_column_specs] + * [display_name-s][google.cloud.automl.v1.ColumnSpec.display_name] + * (order doesn't matter). The columns corresponding to the model's + * input feature column specs must contain values compatible with the + * column spec's data types. Prediction on all the rows of the table + * will be attempted. + * **Input field definitions:** + * `GCS_FILE_PATH` + * : The path to a file on Google Cloud Storage. For example, + * "gs://folder/video.avi". + * `TIME_SEGMENT_START` + * : (`TIME_OFFSET`) + * Expresses a beginning, inclusive, of a time segment + * within an example that has a time dimension + * (e.g. video). + * `TIME_SEGMENT_END` + * : (`TIME_OFFSET`) + * Expresses an end, exclusive, of a time segment within + * n example that has a time dimension (e.g. video). + * `TIME_OFFSET` + * : A number of seconds as measured from the start of an + * example (e.g. video). Fractions are allowed, up to a + * microsecond precision. "inf" is allowed, and it means the end + * of the example. + * **Errors:** + * If any of the provided CSV files can't be parsed or if more than certain + * percent of CSV rows cannot be processed then the operation fails and + * prediction does not happen. Regardless of overall success or failure the + * per-row failures, up to a certain count cap, will be listed in + * Operation.metadata.partial_failures. + * + * Generated from protobuf message google.cloud.automl.v1.BatchPredictInputConfig + */ +class BatchPredictInputConfig extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsSource $gcs_source + * Required. The Google Cloud Storage location for the input content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Google Cloud Storage location for the input content. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\GcsSource|null + */ + public function getGcsSource() + { + return $this->readOneof(1); + } + + public function hasGcsSource() + { + return $this->hasOneof(1); + } + + /** + * Required. The Google Cloud Storage location for the input content. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata.php new file mode 100644 index 000000000000..e4da433620a5 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata.php @@ -0,0 +1,125 @@ +google.cloud.automl.v1.BatchPredictOperationMetadata + */ +class BatchPredictOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The input config that was given upon starting this + * batch predict operation. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + protected $input_config = null; + /** + * Output only. Information further describing this batch predict's output. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + */ + protected $output_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $input_config + * Output only. The input config that was given upon starting this + * batch predict operation. + * @type \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata\BatchPredictOutputInfo $output_info + * Output only. Information further describing this batch predict's output. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The input config that was given upon starting this + * batch predict operation. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + * @return \Google\Cloud\AutoMl\V1\BatchPredictInputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Output only. The input config that was given upon starting this + * batch predict operation. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + * @param \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BatchPredictInputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Output only. Information further describing this batch predict's output. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * @return \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata\BatchPredictOutputInfo|null + */ + public function getOutputInfo() + { + return $this->output_info; + } + + public function hasOutputInfo() + { + return isset($this->output_info); + } + + public function clearOutputInfo() + { + unset($this->output_info); + } + + /** + * Output only. Information further describing this batch predict's output. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * @param \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata\BatchPredictOutputInfo $var + * @return $this + */ + public function setOutputInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata\BatchPredictOutputInfo::class); + $this->output_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata/BatchPredictOutputInfo.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata/BatchPredictOutputInfo.php new file mode 100644 index 000000000000..602511a659d7 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata/BatchPredictOutputInfo.php @@ -0,0 +1,83 @@ +google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + */ +class BatchPredictOutputInfo extends \Google\Protobuf\Internal\Message +{ + protected $output_location; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_output_directory + * The full path of the Google Cloud Storage directory created, into which + * the prediction output is written. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the prediction output is written. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @return string + */ + public function getGcsOutputDirectory() + { + return $this->readOneof(1); + } + + public function hasGcsOutputDirectory() + { + return $this->hasOneof(1); + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the prediction output is written. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @param string $var + * @return $this + */ + public function setGcsOutputDirectory($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getOutputLocation() + { + return $this->whichOneof("output_location"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BatchPredictOutputInfo::class, \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata_BatchPredictOutputInfo::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOutputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOutputConfig.php new file mode 100644 index 000000000000..90d16feeab7f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOutputConfig.php @@ -0,0 +1,311 @@ +-", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents + * of it depends on the ML problem the predictions are made for. + * * For Image Classification: + * In the created directory files `image_classification_1.jsonl`, + * `image_classification_2.jsonl`,...,`image_classification_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of the successfully predicted images and annotations. + * A single image will be listed only once with all its annotations, + * and its annotations will never be split across files. + * Each .JSONL file will contain, per line, a JSON representation of a + * proto that wraps image's "ID" : "" followed by a list of + * zero or more AnnotationPayload protos (called annotations), which + * have classification detail populated. + * If prediction for any image failed (partially or completely), then an + * additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` + * files will be created (N depends on total number of failed + * predictions). These files will have a JSON representation of a proto + * that wraps the same "ID" : "" but here followed by + * exactly one + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`fields. + * * For Image Object Detection: + * In the created directory files `image_object_detection_1.jsonl`, + * `image_object_detection_2.jsonl`,...,`image_object_detection_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of the successfully predicted images and annotations. + * Each .JSONL file will contain, per line, a JSON representation of a + * proto that wraps image's "ID" : "" followed by a list of + * zero or more AnnotationPayload protos (called annotations), which + * have image_object_detection detail populated. A single image will + * be listed only once with all its annotations, and its annotations + * will never be split across files. + * If prediction for any image failed (partially or completely), then + * additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` + * files will be created (N depends on total number of failed + * predictions). These files will have a JSON representation of a proto + * that wraps the same "ID" : "" but here followed by + * exactly one + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`fields. + * * For Video Classification: + * In the created directory a video_classification.csv file, and a .JSON + * file per each video classification requested in the input (i.e. each + * line in given CSV(s)), will be created. + * The format of video_classification.csv is: + * GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS + * where: + * GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 + * the prediction input lines (i.e. video_classification.csv has + * precisely the same number of lines as the prediction input had.) + * JSON_FILE_NAME = Name of .JSON file in the output directory, which + * contains prediction responses for the video time segment. + * STATUS = "OK" if prediction completed successfully, or an error code + * with message otherwise. If STATUS is not "OK" then the .JSON file + * for that line may not exist or be empty. + * Each .JSON file, assuming STATUS is "OK", will contain a list of + * AnnotationPayload protos in JSON format, which are the predictions + * for the video time segment the file is assigned to in the + * video_classification.csv. All AnnotationPayload protos will have + * video_classification field set, and will be sorted by + * video_classification.type field (note that the returned types are + * governed by `classifaction_types` parameter in + * [PredictService.BatchPredictRequest.params][]). + * * For Video Object Tracking: + * In the created directory a video_object_tracking.csv file will be + * created, and multiple files video_object_trackinng_1.json, + * video_object_trackinng_2.json,..., video_object_trackinng_N.json, + * where N is the number of requests in the input (i.e. the number of + * lines in given CSV(s)). + * The format of video_object_tracking.csv is: + * GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS + * where: + * GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 + * the prediction input lines (i.e. video_object_tracking.csv has + * precisely the same number of lines as the prediction input had.) + * JSON_FILE_NAME = Name of .JSON file in the output directory, which + * contains prediction responses for the video time segment. + * STATUS = "OK" if prediction completed successfully, or an error + * code with message otherwise. If STATUS is not "OK" then the .JSON + * file for that line may not exist or be empty. + * Each .JSON file, assuming STATUS is "OK", will contain a list of + * AnnotationPayload protos in JSON format, which are the predictions + * for each frame of the video time segment the file is assigned to in + * video_object_tracking.csv. All AnnotationPayload protos will have + * video_object_tracking field set. + * * For Text Classification: + * In the created directory files `text_classification_1.jsonl`, + * `text_classification_2.jsonl`,...,`text_classification_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of inputs and annotations found. + * Each .JSONL file will contain, per line, a JSON representation of a + * proto that wraps input text file (or document) in + * the text snippet (or document) proto and a list of + * zero or more AnnotationPayload protos (called annotations), which + * have classification detail populated. A single text file (or + * document) will be listed only once with all its annotations, and its + * annotations will never be split across files. + * If prediction for any input file (or document) failed (partially or + * completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., + * `errors_N.jsonl` files will be created (N depends on total number of + * failed predictions). These files will have a JSON representation of a + * proto that wraps input file followed by exactly one + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`. + * * For Text Sentiment: + * In the created directory files `text_sentiment_1.jsonl`, + * `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of inputs and annotations found. + * Each .JSONL file will contain, per line, a JSON representation of a + * proto that wraps input text file (or document) in + * the text snippet (or document) proto and a list of + * zero or more AnnotationPayload protos (called annotations), which + * have text_sentiment detail populated. A single text file (or + * document) will be listed only once with all its annotations, and its + * annotations will never be split across files. + * If prediction for any input file (or document) failed (partially or + * completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., + * `errors_N.jsonl` files will be created (N depends on total number of + * failed predictions). These files will have a JSON representation of a + * proto that wraps input file followed by exactly one + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`. + * * For Text Extraction: + * In the created directory files `text_extraction_1.jsonl`, + * `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of inputs and annotations found. + * The contents of these .JSONL file(s) depend on whether the input + * used inline text, or documents. + * If input was inline, then each .JSONL file will contain, per line, + * a JSON representation of a proto that wraps given in request text + * snippet's "id" (if specified), followed by input text snippet, + * and a list of zero or more + * AnnotationPayload protos (called annotations), which have + * text_extraction detail populated. A single text snippet will be + * listed only once with all its annotations, and its annotations will + * never be split across files. + * If input used documents, then each .JSONL file will contain, per + * line, a JSON representation of a proto that wraps given in request + * document proto, followed by its OCR-ed representation in the form + * of a text snippet, finally followed by a list of zero or more + * AnnotationPayload protos (called annotations), which have + * text_extraction detail populated and refer, via their indices, to + * the OCR-ed text snippet. A single document (and its text snippet) + * will be listed only once with all its annotations, and its + * annotations will never be split across files. + * If prediction for any text snippet failed (partially or completely), + * then additional `errors_1.jsonl`, `errors_2.jsonl`,..., + * `errors_N.jsonl` files will be created (N depends on total number of + * failed predictions). These files will have a JSON representation of a + * proto that wraps either the "id" : "" (in case of inline) + * or the document proto (in case of document) but here followed by + * exactly one + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`. + * * For Tables: + * Output depends on whether + * [gcs_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.gcs_destination] + * or + * [bigquery_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.bigquery_destination] + * is set (either is allowed). + * Google Cloud Storage case: + * In the created directory files `tables_1.csv`, `tables_2.csv`,..., + * `tables_N.csv` will be created, where N may be 1, and depends on + * the total number of the successfully predicted rows. + * For all CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]: + * Each .csv file will contain a header, listing all columns' + * [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name] + * given on input followed by M target column names in the format of + * "<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] + * [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>__score" where M is the number of distinct target values, + * i.e. number of distinct values in the target column of the table + * used to train the model. Subsequent lines will contain the + * respective values of successfully predicted rows, with the last, + * i.e. the target, columns having the corresponding prediction + * [scores][google.cloud.automl.v1p1beta.TablesAnnotation.score]. + * For REGRESSION and FORECASTING + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]: + * Each .csv file will contain a header, listing all columns' + * [display_name-s][google.cloud.automl.v1p1beta.display_name] + * given on input followed by the predicted target column with name + * in the format of + * "predicted_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] + * [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>" + * Subsequent lines will contain the respective values of + * successfully predicted rows, with the last, i.e. the target, + * column having the predicted target value. + * If prediction for any rows failed, then an additional + * `errors_1.csv`, `errors_2.csv`,..., `errors_N.csv` will be + * created (N depends on total number of failed rows). These files + * will have analogous format as `tables_*.csv`, but always with a + * single target column having + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * represented as a JSON string, and containing only `code` and + * `message`. + * BigQuery case: + * [bigquery_destination][google.cloud.automl.v1p1beta.OutputConfig.bigquery_destination] + * pointing to a BigQuery project must be set. In the given project a + * new dataset will be created with name + * `prediction__` + * where will be made + * BigQuery-dataset-name compatible (e.g. most special characters will + * become underscores), and timestamp will be in + * YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset + * two tables will be created, `predictions`, and `errors`. + * The `predictions` table's column names will be the input columns' + * [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name] + * followed by the target column with name in the format of + * "predicted_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] + * [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>" + * The input feature columns will contain the respective values of + * successfully predicted rows, with the target column having an + * ARRAY of + * [AnnotationPayloads][google.cloud.automl.v1p1beta.AnnotationPayload], + * represented as STRUCT-s, containing + * [TablesAnnotation][google.cloud.automl.v1p1beta.TablesAnnotation]. + * The `errors` table contains rows for which the prediction has + * failed, it has analogous input columns while the target column name + * is in the format of + * "errors_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] + * [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>", + * and as a value has + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * represented as a STRUCT, and containing only `code` and `message`. + * + * Generated from protobuf message google.cloud.automl.v1.BatchPredictOutputConfig + */ +class BatchPredictOutputConfig extends \Google\Protobuf\Internal\Message +{ + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsDestination $gcs_destination + * Required. The Google Cloud Storage location of the directory where the + * output is to be written to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Google Cloud Storage location of the directory where the + * output is to be written to. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * Required. The Google Cloud Storage location of the directory where the + * output is to be written to. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictRequest.php new file mode 100644 index 000000000000..581405bbbb17 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictRequest.php @@ -0,0 +1,553 @@ +google.cloud.automl.v1.BatchPredictRequest + */ +class BatchPredictRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the model requested to serve the batch prediction. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The input configuration for batch prediction. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + /** + * Required. The Configuration specifying where output predictions should + * be written. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + /** + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * AutoML Natural Language Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * AutoML Video Intelligence Object Tracking + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * + * Generated from protobuf field map params = 5; + */ + private $params; + + /** + * @param string $name Required. Name of the model requested to serve the batch prediction. Please see + * {@see PredictionServiceClient::modelName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $inputConfig Required. The input configuration for batch prediction. + * @param \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig $outputConfig Required. The Configuration specifying where output predictions should + * be written. + * @param array $params Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * + * AutoML Natural Language Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * + * + * AutoML Vision Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * AutoML Vision Object Detection + * + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * + * AutoML Video Intelligence Object Tracking + * + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * + * + * @return \Google\Cloud\AutoMl\V1\BatchPredictRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $inputConfig, \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig $outputConfig, array $params): self + { + return (new self()) + ->setName($name) + ->setInputConfig($inputConfig) + ->setOutputConfig($outputConfig) + ->setParams($params); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the model requested to serve the batch prediction. + * @type \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $input_config + * Required. The input configuration for batch prediction. + * @type \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig $output_config + * Required. The Configuration specifying where output predictions should + * be written. + * @type array|\Google\Protobuf\Internal\MapField $params + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * AutoML Natural Language Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * AutoML Video Intelligence Object Tracking + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the model requested to serve the batch prediction. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the model requested to serve the batch prediction. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The input configuration for batch prediction. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\BatchPredictInputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Required. The input configuration for batch prediction. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BatchPredictInputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Required. The Configuration specifying where output predictions should + * be written. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. The Configuration specifying where output predictions should + * be written. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig::class); + $this->output_config = $var; + + return $this; + } + + /** + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * AutoML Natural Language Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * AutoML Video Intelligence Object Tracking + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * + * Generated from protobuf field map params = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParams() + { + return $this->params; + } + + /** + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * AutoML Natural Language Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * AutoML Video Intelligence Object Tracking + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * + * Generated from protobuf field map params = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setParams($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->params = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictResult.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictResult.php new file mode 100644 index 000000000000..cba80eebfee9 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictResult.php @@ -0,0 +1,93 @@ +google.cloud.automl.v1.BatchPredictResult + */ +class BatchPredictResult extends \Google\Protobuf\Internal\Message +{ + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per image. + * AutoML Video Intelligence Object Tracking + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per frame. + * + * Generated from protobuf field map metadata = 1; + */ + private $metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per image. + * AutoML Video Intelligence Object Tracking + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per frame. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per image. + * AutoML Video Intelligence Object Tracking + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per frame. + * + * Generated from protobuf field map metadata = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per image. + * AutoML Video Intelligence Object Tracking + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per frame. + * + * Generated from protobuf field map metadata = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry.php new file mode 100644 index 000000000000..375e95b8e033 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry.php @@ -0,0 +1,148 @@ +google.cloud.automl.v1.BoundingBoxMetricsEntry + */ +class BoundingBoxMetricsEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The intersection-over-union threshold value used to compute + * this metrics entry. + * + * Generated from protobuf field float iou_threshold = 1; + */ + protected $iou_threshold = 0.0; + /** + * Output only. The mean average precision, most often close to au_prc. + * + * Generated from protobuf field float mean_average_precision = 2; + */ + protected $mean_average_precision = 0.0; + /** + * Output only. Metrics for each label-match confidence_threshold from + * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + * derived from them. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + */ + private $confidence_metrics_entries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $iou_threshold + * Output only. The intersection-over-union threshold value used to compute + * this metrics entry. + * @type float $mean_average_precision + * Output only. The mean average precision, most often close to au_prc. + * @type array<\Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $confidence_metrics_entries + * Output only. Metrics for each label-match confidence_threshold from + * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + * derived from them. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Detection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The intersection-over-union threshold value used to compute + * this metrics entry. + * + * Generated from protobuf field float iou_threshold = 1; + * @return float + */ + public function getIouThreshold() + { + return $this->iou_threshold; + } + + /** + * Output only. The intersection-over-union threshold value used to compute + * this metrics entry. + * + * Generated from protobuf field float iou_threshold = 1; + * @param float $var + * @return $this + */ + public function setIouThreshold($var) + { + GPBUtil::checkFloat($var); + $this->iou_threshold = $var; + + return $this; + } + + /** + * Output only. The mean average precision, most often close to au_prc. + * + * Generated from protobuf field float mean_average_precision = 2; + * @return float + */ + public function getMeanAveragePrecision() + { + return $this->mean_average_precision; + } + + /** + * Output only. The mean average precision, most often close to au_prc. + * + * Generated from protobuf field float mean_average_precision = 2; + * @param float $var + * @return $this + */ + public function setMeanAveragePrecision($var) + { + GPBUtil::checkFloat($var); + $this->mean_average_precision = $var; + + return $this; + } + + /** + * Output only. Metrics for each label-match confidence_threshold from + * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + * derived from them. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConfidenceMetricsEntries() + { + return $this->confidence_metrics_entries; + } + + /** + * Output only. Metrics for each label-match confidence_threshold from + * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + * derived from them. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * @param array<\Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConfidenceMetricsEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry\ConfidenceMetricsEntry::class); + $this->confidence_metrics_entries = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry/ConfidenceMetricsEntry.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry/ConfidenceMetricsEntry.php new file mode 100644 index 000000000000..7b96c02b4d5a --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry/ConfidenceMetricsEntry.php @@ -0,0 +1,172 @@ +google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + */ +class ConfidenceMetricsEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The confidence threshold value used to compute the metrics. + * + * Generated from protobuf field float confidence_threshold = 1; + */ + protected $confidence_threshold = 0.0; + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 2; + */ + protected $recall = 0.0; + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + */ + protected $precision = 0.0; + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + */ + protected $f1_score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $confidence_threshold + * Output only. The confidence threshold value used to compute the metrics. + * @type float $recall + * Output only. Recall under the given confidence threshold. + * @type float $precision + * Output only. Precision under the given confidence threshold. + * @type float $f1_score + * Output only. The harmonic mean of recall and precision. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Detection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The confidence threshold value used to compute the metrics. + * + * Generated from protobuf field float confidence_threshold = 1; + * @return float + */ + public function getConfidenceThreshold() + { + return $this->confidence_threshold; + } + + /** + * Output only. The confidence threshold value used to compute the metrics. + * + * Generated from protobuf field float confidence_threshold = 1; + * @param float $var + * @return $this + */ + public function setConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->confidence_threshold = $var; + + return $this; + } + + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 2; + * @return float + */ + public function getRecall() + { + return $this->recall; + } + + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 2; + * @param float $var + * @return $this + */ + public function setRecall($var) + { + GPBUtil::checkFloat($var); + $this->recall = $var; + + return $this; + } + + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + * @return float + */ + public function getPrecision() + { + return $this->precision; + } + + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + * @param float $var + * @return $this + */ + public function setPrecision($var) + { + GPBUtil::checkFloat($var); + $this->precision = $var; + + return $this; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + * @return float + */ + public function getF1Score() + { + return $this->f1_score; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + * @param float $var + * @return $this + */ + public function setF1Score($var) + { + GPBUtil::checkFloat($var); + $this->f1_score = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConfidenceMetricsEntry::class, \Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry_ConfidenceMetricsEntry::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingPoly.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingPoly.php new file mode 100644 index 000000000000..9155aadb93dd --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingPoly.php @@ -0,0 +1,69 @@ +google.cloud.automl.v1.BoundingPoly + */ +class BoundingPoly extends \Google\Protobuf\Internal\Message +{ + /** + * Output only . The bounding polygon normalized vertices. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + private $normalized_vertices; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AutoMl\V1\NormalizedVertex>|\Google\Protobuf\Internal\RepeatedField $normalized_vertices + * Output only . The bounding polygon normalized vertices. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Geometry::initOnce(); + parent::__construct($data); + } + + /** + * Output only . The bounding polygon normalized vertices. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNormalizedVertices() + { + return $this->normalized_vertices; + } + + /** + * Output only . The bounding polygon normalized vertices. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + * @param array<\Google\Cloud\AutoMl\V1\NormalizedVertex>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNormalizedVertices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\NormalizedVertex::class); + $this->normalized_vertices = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationAnnotation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationAnnotation.php new file mode 100644 index 000000000000..1a78afa7261b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationAnnotation.php @@ -0,0 +1,83 @@ +google.cloud.automl.v1.ClassificationAnnotation + */ +class ClassificationAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence that the annotation is positive. If a user + * approves an annotation as negative or positive, the score value remains + * unchanged. If a user creates an annotation, the score is 0 for negative or + * 1 for positive. + * + * Generated from protobuf field float score = 1; + */ + protected $score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $score + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence that the annotation is positive. If a user + * approves an annotation as negative or positive, the score value remains + * unchanged. If a user creates an annotation, the score is 0 for negative or + * 1 for positive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Classification::initOnce(); + parent::__construct($data); + } + + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence that the annotation is positive. If a user + * approves an annotation as negative or positive, the score value remains + * unchanged. If a user creates an annotation, the score is 0 for negative or + * 1 for positive. + * + * Generated from protobuf field float score = 1; + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence that the annotation is positive. If a user + * approves an annotation as negative or positive, the score value remains + * unchanged. If a user creates an annotation, the score is 0 for negative or + * 1 for positive. + * + * Generated from protobuf field float score = 1; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics.php new file mode 100644 index 000000000000..4391dc5673d6 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics.php @@ -0,0 +1,293 @@ +google.cloud.automl.v1.ClassificationEvaluationMetrics + */ +class ClassificationEvaluationMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + * for the overall evaluation. + * + * Generated from protobuf field float au_prc = 1; + */ + protected $au_prc = 0.0; + /** + * Output only. The Area Under Receiver Operating Characteristic curve metric. + * Micro-averaged for the overall evaluation. + * + * Generated from protobuf field float au_roc = 6; + */ + protected $au_roc = 0.0; + /** + * Output only. The Log Loss metric. + * + * Generated from protobuf field float log_loss = 7; + */ + protected $log_loss = 0.0; + /** + * Output only. Metrics for each confidence_threshold in + * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + * position_threshold = INT32_MAX_VALUE. + * ROC and precision-recall curves, and other aggregated metrics are derived + * from them. The confidence metrics entries may also be supplied for + * additional values of position_threshold, but from these no aggregated + * metrics are computed. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + private $confidence_metrics_entry; + /** + * Output only. Confusion matrix of the evaluation. + * Only set for MULTICLASS classification problems where number + * of labels is no more than 10. + * Only set for model level evaluation, not for evaluation per label. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + protected $confusion_matrix = null; + /** + * Output only. The annotation spec ids used for this evaluation. + * + * Generated from protobuf field repeated string annotation_spec_id = 5; + */ + private $annotation_spec_id; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $au_prc + * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + * for the overall evaluation. + * @type float $au_roc + * Output only. The Area Under Receiver Operating Characteristic curve metric. + * Micro-averaged for the overall evaluation. + * @type float $log_loss + * Output only. The Log Loss metric. + * @type array<\Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $confidence_metrics_entry + * Output only. Metrics for each confidence_threshold in + * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + * position_threshold = INT32_MAX_VALUE. + * ROC and precision-recall curves, and other aggregated metrics are derived + * from them. The confidence metrics entries may also be supplied for + * additional values of position_threshold, but from these no aggregated + * metrics are computed. + * @type \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix $confusion_matrix + * Output only. Confusion matrix of the evaluation. + * Only set for MULTICLASS classification problems where number + * of labels is no more than 10. + * Only set for model level evaluation, not for evaluation per label. + * @type array|\Google\Protobuf\Internal\RepeatedField $annotation_spec_id + * Output only. The annotation spec ids used for this evaluation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Classification::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + * for the overall evaluation. + * + * Generated from protobuf field float au_prc = 1; + * @return float + */ + public function getAuPrc() + { + return $this->au_prc; + } + + /** + * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + * for the overall evaluation. + * + * Generated from protobuf field float au_prc = 1; + * @param float $var + * @return $this + */ + public function setAuPrc($var) + { + GPBUtil::checkFloat($var); + $this->au_prc = $var; + + return $this; + } + + /** + * Output only. The Area Under Receiver Operating Characteristic curve metric. + * Micro-averaged for the overall evaluation. + * + * Generated from protobuf field float au_roc = 6; + * @return float + */ + public function getAuRoc() + { + return $this->au_roc; + } + + /** + * Output only. The Area Under Receiver Operating Characteristic curve metric. + * Micro-averaged for the overall evaluation. + * + * Generated from protobuf field float au_roc = 6; + * @param float $var + * @return $this + */ + public function setAuRoc($var) + { + GPBUtil::checkFloat($var); + $this->au_roc = $var; + + return $this; + } + + /** + * Output only. The Log Loss metric. + * + * Generated from protobuf field float log_loss = 7; + * @return float + */ + public function getLogLoss() + { + return $this->log_loss; + } + + /** + * Output only. The Log Loss metric. + * + * Generated from protobuf field float log_loss = 7; + * @param float $var + * @return $this + */ + public function setLogLoss($var) + { + GPBUtil::checkFloat($var); + $this->log_loss = $var; + + return $this; + } + + /** + * Output only. Metrics for each confidence_threshold in + * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + * position_threshold = INT32_MAX_VALUE. + * ROC and precision-recall curves, and other aggregated metrics are derived + * from them. The confidence metrics entries may also be supplied for + * additional values of position_threshold, but from these no aggregated + * metrics are computed. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConfidenceMetricsEntry() + { + return $this->confidence_metrics_entry; + } + + /** + * Output only. Metrics for each confidence_threshold in + * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + * position_threshold = INT32_MAX_VALUE. + * ROC and precision-recall curves, and other aggregated metrics are derived + * from them. The confidence metrics entries may also be supplied for + * additional values of position_threshold, but from these no aggregated + * metrics are computed. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * @param array<\Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConfidenceMetricsEntry($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry::class); + $this->confidence_metrics_entry = $arr; + + return $this; + } + + /** + * Output only. Confusion matrix of the evaluation. + * Only set for MULTICLASS classification problems where number + * of labels is no more than 10. + * Only set for model level evaluation, not for evaluation per label. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * @return \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix|null + */ + public function getConfusionMatrix() + { + return $this->confusion_matrix; + } + + public function hasConfusionMatrix() + { + return isset($this->confusion_matrix); + } + + public function clearConfusionMatrix() + { + unset($this->confusion_matrix); + } + + /** + * Output only. Confusion matrix of the evaluation. + * Only set for MULTICLASS classification problems where number + * of labels is no more than 10. + * Only set for model level evaluation, not for evaluation per label. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * @param \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix $var + * @return $this + */ + public function setConfusionMatrix($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix::class); + $this->confusion_matrix = $var; + + return $this; + } + + /** + * Output only. The annotation spec ids used for this evaluation. + * + * Generated from protobuf field repeated string annotation_spec_id = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnnotationSpecId() + { + return $this->annotation_spec_id; + } + + /** + * Output only. The annotation spec ids used for this evaluation. + * + * Generated from protobuf field repeated string annotation_spec_id = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnnotationSpecId($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotation_spec_id = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfidenceMetricsEntry.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfidenceMetricsEntry.php new file mode 100644 index 000000000000..edfbb3a2f738 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfidenceMetricsEntry.php @@ -0,0 +1,568 @@ +google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + */ +class ConfidenceMetricsEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Metrics are computed with an assumption that the model + * never returns predictions with score lower than this value. + * + * Generated from protobuf field float confidence_threshold = 1; + */ + protected $confidence_threshold = 0.0; + /** + * Output only. Metrics are computed with an assumption that the model + * always returns at most this many predictions (ordered by their score, + * descendingly), but they all still need to meet the confidence_threshold. + * + * Generated from protobuf field int32 position_threshold = 14; + */ + protected $position_threshold = 0; + /** + * Output only. Recall (True Positive Rate) for the given confidence + * threshold. + * + * Generated from protobuf field float recall = 2; + */ + protected $recall = 0.0; + /** + * Output only. Precision for the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + */ + protected $precision = 0.0; + /** + * Output only. False Positive Rate for the given confidence threshold. + * + * Generated from protobuf field float false_positive_rate = 8; + */ + protected $false_positive_rate = 0.0; + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + */ + protected $f1_score = 0.0; + /** + * Output only. The Recall (True Positive Rate) when only considering the + * label that has the highest prediction score and not below the confidence + * threshold for each example. + * + * Generated from protobuf field float recall_at1 = 5; + */ + protected $recall_at1 = 0.0; + /** + * Output only. The precision when only considering the label that has the + * highest prediction score and not below the confidence threshold for each + * example. + * + * Generated from protobuf field float precision_at1 = 6; + */ + protected $precision_at1 = 0.0; + /** + * Output only. The False Positive Rate when only considering the label that + * has the highest prediction score and not below the confidence threshold + * for each example. + * + * Generated from protobuf field float false_positive_rate_at1 = 9; + */ + protected $false_positive_rate_at1 = 0.0; + /** + * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + * + * Generated from protobuf field float f1_score_at1 = 7; + */ + protected $f1_score_at1 = 0.0; + /** + * Output only. The number of model created labels that match a ground truth + * label. + * + * Generated from protobuf field int64 true_positive_count = 10; + */ + protected $true_positive_count = 0; + /** + * Output only. The number of model created labels that do not match a + * ground truth label. + * + * Generated from protobuf field int64 false_positive_count = 11; + */ + protected $false_positive_count = 0; + /** + * Output only. The number of ground truth labels that are not matched + * by a model created label. + * + * Generated from protobuf field int64 false_negative_count = 12; + */ + protected $false_negative_count = 0; + /** + * Output only. The number of labels that were not created by the model, + * but if they would, they would not match a ground truth label. + * + * Generated from protobuf field int64 true_negative_count = 13; + */ + protected $true_negative_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $confidence_threshold + * Output only. Metrics are computed with an assumption that the model + * never returns predictions with score lower than this value. + * @type int $position_threshold + * Output only. Metrics are computed with an assumption that the model + * always returns at most this many predictions (ordered by their score, + * descendingly), but they all still need to meet the confidence_threshold. + * @type float $recall + * Output only. Recall (True Positive Rate) for the given confidence + * threshold. + * @type float $precision + * Output only. Precision for the given confidence threshold. + * @type float $false_positive_rate + * Output only. False Positive Rate for the given confidence threshold. + * @type float $f1_score + * Output only. The harmonic mean of recall and precision. + * @type float $recall_at1 + * Output only. The Recall (True Positive Rate) when only considering the + * label that has the highest prediction score and not below the confidence + * threshold for each example. + * @type float $precision_at1 + * Output only. The precision when only considering the label that has the + * highest prediction score and not below the confidence threshold for each + * example. + * @type float $false_positive_rate_at1 + * Output only. The False Positive Rate when only considering the label that + * has the highest prediction score and not below the confidence threshold + * for each example. + * @type float $f1_score_at1 + * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + * @type int|string $true_positive_count + * Output only. The number of model created labels that match a ground truth + * label. + * @type int|string $false_positive_count + * Output only. The number of model created labels that do not match a + * ground truth label. + * @type int|string $false_negative_count + * Output only. The number of ground truth labels that are not matched + * by a model created label. + * @type int|string $true_negative_count + * Output only. The number of labels that were not created by the model, + * but if they would, they would not match a ground truth label. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Classification::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Metrics are computed with an assumption that the model + * never returns predictions with score lower than this value. + * + * Generated from protobuf field float confidence_threshold = 1; + * @return float + */ + public function getConfidenceThreshold() + { + return $this->confidence_threshold; + } + + /** + * Output only. Metrics are computed with an assumption that the model + * never returns predictions with score lower than this value. + * + * Generated from protobuf field float confidence_threshold = 1; + * @param float $var + * @return $this + */ + public function setConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->confidence_threshold = $var; + + return $this; + } + + /** + * Output only. Metrics are computed with an assumption that the model + * always returns at most this many predictions (ordered by their score, + * descendingly), but they all still need to meet the confidence_threshold. + * + * Generated from protobuf field int32 position_threshold = 14; + * @return int + */ + public function getPositionThreshold() + { + return $this->position_threshold; + } + + /** + * Output only. Metrics are computed with an assumption that the model + * always returns at most this many predictions (ordered by their score, + * descendingly), but they all still need to meet the confidence_threshold. + * + * Generated from protobuf field int32 position_threshold = 14; + * @param int $var + * @return $this + */ + public function setPositionThreshold($var) + { + GPBUtil::checkInt32($var); + $this->position_threshold = $var; + + return $this; + } + + /** + * Output only. Recall (True Positive Rate) for the given confidence + * threshold. + * + * Generated from protobuf field float recall = 2; + * @return float + */ + public function getRecall() + { + return $this->recall; + } + + /** + * Output only. Recall (True Positive Rate) for the given confidence + * threshold. + * + * Generated from protobuf field float recall = 2; + * @param float $var + * @return $this + */ + public function setRecall($var) + { + GPBUtil::checkFloat($var); + $this->recall = $var; + + return $this; + } + + /** + * Output only. Precision for the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + * @return float + */ + public function getPrecision() + { + return $this->precision; + } + + /** + * Output only. Precision for the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + * @param float $var + * @return $this + */ + public function setPrecision($var) + { + GPBUtil::checkFloat($var); + $this->precision = $var; + + return $this; + } + + /** + * Output only. False Positive Rate for the given confidence threshold. + * + * Generated from protobuf field float false_positive_rate = 8; + * @return float + */ + public function getFalsePositiveRate() + { + return $this->false_positive_rate; + } + + /** + * Output only. False Positive Rate for the given confidence threshold. + * + * Generated from protobuf field float false_positive_rate = 8; + * @param float $var + * @return $this + */ + public function setFalsePositiveRate($var) + { + GPBUtil::checkFloat($var); + $this->false_positive_rate = $var; + + return $this; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + * @return float + */ + public function getF1Score() + { + return $this->f1_score; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + * @param float $var + * @return $this + */ + public function setF1Score($var) + { + GPBUtil::checkFloat($var); + $this->f1_score = $var; + + return $this; + } + + /** + * Output only. The Recall (True Positive Rate) when only considering the + * label that has the highest prediction score and not below the confidence + * threshold for each example. + * + * Generated from protobuf field float recall_at1 = 5; + * @return float + */ + public function getRecallAt1() + { + return $this->recall_at1; + } + + /** + * Output only. The Recall (True Positive Rate) when only considering the + * label that has the highest prediction score and not below the confidence + * threshold for each example. + * + * Generated from protobuf field float recall_at1 = 5; + * @param float $var + * @return $this + */ + public function setRecallAt1($var) + { + GPBUtil::checkFloat($var); + $this->recall_at1 = $var; + + return $this; + } + + /** + * Output only. The precision when only considering the label that has the + * highest prediction score and not below the confidence threshold for each + * example. + * + * Generated from protobuf field float precision_at1 = 6; + * @return float + */ + public function getPrecisionAt1() + { + return $this->precision_at1; + } + + /** + * Output only. The precision when only considering the label that has the + * highest prediction score and not below the confidence threshold for each + * example. + * + * Generated from protobuf field float precision_at1 = 6; + * @param float $var + * @return $this + */ + public function setPrecisionAt1($var) + { + GPBUtil::checkFloat($var); + $this->precision_at1 = $var; + + return $this; + } + + /** + * Output only. The False Positive Rate when only considering the label that + * has the highest prediction score and not below the confidence threshold + * for each example. + * + * Generated from protobuf field float false_positive_rate_at1 = 9; + * @return float + */ + public function getFalsePositiveRateAt1() + { + return $this->false_positive_rate_at1; + } + + /** + * Output only. The False Positive Rate when only considering the label that + * has the highest prediction score and not below the confidence threshold + * for each example. + * + * Generated from protobuf field float false_positive_rate_at1 = 9; + * @param float $var + * @return $this + */ + public function setFalsePositiveRateAt1($var) + { + GPBUtil::checkFloat($var); + $this->false_positive_rate_at1 = $var; + + return $this; + } + + /** + * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + * + * Generated from protobuf field float f1_score_at1 = 7; + * @return float + */ + public function getF1ScoreAt1() + { + return $this->f1_score_at1; + } + + /** + * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + * + * Generated from protobuf field float f1_score_at1 = 7; + * @param float $var + * @return $this + */ + public function setF1ScoreAt1($var) + { + GPBUtil::checkFloat($var); + $this->f1_score_at1 = $var; + + return $this; + } + + /** + * Output only. The number of model created labels that match a ground truth + * label. + * + * Generated from protobuf field int64 true_positive_count = 10; + * @return int|string + */ + public function getTruePositiveCount() + { + return $this->true_positive_count; + } + + /** + * Output only. The number of model created labels that match a ground truth + * label. + * + * Generated from protobuf field int64 true_positive_count = 10; + * @param int|string $var + * @return $this + */ + public function setTruePositiveCount($var) + { + GPBUtil::checkInt64($var); + $this->true_positive_count = $var; + + return $this; + } + + /** + * Output only. The number of model created labels that do not match a + * ground truth label. + * + * Generated from protobuf field int64 false_positive_count = 11; + * @return int|string + */ + public function getFalsePositiveCount() + { + return $this->false_positive_count; + } + + /** + * Output only. The number of model created labels that do not match a + * ground truth label. + * + * Generated from protobuf field int64 false_positive_count = 11; + * @param int|string $var + * @return $this + */ + public function setFalsePositiveCount($var) + { + GPBUtil::checkInt64($var); + $this->false_positive_count = $var; + + return $this; + } + + /** + * Output only. The number of ground truth labels that are not matched + * by a model created label. + * + * Generated from protobuf field int64 false_negative_count = 12; + * @return int|string + */ + public function getFalseNegativeCount() + { + return $this->false_negative_count; + } + + /** + * Output only. The number of ground truth labels that are not matched + * by a model created label. + * + * Generated from protobuf field int64 false_negative_count = 12; + * @param int|string $var + * @return $this + */ + public function setFalseNegativeCount($var) + { + GPBUtil::checkInt64($var); + $this->false_negative_count = $var; + + return $this; + } + + /** + * Output only. The number of labels that were not created by the model, + * but if they would, they would not match a ground truth label. + * + * Generated from protobuf field int64 true_negative_count = 13; + * @return int|string + */ + public function getTrueNegativeCount() + { + return $this->true_negative_count; + } + + /** + * Output only. The number of labels that were not created by the model, + * but if they would, they would not match a ground truth label. + * + * Generated from protobuf field int64 true_negative_count = 13; + * @param int|string $var + * @return $this + */ + public function setTrueNegativeCount($var) + { + GPBUtil::checkInt64($var); + $this->true_negative_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConfidenceMetricsEntry::class, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics_ConfidenceMetricsEntry::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix.php new file mode 100644 index 000000000000..7fb6ec327e28 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix.php @@ -0,0 +1,186 @@ +google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + */ +class ConfusionMatrix extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. IDs of the annotation specs used in the confusion matrix. + * For Tables CLASSIFICATION + * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type] + * only list of [annotation_spec_display_name-s][] is populated. + * + * Generated from protobuf field repeated string annotation_spec_id = 1; + */ + private $annotation_spec_id; + /** + * Output only. Display name of the annotation specs used in the confusion + * matrix, as they were at the moment of the evaluation. For Tables + * CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type], + * distinct values of the target column at the moment of the model + * evaluation are populated here. + * + * Generated from protobuf field repeated string display_name = 3; + */ + private $display_name; + /** + * Output only. Rows in the confusion matrix. The number of rows is equal to + * the size of `annotation_spec_id`. + * `row[i].example_count[j]` is the number of examples that have ground + * truth of the `annotation_spec_id[i]` and are predicted as + * `annotation_spec_id[j]` by the model being evaluated. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + private $row; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $annotation_spec_id + * Output only. IDs of the annotation specs used in the confusion matrix. + * For Tables CLASSIFICATION + * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type] + * only list of [annotation_spec_display_name-s][] is populated. + * @type array|\Google\Protobuf\Internal\RepeatedField $display_name + * Output only. Display name of the annotation specs used in the confusion + * matrix, as they were at the moment of the evaluation. For Tables + * CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type], + * distinct values of the target column at the moment of the model + * evaluation are populated here. + * @type array<\Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix\Row>|\Google\Protobuf\Internal\RepeatedField $row + * Output only. Rows in the confusion matrix. The number of rows is equal to + * the size of `annotation_spec_id`. + * `row[i].example_count[j]` is the number of examples that have ground + * truth of the `annotation_spec_id[i]` and are predicted as + * `annotation_spec_id[j]` by the model being evaluated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Classification::initOnce(); + parent::__construct($data); + } + + /** + * Output only. IDs of the annotation specs used in the confusion matrix. + * For Tables CLASSIFICATION + * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type] + * only list of [annotation_spec_display_name-s][] is populated. + * + * Generated from protobuf field repeated string annotation_spec_id = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnnotationSpecId() + { + return $this->annotation_spec_id; + } + + /** + * Output only. IDs of the annotation specs used in the confusion matrix. + * For Tables CLASSIFICATION + * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type] + * only list of [annotation_spec_display_name-s][] is populated. + * + * Generated from protobuf field repeated string annotation_spec_id = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnnotationSpecId($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotation_spec_id = $arr; + + return $this; + } + + /** + * Output only. Display name of the annotation specs used in the confusion + * matrix, as they were at the moment of the evaluation. For Tables + * CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type], + * distinct values of the target column at the moment of the model + * evaluation are populated here. + * + * Generated from protobuf field repeated string display_name = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. Display name of the annotation specs used in the confusion + * matrix, as they were at the moment of the evaluation. For Tables + * CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type], + * distinct values of the target column at the moment of the model + * evaluation are populated here. + * + * Generated from protobuf field repeated string display_name = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisplayName($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->display_name = $arr; + + return $this; + } + + /** + * Output only. Rows in the confusion matrix. The number of rows is equal to + * the size of `annotation_spec_id`. + * `row[i].example_count[j]` is the number of examples that have ground + * truth of the `annotation_spec_id[i]` and are predicted as + * `annotation_spec_id[j]` by the model being evaluated. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRow() + { + return $this->row; + } + + /** + * Output only. Rows in the confusion matrix. The number of rows is equal to + * the size of `annotation_spec_id`. + * `row[i].example_count[j]` is the number of examples that have ground + * truth of the `annotation_spec_id[i]` and are predicted as + * `annotation_spec_id[j]` by the model being evaluated. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * @param array<\Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix\Row>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRow($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix\Row::class); + $this->row = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConfusionMatrix::class, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics_ConfusionMatrix::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix/Row.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix/Row.php new file mode 100644 index 000000000000..3f433135f499 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix/Row.php @@ -0,0 +1,82 @@ +google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + */ +class Row extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Value of the specific cell in the confusion matrix. + * The number of values each row has (i.e. the length of the row) is equal + * to the length of the `annotation_spec_id` field or, if that one is not + * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * + * Generated from protobuf field repeated int32 example_count = 1; + */ + private $example_count; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $example_count + * Output only. Value of the specific cell in the confusion matrix. + * The number of values each row has (i.e. the length of the row) is equal + * to the length of the `annotation_spec_id` field or, if that one is not + * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Classification::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Value of the specific cell in the confusion matrix. + * The number of values each row has (i.e. the length of the row) is equal + * to the length of the `annotation_spec_id` field or, if that one is not + * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * + * Generated from protobuf field repeated int32 example_count = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExampleCount() + { + return $this->example_count; + } + + /** + * Output only. Value of the specific cell in the confusion matrix. + * The number of values each row has (i.e. the length of the row) is equal + * to the length of the `annotation_spec_id` field or, if that one is not + * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * + * Generated from protobuf field repeated int32 example_count = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExampleCount($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->example_count = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Row::class, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics_ConfusionMatrix_Row::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationType.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationType.php new file mode 100644 index 000000000000..71c2bab1d3c7 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationType.php @@ -0,0 +1,61 @@ +google.cloud.automl.v1.ClassificationType + */ +class ClassificationType +{ + /** + * An un-set value of this enum. + * + * Generated from protobuf enum CLASSIFICATION_TYPE_UNSPECIFIED = 0; + */ + const CLASSIFICATION_TYPE_UNSPECIFIED = 0; + /** + * At most one label is allowed per example. + * + * Generated from protobuf enum MULTICLASS = 1; + */ + const MULTICLASS = 1; + /** + * Multiple labels are allowed for one example. + * + * Generated from protobuf enum MULTILABEL = 2; + */ + const MULTILABEL = 2; + + private static $valueToName = [ + self::CLASSIFICATION_TYPE_UNSPECIFIED => 'CLASSIFICATION_TYPE_UNSPECIFIED', + self::MULTICLASS => 'MULTICLASS', + self::MULTILABEL => 'MULTILABEL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetOperationMetadata.php new file mode 100644 index 000000000000..ac49c13c1fc5 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.CreateDatasetOperationMetadata + */ +class CreateDatasetOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetRequest.php new file mode 100644 index 000000000000..104ad7be83e2 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetRequest.php @@ -0,0 +1,127 @@ +google.cloud.automl.v1.CreateDatasetRequest + */ +class CreateDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the project to create the dataset for. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The dataset to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset = null; + + /** + * @param string $parent Required. The resource name of the project to create the dataset for. Please see + * {@see AutoMlClient::locationName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\Dataset $dataset Required. The dataset to create. + * + * @return \Google\Cloud\AutoMl\V1\CreateDatasetRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AutoMl\V1\Dataset $dataset): self + { + return (new self()) + ->setParent($parent) + ->setDataset($dataset); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the project to create the dataset for. + * @type \Google\Cloud\AutoMl\V1\Dataset $dataset + * Required. The dataset to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the project to create the dataset for. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the project to create the dataset for. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The dataset to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\Dataset|null + */ + public function getDataset() + { + return $this->dataset; + } + + public function hasDataset() + { + return isset($this->dataset); + } + + public function clearDataset() + { + unset($this->dataset); + } + + /** + * Required. The dataset to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\Dataset $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Dataset::class); + $this->dataset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelOperationMetadata.php new file mode 100644 index 000000000000..d02e428ca252 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.CreateModelOperationMetadata + */ +class CreateModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelRequest.php new file mode 100644 index 000000000000..982fdf52d1c9 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelRequest.php @@ -0,0 +1,127 @@ +google.cloud.automl.v1.CreateModelRequest + */ +class CreateModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the parent project where the model is being created. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The model to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $model = null; + + /** + * @param string $parent Required. Resource name of the parent project where the model is being created. Please see + * {@see AutoMlClient::locationName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\Model $model Required. The model to create. + * + * @return \Google\Cloud\AutoMl\V1\CreateModelRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AutoMl\V1\Model $model): self + { + return (new self()) + ->setParent($parent) + ->setModel($model); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the parent project where the model is being created. + * @type \Google\Cloud\AutoMl\V1\Model $model + * Required. The model to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the parent project where the model is being created. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource name of the parent project where the model is being created. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The model to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\Model|null + */ + public function getModel() + { + return $this->model; + } + + public function hasModel() + { + return isset($this->model); + } + + public function clearModel() + { + unset($this->model); + } + + /** + * Required. The model to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\Model $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Model::class); + $this->model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Dataset.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Dataset.php new file mode 100644 index 000000000000..2e8ecb216189 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Dataset.php @@ -0,0 +1,533 @@ +google.cloud.automl.v1.Dataset + */ +class Dataset extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the dataset. + * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The name of the dataset to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * User-provided description of the dataset. The description can be up to + * 25000 characters long. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * Output only. The number of examples in the dataset. + * + * Generated from protobuf field int32 example_count = 21; + */ + protected $example_count = 0; + /** + * Output only. Timestamp when this dataset was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 14; + */ + protected $create_time = null; + /** + * Used to perform consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 17; + */ + protected $etag = ''; + /** + * Optional. The labels with user-defined metadata to organize your dataset. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 39; + */ + private $labels; + protected $dataset_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TranslationDatasetMetadata $translation_dataset_metadata + * Metadata for a dataset used for translation. + * @type \Google\Cloud\AutoMl\V1\ImageClassificationDatasetMetadata $image_classification_dataset_metadata + * Metadata for a dataset used for image classification. + * @type \Google\Cloud\AutoMl\V1\TextClassificationDatasetMetadata $text_classification_dataset_metadata + * Metadata for a dataset used for text classification. + * @type \Google\Cloud\AutoMl\V1\ImageObjectDetectionDatasetMetadata $image_object_detection_dataset_metadata + * Metadata for a dataset used for image object detection. + * @type \Google\Cloud\AutoMl\V1\TextExtractionDatasetMetadata $text_extraction_dataset_metadata + * Metadata for a dataset used for text extraction. + * @type \Google\Cloud\AutoMl\V1\TextSentimentDatasetMetadata $text_sentiment_dataset_metadata + * Metadata for a dataset used for text sentiment. + * @type string $name + * Output only. The resource name of the dataset. + * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + * @type string $display_name + * Required. The name of the dataset to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. + * @type string $description + * User-provided description of the dataset. The description can be up to + * 25000 characters long. + * @type int $example_count + * Output only. The number of examples in the dataset. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when this dataset was created. + * @type string $etag + * Used to perform consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels with user-defined metadata to organize your dataset. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Dataset::initOnce(); + parent::__construct($data); + } + + /** + * Metadata for a dataset used for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * @return \Google\Cloud\AutoMl\V1\TranslationDatasetMetadata|null + */ + public function getTranslationDatasetMetadata() + { + return $this->readOneof(23); + } + + public function hasTranslationDatasetMetadata() + { + return $this->hasOneof(23); + } + + /** + * Metadata for a dataset used for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * @param \Google\Cloud\AutoMl\V1\TranslationDatasetMetadata $var + * @return $this + */ + public function setTranslationDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TranslationDatasetMetadata::class); + $this->writeOneof(23, $var); + + return $this; + } + + /** + * Metadata for a dataset used for image classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * @return \Google\Cloud\AutoMl\V1\ImageClassificationDatasetMetadata|null + */ + public function getImageClassificationDatasetMetadata() + { + return $this->readOneof(24); + } + + public function hasImageClassificationDatasetMetadata() + { + return $this->hasOneof(24); + } + + /** + * Metadata for a dataset used for image classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * @param \Google\Cloud\AutoMl\V1\ImageClassificationDatasetMetadata $var + * @return $this + */ + public function setImageClassificationDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageClassificationDatasetMetadata::class); + $this->writeOneof(24, $var); + + return $this; + } + + /** + * Metadata for a dataset used for text classification. + * + * Generated from protobuf field .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * @return \Google\Cloud\AutoMl\V1\TextClassificationDatasetMetadata|null + */ + public function getTextClassificationDatasetMetadata() + { + return $this->readOneof(25); + } + + public function hasTextClassificationDatasetMetadata() + { + return $this->hasOneof(25); + } + + /** + * Metadata for a dataset used for text classification. + * + * Generated from protobuf field .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * @param \Google\Cloud\AutoMl\V1\TextClassificationDatasetMetadata $var + * @return $this + */ + public function setTextClassificationDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextClassificationDatasetMetadata::class); + $this->writeOneof(25, $var); + + return $this; + } + + /** + * Metadata for a dataset used for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * @return \Google\Cloud\AutoMl\V1\ImageObjectDetectionDatasetMetadata|null + */ + public function getImageObjectDetectionDatasetMetadata() + { + return $this->readOneof(26); + } + + public function hasImageObjectDetectionDatasetMetadata() + { + return $this->hasOneof(26); + } + + /** + * Metadata for a dataset used for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * @param \Google\Cloud\AutoMl\V1\ImageObjectDetectionDatasetMetadata $var + * @return $this + */ + public function setImageObjectDetectionDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageObjectDetectionDatasetMetadata::class); + $this->writeOneof(26, $var); + + return $this; + } + + /** + * Metadata for a dataset used for text extraction. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * @return \Google\Cloud\AutoMl\V1\TextExtractionDatasetMetadata|null + */ + public function getTextExtractionDatasetMetadata() + { + return $this->readOneof(28); + } + + public function hasTextExtractionDatasetMetadata() + { + return $this->hasOneof(28); + } + + /** + * Metadata for a dataset used for text extraction. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * @param \Google\Cloud\AutoMl\V1\TextExtractionDatasetMetadata $var + * @return $this + */ + public function setTextExtractionDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextExtractionDatasetMetadata::class); + $this->writeOneof(28, $var); + + return $this; + } + + /** + * Metadata for a dataset used for text sentiment. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * @return \Google\Cloud\AutoMl\V1\TextSentimentDatasetMetadata|null + */ + public function getTextSentimentDatasetMetadata() + { + return $this->readOneof(30); + } + + public function hasTextSentimentDatasetMetadata() + { + return $this->hasOneof(30); + } + + /** + * Metadata for a dataset used for text sentiment. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * @param \Google\Cloud\AutoMl\V1\TextSentimentDatasetMetadata $var + * @return $this + */ + public function setTextSentimentDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSentimentDatasetMetadata::class); + $this->writeOneof(30, $var); + + return $this; + } + + /** + * Output only. The resource name of the dataset. + * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the dataset. + * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of the dataset to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the dataset to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * User-provided description of the dataset. The description can be up to + * 25000 characters long. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User-provided description of the dataset. The description can be up to + * 25000 characters long. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The number of examples in the dataset. + * + * Generated from protobuf field int32 example_count = 21; + * @return int + */ + public function getExampleCount() + { + return $this->example_count; + } + + /** + * Output only. The number of examples in the dataset. + * + * Generated from protobuf field int32 example_count = 21; + * @param int $var + * @return $this + */ + public function setExampleCount($var) + { + GPBUtil::checkInt32($var); + $this->example_count = $var; + + return $this; + } + + /** + * Output only. Timestamp when this dataset was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 14; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Timestamp when this dataset was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 14; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Used to perform consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 17; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Used to perform consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 17; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. The labels with user-defined metadata to organize your dataset. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 39; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels with user-defined metadata to organize your dataset. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 39; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * @return string + */ + public function getDatasetMetadata() + { + return $this->whichOneof("dataset_metadata"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteDatasetRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteDatasetRequest.php new file mode 100644 index 000000000000..51473a001c78 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteDatasetRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.DeleteDatasetRequest + */ +class DeleteDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the dataset to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the dataset to delete. Please see + * {@see AutoMlClient::datasetName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\DeleteDatasetRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the dataset to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the dataset to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the dataset to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteModelRequest.php new file mode 100644 index 000000000000..2a2b9a73b439 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteModelRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.DeleteModelRequest + */ +class DeleteModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the model being deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the model being deleted. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\DeleteModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the model being deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the model being deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the model being deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteOperationMetadata.php new file mode 100644 index 000000000000..9e8a8551ac12 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.DeleteOperationMetadata + */ +class DeleteOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelOperationMetadata.php new file mode 100644 index 000000000000..a60fd7e79038 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.DeployModelOperationMetadata + */ +class DeployModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelRequest.php new file mode 100644 index 000000000000..40b54b870eaf --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelRequest.php @@ -0,0 +1,156 @@ +google.cloud.automl.v1.DeployModelRequest + */ +class DeployModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the model to deploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + protected $model_deployment_metadata; + + /** + * @param string $name Required. Resource name of the model to deploy. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\DeployModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelDeploymentMetadata $image_object_detection_model_deployment_metadata + * Model deployment metadata specific to Image Object Detection. + * @type \Google\Cloud\AutoMl\V1\ImageClassificationModelDeploymentMetadata $image_classification_model_deployment_metadata + * Model deployment metadata specific to Image Classification. + * @type string $name + * Required. Resource name of the model to deploy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Model deployment metadata specific to Image Object Detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * @return \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelDeploymentMetadata|null + */ + public function getImageObjectDetectionModelDeploymentMetadata() + { + return $this->readOneof(2); + } + + public function hasImageObjectDetectionModelDeploymentMetadata() + { + return $this->hasOneof(2); + } + + /** + * Model deployment metadata specific to Image Object Detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * @param \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelDeploymentMetadata $var + * @return $this + */ + public function setImageObjectDetectionModelDeploymentMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelDeploymentMetadata::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Model deployment metadata specific to Image Classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * @return \Google\Cloud\AutoMl\V1\ImageClassificationModelDeploymentMetadata|null + */ + public function getImageClassificationModelDeploymentMetadata() + { + return $this->readOneof(4); + } + + public function hasImageClassificationModelDeploymentMetadata() + { + return $this->hasOneof(4); + } + + /** + * Model deployment metadata specific to Image Classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * @param \Google\Cloud\AutoMl\V1\ImageClassificationModelDeploymentMetadata $var + * @return $this + */ + public function setImageClassificationModelDeploymentMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageClassificationModelDeploymentMetadata::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Required. Resource name of the model to deploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the model to deploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * @return string + */ + public function getModelDeploymentMetadata() + { + return $this->whichOneof("model_deployment_metadata"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document.php new file mode 100644 index 000000000000..1563d30be57b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document.php @@ -0,0 +1,237 @@ +google.cloud.automl.v1.Document + */ +class Document extends \Google\Protobuf\Internal\Message +{ + /** + * An input config specifying the content of the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + protected $input_config = null; + /** + * The plain text version of this document. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + protected $document_text = null; + /** + * Describes the layout of the document. + * Sorted by [page_number][]. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + private $layout; + /** + * The dimensions of the page in the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + protected $document_dimensions = null; + /** + * Number of pages in the document. + * + * Generated from protobuf field int32 page_count = 5; + */ + protected $page_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\DocumentInputConfig $input_config + * An input config specifying the content of the document. + * @type \Google\Cloud\AutoMl\V1\TextSnippet $document_text + * The plain text version of this document. + * @type array<\Google\Cloud\AutoMl\V1\Document\Layout>|\Google\Protobuf\Internal\RepeatedField $layout + * Describes the layout of the document. + * Sorted by [page_number][]. + * @type \Google\Cloud\AutoMl\V1\DocumentDimensions $document_dimensions + * The dimensions of the page in the document. + * @type int $page_count + * Number of pages in the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * An input config specifying the content of the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + * @return \Google\Cloud\AutoMl\V1\DocumentInputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * An input config specifying the content of the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + * @param \Google\Cloud\AutoMl\V1\DocumentInputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\DocumentInputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * The plain text version of this document. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet document_text = 2; + * @return \Google\Cloud\AutoMl\V1\TextSnippet|null + */ + public function getDocumentText() + { + return $this->document_text; + } + + public function hasDocumentText() + { + return isset($this->document_text); + } + + public function clearDocumentText() + { + unset($this->document_text); + } + + /** + * The plain text version of this document. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet document_text = 2; + * @param \Google\Cloud\AutoMl\V1\TextSnippet $var + * @return $this + */ + public function setDocumentText($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSnippet::class); + $this->document_text = $var; + + return $this; + } + + /** + * Describes the layout of the document. + * Sorted by [page_number][]. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Document.Layout layout = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLayout() + { + return $this->layout; + } + + /** + * Describes the layout of the document. + * Sorted by [page_number][]. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Document.Layout layout = 3; + * @param array<\Google\Cloud\AutoMl\V1\Document\Layout>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLayout($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\Document\Layout::class); + $this->layout = $arr; + + return $this; + } + + /** + * The dimensions of the page in the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + * @return \Google\Cloud\AutoMl\V1\DocumentDimensions|null + */ + public function getDocumentDimensions() + { + return $this->document_dimensions; + } + + public function hasDocumentDimensions() + { + return isset($this->document_dimensions); + } + + public function clearDocumentDimensions() + { + unset($this->document_dimensions); + } + + /** + * The dimensions of the page in the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + * @param \Google\Cloud\AutoMl\V1\DocumentDimensions $var + * @return $this + */ + public function setDocumentDimensions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\DocumentDimensions::class); + $this->document_dimensions = $var; + + return $this; + } + + /** + * Number of pages in the document. + * + * Generated from protobuf field int32 page_count = 5; + * @return int + */ + public function getPageCount() + { + return $this->page_count; + } + + /** + * Number of pages in the document. + * + * Generated from protobuf field int32 page_count = 5; + * @param int $var + * @return $this + */ + public function setPageCount($var) + { + GPBUtil::checkInt32($var); + $this->page_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout.php new file mode 100644 index 000000000000..6543bf1767ed --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout.php @@ -0,0 +1,228 @@ +google.cloud.automl.v1.Document.Layout + */ +class Layout extends \Google\Protobuf\Internal\Message +{ + /** + * Text Segment that represents a segment in + * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + protected $text_segment = null; + /** + * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts + * from 1. + * + * Generated from protobuf field int32 page_number = 2; + */ + protected $page_number = 0; + /** + * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. + * Contains exactly 4 + * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] + * and they are connected by edges in the order provided, which will + * represent a rectangle parallel to the frame. The + * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are + * relative to the page. + * Coordinates are based on top-left as point (0,0). + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + protected $bounding_poly = null; + /** + * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. + * + * Generated from protobuf field .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + */ + protected $text_segment_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TextSegment $text_segment + * Text Segment that represents a segment in + * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. + * @type int $page_number + * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts + * from 1. + * @type \Google\Cloud\AutoMl\V1\BoundingPoly $bounding_poly + * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. + * Contains exactly 4 + * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] + * and they are connected by edges in the order provided, which will + * represent a rectangle parallel to the frame. The + * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are + * relative to the page. + * Coordinates are based on top-left as point (0,0). + * @type int $text_segment_type + * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * Text Segment that represents a segment in + * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSegment text_segment = 1; + * @return \Google\Cloud\AutoMl\V1\TextSegment|null + */ + public function getTextSegment() + { + return $this->text_segment; + } + + public function hasTextSegment() + { + return isset($this->text_segment); + } + + public function clearTextSegment() + { + unset($this->text_segment); + } + + /** + * Text Segment that represents a segment in + * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSegment text_segment = 1; + * @param \Google\Cloud\AutoMl\V1\TextSegment $var + * @return $this + */ + public function setTextSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSegment::class); + $this->text_segment = $var; + + return $this; + } + + /** + * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts + * from 1. + * + * Generated from protobuf field int32 page_number = 2; + * @return int + */ + public function getPageNumber() + { + return $this->page_number; + } + + /** + * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts + * from 1. + * + * Generated from protobuf field int32 page_number = 2; + * @param int $var + * @return $this + */ + public function setPageNumber($var) + { + GPBUtil::checkInt32($var); + $this->page_number = $var; + + return $this; + } + + /** + * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. + * Contains exactly 4 + * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] + * and they are connected by edges in the order provided, which will + * represent a rectangle parallel to the frame. The + * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are + * relative to the page. + * Coordinates are based on top-left as point (0,0). + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + * @return \Google\Cloud\AutoMl\V1\BoundingPoly|null + */ + public function getBoundingPoly() + { + return $this->bounding_poly; + } + + public function hasBoundingPoly() + { + return isset($this->bounding_poly); + } + + public function clearBoundingPoly() + { + unset($this->bounding_poly); + } + + /** + * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. + * Contains exactly 4 + * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] + * and they are connected by edges in the order provided, which will + * represent a rectangle parallel to the frame. The + * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are + * relative to the page. + * Coordinates are based on top-left as point (0,0). + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + * @param \Google\Cloud\AutoMl\V1\BoundingPoly $var + * @return $this + */ + public function setBoundingPoly($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BoundingPoly::class); + $this->bounding_poly = $var; + + return $this; + } + + /** + * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. + * + * Generated from protobuf field .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + * @return int + */ + public function getTextSegmentType() + { + return $this->text_segment_type; + } + + /** + * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. + * + * Generated from protobuf field .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + * @param int $var + * @return $this + */ + public function setTextSegmentType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\Document\Layout\TextSegmentType::class); + $this->text_segment_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Layout::class, \Google\Cloud\AutoMl\V1\Document_Layout::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout/TextSegmentType.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout/TextSegmentType.php new file mode 100644 index 000000000000..26f6465c5713 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout/TextSegmentType.php @@ -0,0 +1,123 @@ +google.cloud.automl.v1.Document.Layout.TextSegmentType + */ +class TextSegmentType +{ + /** + * Should not be used. + * + * Generated from protobuf enum TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + */ + const TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + /** + * The text segment is a token. e.g. word. + * + * Generated from protobuf enum TOKEN = 1; + */ + const TOKEN = 1; + /** + * The text segment is a paragraph. + * + * Generated from protobuf enum PARAGRAPH = 2; + */ + const PARAGRAPH = 2; + /** + * The text segment is a form field. + * + * Generated from protobuf enum FORM_FIELD = 3; + */ + const FORM_FIELD = 3; + /** + * The text segment is the name part of a form field. It will be treated + * as child of another FORM_FIELD TextSegment if its span is subspan of + * another TextSegment with type FORM_FIELD. + * + * Generated from protobuf enum FORM_FIELD_NAME = 4; + */ + const FORM_FIELD_NAME = 4; + /** + * The text segment is the text content part of a form field. It will be + * treated as child of another FORM_FIELD TextSegment if its span is + * subspan of another TextSegment with type FORM_FIELD. + * + * Generated from protobuf enum FORM_FIELD_CONTENTS = 5; + */ + const FORM_FIELD_CONTENTS = 5; + /** + * The text segment is a whole table, including headers, and all rows. + * + * Generated from protobuf enum TABLE = 6; + */ + const TABLE = 6; + /** + * The text segment is a table's headers. It will be treated as child of + * another TABLE TextSegment if its span is subspan of another TextSegment + * with type TABLE. + * + * Generated from protobuf enum TABLE_HEADER = 7; + */ + const TABLE_HEADER = 7; + /** + * The text segment is a row in table. It will be treated as child of + * another TABLE TextSegment if its span is subspan of another TextSegment + * with type TABLE. + * + * Generated from protobuf enum TABLE_ROW = 8; + */ + const TABLE_ROW = 8; + /** + * The text segment is a cell in table. It will be treated as child of + * another TABLE_ROW TextSegment if its span is subspan of another + * TextSegment with type TABLE_ROW. + * + * Generated from protobuf enum TABLE_CELL = 9; + */ + const TABLE_CELL = 9; + + private static $valueToName = [ + self::TEXT_SEGMENT_TYPE_UNSPECIFIED => 'TEXT_SEGMENT_TYPE_UNSPECIFIED', + self::TOKEN => 'TOKEN', + self::PARAGRAPH => 'PARAGRAPH', + self::FORM_FIELD => 'FORM_FIELD', + self::FORM_FIELD_NAME => 'FORM_FIELD_NAME', + self::FORM_FIELD_CONTENTS => 'FORM_FIELD_CONTENTS', + self::TABLE => 'TABLE', + self::TABLE_HEADER => 'TABLE_HEADER', + self::TABLE_ROW => 'TABLE_ROW', + self::TABLE_CELL => 'TABLE_CELL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TextSegmentType::class, \Google\Cloud\AutoMl\V1\Document_Layout_TextSegmentType::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions.php new file mode 100644 index 000000000000..ec1a7850a858 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions.php @@ -0,0 +1,135 @@ +google.cloud.automl.v1.DocumentDimensions + */ +class DocumentDimensions extends \Google\Protobuf\Internal\Message +{ + /** + * Unit of the dimension. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + protected $unit = 0; + /** + * Width value of the document, works together with the unit. + * + * Generated from protobuf field float width = 2; + */ + protected $width = 0.0; + /** + * Height value of the document, works together with the unit. + * + * Generated from protobuf field float height = 3; + */ + protected $height = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $unit + * Unit of the dimension. + * @type float $width + * Width value of the document, works together with the unit. + * @type float $height + * Height value of the document, works together with the unit. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * Unit of the dimension. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + * @return int + */ + public function getUnit() + { + return $this->unit; + } + + /** + * Unit of the dimension. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + * @param int $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\DocumentDimensions\DocumentDimensionUnit::class); + $this->unit = $var; + + return $this; + } + + /** + * Width value of the document, works together with the unit. + * + * Generated from protobuf field float width = 2; + * @return float + */ + public function getWidth() + { + return $this->width; + } + + /** + * Width value of the document, works together with the unit. + * + * Generated from protobuf field float width = 2; + * @param float $var + * @return $this + */ + public function setWidth($var) + { + GPBUtil::checkFloat($var); + $this->width = $var; + + return $this; + } + + /** + * Height value of the document, works together with the unit. + * + * Generated from protobuf field float height = 3; + * @return float + */ + public function getHeight() + { + return $this->height; + } + + /** + * Height value of the document, works together with the unit. + * + * Generated from protobuf field float height = 3; + * @param float $var + * @return $this + */ + public function setHeight($var) + { + GPBUtil::checkFloat($var); + $this->height = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions/DocumentDimensionUnit.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions/DocumentDimensionUnit.php new file mode 100644 index 000000000000..2faca889037c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions/DocumentDimensionUnit.php @@ -0,0 +1,71 @@ +google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit + */ +class DocumentDimensionUnit +{ + /** + * Should not be used. + * + * Generated from protobuf enum DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + */ + const DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + /** + * Document dimension is measured in inches. + * + * Generated from protobuf enum INCH = 1; + */ + const INCH = 1; + /** + * Document dimension is measured in centimeters. + * + * Generated from protobuf enum CENTIMETER = 2; + */ + const CENTIMETER = 2; + /** + * Document dimension is measured in points. 72 points = 1 inch. + * + * Generated from protobuf enum POINT = 3; + */ + const POINT = 3; + + private static $valueToName = [ + self::DOCUMENT_DIMENSION_UNIT_UNSPECIFIED => 'DOCUMENT_DIMENSION_UNIT_UNSPECIFIED', + self::INCH => 'INCH', + self::CENTIMETER => 'CENTIMETER', + self::POINT => 'POINT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DocumentDimensionUnit::class, \Google\Cloud\AutoMl\V1\DocumentDimensions_DocumentDimensionUnit::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentInputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentInputConfig.php new file mode 100644 index 000000000000..6c4eeee9e78d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentInputConfig.php @@ -0,0 +1,89 @@ +google.cloud.automl.v1.DocumentInputConfig + */ +class DocumentInputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The Google Cloud Storage location of the document file. Only a single path + * should be given. + * Max supported size: 512MB. + * Supported extensions: .PDF. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + protected $gcs_source = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsSource $gcs_source + * The Google Cloud Storage location of the document file. Only a single path + * should be given. + * Max supported size: 512MB. + * Supported extensions: .PDF. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * The Google Cloud Storage location of the document file. Only a single path + * should be given. + * Max supported size: 512MB. + * Supported extensions: .PDF. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1; + * @return \Google\Cloud\AutoMl\V1\GcsSource|null + */ + public function getGcsSource() + { + return $this->gcs_source; + } + + public function hasGcsSource() + { + return isset($this->gcs_source); + } + + public function clearGcsSource() + { + unset($this->gcs_source); + } + + /** + * The Google Cloud Storage location of the document file. Only a single path + * should be given. + * Max supported size: 512MB. + * Supported extensions: .PDF. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1; + * @param \Google\Cloud\AutoMl\V1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsSource::class); + $this->gcs_source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExamplePayload.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExamplePayload.php new file mode 100644 index 000000000000..9348c79ee7f3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExamplePayload.php @@ -0,0 +1,141 @@ +google.cloud.automl.v1.ExamplePayload + */ +class ExamplePayload extends \Google\Protobuf\Internal\Message +{ + protected $payload; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\Image $image + * Example image. + * @type \Google\Cloud\AutoMl\V1\TextSnippet $text_snippet + * Example text. + * @type \Google\Cloud\AutoMl\V1\Document $document + * Example document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * Example image. + * + * Generated from protobuf field .google.cloud.automl.v1.Image image = 1; + * @return \Google\Cloud\AutoMl\V1\Image|null + */ + public function getImage() + { + return $this->readOneof(1); + } + + public function hasImage() + { + return $this->hasOneof(1); + } + + /** + * Example image. + * + * Generated from protobuf field .google.cloud.automl.v1.Image image = 1; + * @param \Google\Cloud\AutoMl\V1\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Image::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Example text. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet text_snippet = 2; + * @return \Google\Cloud\AutoMl\V1\TextSnippet|null + */ + public function getTextSnippet() + { + return $this->readOneof(2); + } + + public function hasTextSnippet() + { + return $this->hasOneof(2); + } + + /** + * Example text. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet text_snippet = 2; + * @param \Google\Cloud\AutoMl\V1\TextSnippet $var + * @return $this + */ + public function setTextSnippet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSnippet::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Example document. + * + * Generated from protobuf field .google.cloud.automl.v1.Document document = 4; + * @return \Google\Cloud\AutoMl\V1\Document|null + */ + public function getDocument() + { + return $this->readOneof(4); + } + + public function hasDocument() + { + return $this->hasOneof(4); + } + + /** + * Example document. + * + * Generated from protobuf field .google.cloud.automl.v1.Document document = 4; + * @param \Google\Cloud\AutoMl\V1\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Document::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getPayload() + { + return $this->whichOneof("payload"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata.php new file mode 100644 index 000000000000..df21bee419e0 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata.php @@ -0,0 +1,77 @@ +google.cloud.automl.v1.ExportDataOperationMetadata + */ +class ExportDataOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Information further describing this export data's output. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + */ + protected $output_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata\ExportDataOutputInfo $output_info + * Output only. Information further describing this export data's output. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Information further describing this export data's output. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * @return \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata\ExportDataOutputInfo|null + */ + public function getOutputInfo() + { + return $this->output_info; + } + + public function hasOutputInfo() + { + return isset($this->output_info); + } + + public function clearOutputInfo() + { + unset($this->output_info); + } + + /** + * Output only. Information further describing this export data's output. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * @param \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata\ExportDataOutputInfo $var + * @return $this + */ + public function setOutputInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata\ExportDataOutputInfo::class); + $this->output_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata/ExportDataOutputInfo.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata/ExportDataOutputInfo.php new file mode 100644 index 000000000000..9b2842faa5b7 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata/ExportDataOutputInfo.php @@ -0,0 +1,83 @@ +google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + */ +class ExportDataOutputInfo extends \Google\Protobuf\Internal\Message +{ + protected $output_location; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_output_directory + * The full path of the Google Cloud Storage directory created, into which + * the exported data is written. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the exported data is written. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @return string + */ + public function getGcsOutputDirectory() + { + return $this->readOneof(1); + } + + public function hasGcsOutputDirectory() + { + return $this->hasOneof(1); + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the exported data is written. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @param string $var + * @return $this + */ + public function setGcsOutputDirectory($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getOutputLocation() + { + return $this->whichOneof("output_location"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ExportDataOutputInfo::class, \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata_ExportDataOutputInfo::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataRequest.php new file mode 100644 index 000000000000..de1805283889 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataRequest.php @@ -0,0 +1,127 @@ +google.cloud.automl.v1.ExportDataRequest + */ +class ExportDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the dataset. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The desired output location. + * + * Generated from protobuf field .google.cloud.automl.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + + /** + * @param string $name Required. The resource name of the dataset. Please see + * {@see AutoMlClient::datasetName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\OutputConfig $outputConfig Required. The desired output location. + * + * @return \Google\Cloud\AutoMl\V1\ExportDataRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\AutoMl\V1\OutputConfig $outputConfig): self + { + return (new self()) + ->setName($name) + ->setOutputConfig($outputConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the dataset. + * @type \Google\Cloud\AutoMl\V1\OutputConfig $output_config + * Required. The desired output location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the dataset. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the dataset. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The desired output location. + * + * Generated from protobuf field .google.cloud.automl.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\OutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. The desired output location. + * + * Generated from protobuf field .google.cloud.automl.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\OutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\OutputConfig::class); + $this->output_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata.php new file mode 100644 index 000000000000..d14c8c23cdf4 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.ExportModelOperationMetadata + */ +class ExportModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Information further describing the output of this model + * export. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + */ + protected $output_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata\ExportModelOutputInfo $output_info + * Output only. Information further describing the output of this model + * export. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Information further describing the output of this model + * export. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * @return \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata\ExportModelOutputInfo|null + */ + public function getOutputInfo() + { + return $this->output_info; + } + + public function hasOutputInfo() + { + return isset($this->output_info); + } + + public function clearOutputInfo() + { + unset($this->output_info); + } + + /** + * Output only. Information further describing the output of this model + * export. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * @param \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata\ExportModelOutputInfo $var + * @return $this + */ + public function setOutputInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata\ExportModelOutputInfo::class); + $this->output_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata/ExportModelOutputInfo.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata/ExportModelOutputInfo.php new file mode 100644 index 000000000000..a474a71bfbcd --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata/ExportModelOutputInfo.php @@ -0,0 +1,76 @@ +google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + */ +class ExportModelOutputInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The full path of the Google Cloud Storage directory created, into which + * the model will be exported. + * + * Generated from protobuf field string gcs_output_directory = 1; + */ + protected $gcs_output_directory = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_output_directory + * The full path of the Google Cloud Storage directory created, into which + * the model will be exported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the model will be exported. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @return string + */ + public function getGcsOutputDirectory() + { + return $this->gcs_output_directory; + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the model will be exported. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @param string $var + * @return $this + */ + public function setGcsOutputDirectory($var) + { + GPBUtil::checkString($var, True); + $this->gcs_output_directory = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ExportModelOutputInfo::class, \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata_ExportModelOutputInfo::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelRequest.php new file mode 100644 index 000000000000..f312fb2a3331 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelRequest.php @@ -0,0 +1,129 @@ +google.cloud.automl.v1.ExportModelRequest + */ +class ExportModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the model to export. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The desired output location and configuration. + * + * Generated from protobuf field .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + + /** + * @param string $name Required. The resource name of the model to export. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\ModelExportOutputConfig $outputConfig Required. The desired output location and configuration. + * + * @return \Google\Cloud\AutoMl\V1\ExportModelRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\AutoMl\V1\ModelExportOutputConfig $outputConfig): self + { + return (new self()) + ->setName($name) + ->setOutputConfig($outputConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the model to export. + * @type \Google\Cloud\AutoMl\V1\ModelExportOutputConfig $output_config + * Required. The desired output location and configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the model to export. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the model to export. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The desired output location and configuration. + * + * Generated from protobuf field .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\ModelExportOutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. The desired output location and configuration. + * + * Generated from protobuf field .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\ModelExportOutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ModelExportOutputConfig::class); + $this->output_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsDestination.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsDestination.php new file mode 100644 index 000000000000..1507ee3b65c3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsDestination.php @@ -0,0 +1,87 @@ +google.cloud.automl.v1.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage URI to output directory, up to 2000 + * characters long. + * Accepted forms: + * * Prefix path: gs://bucket/directory + * The requesting user must have write permission to the bucket. + * The directory is created if it doesn't exist. + * + * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_uri_prefix = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $output_uri_prefix + * Required. Google Cloud Storage URI to output directory, up to 2000 + * characters long. + * Accepted forms: + * * Prefix path: gs://bucket/directory + * The requesting user must have write permission to the bucket. + * The directory is created if it doesn't exist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage URI to output directory, up to 2000 + * characters long. + * Accepted forms: + * * Prefix path: gs://bucket/directory + * The requesting user must have write permission to the bucket. + * The directory is created if it doesn't exist. + * + * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOutputUriPrefix() + { + return $this->output_uri_prefix; + } + + /** + * Required. Google Cloud Storage URI to output directory, up to 2000 + * characters long. + * Accepted forms: + * * Prefix path: gs://bucket/directory + * The requesting user must have write permission to the bucket. + * The directory is created if it doesn't exist. + * + * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOutputUriPrefix($var) + { + GPBUtil::checkString($var, True); + $this->output_uri_prefix = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsSource.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsSource.php new file mode 100644 index 000000000000..f1ee2813c293 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsSource.php @@ -0,0 +1,75 @@ +google.cloud.automl.v1.GcsSource + */ +class GcsSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage URIs to input files, up to 2000 + * characters long. Accepted forms: + * * Full object path, e.g. gs://bucket/directory/object.csv + * + * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $input_uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $input_uris + * Required. Google Cloud Storage URIs to input files, up to 2000 + * characters long. Accepted forms: + * * Full object path, e.g. gs://bucket/directory/object.csv + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage URIs to input files, up to 2000 + * characters long. Accepted forms: + * * Full object path, e.g. gs://bucket/directory/object.csv + * + * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInputUris() + { + return $this->input_uris; + } + + /** + * Required. Google Cloud Storage URIs to input files, up to 2000 + * characters long. Accepted forms: + * * Full object path, e.g. gs://bucket/directory/object.csv + * + * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInputUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->input_uris = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetAnnotationSpecRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetAnnotationSpecRequest.php new file mode 100644 index 000000000000..b6537a7c5566 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetAnnotationSpecRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.GetAnnotationSpecRequest + */ +class GetAnnotationSpecRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the annotation spec to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the annotation spec to retrieve. Please see + * {@see AutoMlClient::annotationSpecName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\GetAnnotationSpecRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the annotation spec to retrieve. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the annotation spec to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the annotation spec to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetDatasetRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetDatasetRequest.php new file mode 100644 index 000000000000..e72ac9b107a3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetDatasetRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.GetDatasetRequest + */ +class GetDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the dataset to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the dataset to retrieve. Please see + * {@see AutoMlClient::datasetName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\GetDatasetRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the dataset to retrieve. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the dataset to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the dataset to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelEvaluationRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelEvaluationRequest.php new file mode 100644 index 000000000000..486af4fea40c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelEvaluationRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.GetModelEvaluationRequest + */ +class GetModelEvaluationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name for the model evaluation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name for the model evaluation. Please see + * {@see AutoMlClient::modelEvaluationName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\GetModelEvaluationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name for the model evaluation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name for the model evaluation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name for the model evaluation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelRequest.php new file mode 100644 index 000000000000..a318754dbc1a --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.GetModelRequest + */ +class GetModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the model. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the model. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\GetModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the model. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the model. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Image.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Image.php new file mode 100644 index 000000000000..e419a45e3363 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Image.php @@ -0,0 +1,116 @@ +google.cloud.automl.v1.Image + */ +class Image extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. HTTP URI to the thumbnail image. + * + * Generated from protobuf field string thumbnail_uri = 4; + */ + protected $thumbnail_uri = ''; + protected $data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image_bytes + * Image content represented as a stream of bytes. + * Note: As with all `bytes` fields, protobuffers use a pure binary + * representation, whereas JSON representations use base64. + * @type string $thumbnail_uri + * Output only. HTTP URI to the thumbnail image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * Image content represented as a stream of bytes. + * Note: As with all `bytes` fields, protobuffers use a pure binary + * representation, whereas JSON representations use base64. + * + * Generated from protobuf field bytes image_bytes = 1; + * @return string + */ + public function getImageBytes() + { + return $this->readOneof(1); + } + + public function hasImageBytes() + { + return $this->hasOneof(1); + } + + /** + * Image content represented as a stream of bytes. + * Note: As with all `bytes` fields, protobuffers use a pure binary + * representation, whereas JSON representations use base64. + * + * Generated from protobuf field bytes image_bytes = 1; + * @param string $var + * @return $this + */ + public function setImageBytes($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Output only. HTTP URI to the thumbnail image. + * + * Generated from protobuf field string thumbnail_uri = 4; + * @return string + */ + public function getThumbnailUri() + { + return $this->thumbnail_uri; + } + + /** + * Output only. HTTP URI to the thumbnail image. + * + * Generated from protobuf field string thumbnail_uri = 4; + * @param string $var + * @return $this + */ + public function setThumbnailUri($var) + { + GPBUtil::checkString($var, True); + $this->thumbnail_uri = $var; + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->whichOneof("data"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationDatasetMetadata.php new file mode 100644 index 000000000000..cdff5eb4abcc --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationDatasetMetadata.php @@ -0,0 +1,67 @@ +google.cloud.automl.v1.ImageClassificationDatasetMetadata + */ +class ImageClassificationDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $classification_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $classification_type + * Required. Type of the classification problem. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getClassificationType() + { + return $this->classification_type; + } + + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setClassificationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\ClassificationType::class); + $this->classification_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelDeploymentMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelDeploymentMetadata.php new file mode 100644 index 000000000000..6feef139228c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelDeploymentMetadata.php @@ -0,0 +1,83 @@ +google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + */ +class ImageClassificationModelDeploymentMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $node_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $node_count + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + * Must be between 1 and 100, inclusive on both ends. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return int|string + */ + public function getNodeCount() + { + return $this->node_count; + } + + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt64($var); + $this->node_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelMetadata.php new file mode 100644 index 000000000000..9ae527709873 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelMetadata.php @@ -0,0 +1,491 @@ +google.cloud.automl.v1.ImageClassificationModelMetadata + */ +class ImageClassificationModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The ID of the `base` model. If it is specified, the new model + * will be created based on the `base` model. Otherwise, the new model will be + * created from scratch. The `base` model must be in the same + * `project` and `location` as the new model to create, and have the same + * `model_type`. + * + * Generated from protobuf field string base_model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $base_model_id = ''; + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud`(default), the train budget must be between 8,000 + * and 800,000 milli node hours, inclusive. The default value is 192, 000 + * which represents one day in wall time. For model type + * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + * and 100,000 milli node hours, inclusive. The default value is 24, 000 which + * represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $train_budget_milli_node_hours = 0; + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $train_cost_milli_node_hours = 0; + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $stop_reason = ''; + /** + * Optional. Type of the model. The available values are: + * * `cloud` - Model to be used via prediction calls to AutoML API. + * This is the default value. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. Expected to have low latency, but may have + * lower prediction quality than other models. + * * `mobile-core-ml-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. + * * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + * providing prediction via AutoML API, can also be exported + * (see [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with + * Core ML afterwards. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * + * Generated from protobuf field string model_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $model_type = ''; + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $node_qps = 0.0; + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the node_qps field. + * + * Generated from protobuf field int64 node_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $node_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $base_model_id + * Optional. The ID of the `base` model. If it is specified, the new model + * will be created based on the `base` model. Otherwise, the new model will be + * created from scratch. The `base` model must be in the same + * `project` and `location` as the new model to create, and have the same + * `model_type`. + * @type int|string $train_budget_milli_node_hours + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud`(default), the train budget must be between 8,000 + * and 800,000 milli node hours, inclusive. The default value is 192, 000 + * which represents one day in wall time. For model type + * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + * and 100,000 milli node hours, inclusive. The default value is 24, 000 which + * represents one day in wall time. + * @type int|string $train_cost_milli_node_hours + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * @type string $stop_reason + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * @type string $model_type + * Optional. Type of the model. The available values are: + * * `cloud` - Model to be used via prediction calls to AutoML API. + * This is the default value. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. Expected to have low latency, but may have + * lower prediction quality than other models. + * * `mobile-core-ml-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. + * * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + * providing prediction via AutoML API, can also be exported + * (see [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with + * Core ML afterwards. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * @type float $node_qps + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * @type int|string $node_count + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the node_qps field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The ID of the `base` model. If it is specified, the new model + * will be created based on the `base` model. Otherwise, the new model will be + * created from scratch. The `base` model must be in the same + * `project` and `location` as the new model to create, and have the same + * `model_type`. + * + * Generated from protobuf field string base_model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBaseModelId() + { + return $this->base_model_id; + } + + /** + * Optional. The ID of the `base` model. If it is specified, the new model + * will be created based on the `base` model. Otherwise, the new model will be + * created from scratch. The `base` model must be in the same + * `project` and `location` as the new model to create, and have the same + * `model_type`. + * + * Generated from protobuf field string base_model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBaseModelId($var) + { + GPBUtil::checkString($var, True); + $this->base_model_id = $var; + + return $this; + } + + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud`(default), the train budget must be between 8,000 + * and 800,000 milli node hours, inclusive. The default value is 192, 000 + * which represents one day in wall time. For model type + * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + * and 100,000 milli node hours, inclusive. The default value is 24, 000 which + * represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getTrainBudgetMilliNodeHours() + { + return $this->train_budget_milli_node_hours; + } + + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud`(default), the train budget must be between 8,000 + * and 800,000 milli node hours, inclusive. The default value is 192, 000 + * which represents one day in wall time. For model type + * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + * and 100,000 milli node hours, inclusive. The default value is 24, 000 which + * represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setTrainBudgetMilliNodeHours($var) + { + GPBUtil::checkInt64($var); + $this->train_budget_milli_node_hours = $var; + + return $this; + } + + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTrainCostMilliNodeHours() + { + return $this->train_cost_milli_node_hours; + } + + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTrainCostMilliNodeHours($var) + { + GPBUtil::checkInt64($var); + $this->train_cost_milli_node_hours = $var; + + return $this; + } + + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStopReason() + { + return $this->stop_reason; + } + + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStopReason($var) + { + GPBUtil::checkString($var, True); + $this->stop_reason = $var; + + return $this; + } + + /** + * Optional. Type of the model. The available values are: + * * `cloud` - Model to be used via prediction calls to AutoML API. + * This is the default value. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. Expected to have low latency, but may have + * lower prediction quality than other models. + * * `mobile-core-ml-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. + * * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + * providing prediction via AutoML API, can also be exported + * (see [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with + * Core ML afterwards. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * + * Generated from protobuf field string model_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getModelType() + { + return $this->model_type; + } + + /** + * Optional. Type of the model. The available values are: + * * `cloud` - Model to be used via prediction calls to AutoML API. + * This is the default value. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. Expected to have low latency, but may have + * lower prediction quality than other models. + * * `mobile-core-ml-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. + * * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + * providing prediction via AutoML API, can also be exported + * (see [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with + * Core ML afterwards. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * + * Generated from protobuf field string model_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setModelType($var) + { + GPBUtil::checkString($var, True); + $this->model_type = $var; + + return $this; + } + + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getNodeQps() + { + return $this->node_qps; + } + + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setNodeQps($var) + { + GPBUtil::checkDouble($var); + $this->node_qps = $var; + + return $this; + } + + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the node_qps field. + * + * Generated from protobuf field int64 node_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getNodeCount() + { + return $this->node_count; + } + + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the node_qps field. + * + * Generated from protobuf field int64 node_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt64($var); + $this->node_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionAnnotation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionAnnotation.php new file mode 100644 index 000000000000..d14e42e9405c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionAnnotation.php @@ -0,0 +1,115 @@ +google.cloud.automl.v1.ImageObjectDetectionAnnotation + */ +class ImageObjectDetectionAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The rectangle representing the object location. + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + protected $bounding_box = null; + /** + * Output only. The confidence that this annotation is positive for the parent example, + * value in [0, 1], higher means higher positivity confidence. + * + * Generated from protobuf field float score = 2; + */ + protected $score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\BoundingPoly $bounding_box + * Output only. The rectangle representing the object location. + * @type float $score + * Output only. The confidence that this annotation is positive for the parent example, + * value in [0, 1], higher means higher positivity confidence. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Detection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The rectangle representing the object location. + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + * @return \Google\Cloud\AutoMl\V1\BoundingPoly|null + */ + public function getBoundingBox() + { + return $this->bounding_box; + } + + public function hasBoundingBox() + { + return isset($this->bounding_box); + } + + public function clearBoundingBox() + { + unset($this->bounding_box); + } + + /** + * Output only. The rectangle representing the object location. + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + * @param \Google\Cloud\AutoMl\V1\BoundingPoly $var + * @return $this + */ + public function setBoundingBox($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BoundingPoly::class); + $this->bounding_box = $var; + + return $this; + } + + /** + * Output only. The confidence that this annotation is positive for the parent example, + * value in [0, 1], higher means higher positivity confidence. + * + * Generated from protobuf field float score = 2; + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * Output only. The confidence that this annotation is positive for the parent example, + * value in [0, 1], higher means higher positivity confidence. + * + * Generated from protobuf field float score = 2; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionDatasetMetadata.php new file mode 100644 index 000000000000..a2ba5e2adecf --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionDatasetMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + */ +class ImageObjectDetectionDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionEvaluationMetrics.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionEvaluationMetrics.php new file mode 100644 index 000000000000..c76660d7f663 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionEvaluationMetrics.php @@ -0,0 +1,156 @@ +google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + */ +class ImageObjectDetectionEvaluationMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The total number of bounding boxes (i.e. summed over all + * images) the ground truth used to create this evaluation had. + * + * Generated from protobuf field int32 evaluated_bounding_box_count = 1; + */ + protected $evaluated_bounding_box_count = 0; + /** + * Output only. The bounding boxes match metrics for each + * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * pair. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + */ + private $bounding_box_metrics_entries; + /** + * Output only. The single metric for bounding boxes evaluation: + * the mean_average_precision averaged over all bounding_box_metrics_entries. + * + * Generated from protobuf field float bounding_box_mean_average_precision = 3; + */ + protected $bounding_box_mean_average_precision = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $evaluated_bounding_box_count + * Output only. The total number of bounding boxes (i.e. summed over all + * images) the ground truth used to create this evaluation had. + * @type array<\Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $bounding_box_metrics_entries + * Output only. The bounding boxes match metrics for each + * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * pair. + * @type float $bounding_box_mean_average_precision + * Output only. The single metric for bounding boxes evaluation: + * the mean_average_precision averaged over all bounding_box_metrics_entries. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Detection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The total number of bounding boxes (i.e. summed over all + * images) the ground truth used to create this evaluation had. + * + * Generated from protobuf field int32 evaluated_bounding_box_count = 1; + * @return int + */ + public function getEvaluatedBoundingBoxCount() + { + return $this->evaluated_bounding_box_count; + } + + /** + * Output only. The total number of bounding boxes (i.e. summed over all + * images) the ground truth used to create this evaluation had. + * + * Generated from protobuf field int32 evaluated_bounding_box_count = 1; + * @param int $var + * @return $this + */ + public function setEvaluatedBoundingBoxCount($var) + { + GPBUtil::checkInt32($var); + $this->evaluated_bounding_box_count = $var; + + return $this; + } + + /** + * Output only. The bounding boxes match metrics for each + * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * pair. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBoundingBoxMetricsEntries() + { + return $this->bounding_box_metrics_entries; + } + + /** + * Output only. The bounding boxes match metrics for each + * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * pair. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * @param array<\Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBoundingBoxMetricsEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry::class); + $this->bounding_box_metrics_entries = $arr; + + return $this; + } + + /** + * Output only. The single metric for bounding boxes evaluation: + * the mean_average_precision averaged over all bounding_box_metrics_entries. + * + * Generated from protobuf field float bounding_box_mean_average_precision = 3; + * @return float + */ + public function getBoundingBoxMeanAveragePrecision() + { + return $this->bounding_box_mean_average_precision; + } + + /** + * Output only. The single metric for bounding boxes evaluation: + * the mean_average_precision averaged over all bounding_box_metrics_entries. + * + * Generated from protobuf field float bounding_box_mean_average_precision = 3; + * @param float $var + * @return $this + */ + public function setBoundingBoxMeanAveragePrecision($var) + { + GPBUtil::checkFloat($var); + $this->bounding_box_mean_average_precision = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelDeploymentMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelDeploymentMetadata.php new file mode 100644 index 000000000000..aa2ba7040637 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelDeploymentMetadata.php @@ -0,0 +1,83 @@ +google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + */ +class ImageObjectDetectionModelDeploymentMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $node_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $node_count + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + * Must be between 1 and 100, inclusive on both ends. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return int|string + */ + public function getNodeCount() + { + return $this->node_count; + } + + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt64($var); + $this->node_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelMetadata.php new file mode 100644 index 000000000000..522fb87ccb8f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelMetadata.php @@ -0,0 +1,405 @@ +google.cloud.automl.v1.ImageObjectDetectionModelMetadata + */ +class ImageObjectDetectionModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Type of the model. The available values are: + * * `cloud-high-accuracy-1` - (default) A model to be used via prediction + * calls to AutoML API. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * * `cloud-low-latency-1` - A model to be used via prediction + * calls to AutoML API. Expected to have low latency, but may + * have lower prediction quality than other models. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * + * Generated from protobuf field string model_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $model_type = ''; + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the qps_per_node field. + * + * Generated from protobuf field int64 node_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $node_count = 0; + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $node_qps = 0.0; + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $stop_reason = ''; + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + * the train budget must be between 20,000 and 900,000 milli node hours, + * inclusive. The default value is 216, 000 which represents one day in + * wall time. + * For model type `mobile-low-latency-1`, `mobile-versatile-1`, + * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + * budget must be between 1,000 and 100,000 milli node hours, inclusive. + * The default value is 24, 000 which represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $train_budget_milli_node_hours = 0; + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $train_cost_milli_node_hours = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model_type + * Optional. Type of the model. The available values are: + * * `cloud-high-accuracy-1` - (default) A model to be used via prediction + * calls to AutoML API. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * * `cloud-low-latency-1` - A model to be used via prediction + * calls to AutoML API. Expected to have low latency, but may + * have lower prediction quality than other models. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * @type int|string $node_count + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the qps_per_node field. + * @type float $node_qps + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * @type string $stop_reason + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * @type int|string $train_budget_milli_node_hours + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + * the train budget must be between 20,000 and 900,000 milli node hours, + * inclusive. The default value is 216, 000 which represents one day in + * wall time. + * For model type `mobile-low-latency-1`, `mobile-versatile-1`, + * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + * budget must be between 1,000 and 100,000 milli node hours, inclusive. + * The default value is 24, 000 which represents one day in wall time. + * @type int|string $train_cost_milli_node_hours + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Type of the model. The available values are: + * * `cloud-high-accuracy-1` - (default) A model to be used via prediction + * calls to AutoML API. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * * `cloud-low-latency-1` - A model to be used via prediction + * calls to AutoML API. Expected to have low latency, but may + * have lower prediction quality than other models. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * + * Generated from protobuf field string model_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getModelType() + { + return $this->model_type; + } + + /** + * Optional. Type of the model. The available values are: + * * `cloud-high-accuracy-1` - (default) A model to be used via prediction + * calls to AutoML API. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * * `cloud-low-latency-1` - A model to be used via prediction + * calls to AutoML API. Expected to have low latency, but may + * have lower prediction quality than other models. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * + * Generated from protobuf field string model_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setModelType($var) + { + GPBUtil::checkString($var, True); + $this->model_type = $var; + + return $this; + } + + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the qps_per_node field. + * + * Generated from protobuf field int64 node_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getNodeCount() + { + return $this->node_count; + } + + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the qps_per_node field. + * + * Generated from protobuf field int64 node_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt64($var); + $this->node_count = $var; + + return $this; + } + + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getNodeQps() + { + return $this->node_qps; + } + + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setNodeQps($var) + { + GPBUtil::checkDouble($var); + $this->node_qps = $var; + + return $this; + } + + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStopReason() + { + return $this->stop_reason; + } + + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStopReason($var) + { + GPBUtil::checkString($var, True); + $this->stop_reason = $var; + + return $this; + } + + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + * the train budget must be between 20,000 and 900,000 milli node hours, + * inclusive. The default value is 216, 000 which represents one day in + * wall time. + * For model type `mobile-low-latency-1`, `mobile-versatile-1`, + * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + * budget must be between 1,000 and 100,000 milli node hours, inclusive. + * The default value is 24, 000 which represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getTrainBudgetMilliNodeHours() + { + return $this->train_budget_milli_node_hours; + } + + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + * the train budget must be between 20,000 and 900,000 milli node hours, + * inclusive. The default value is 216, 000 which represents one day in + * wall time. + * For model type `mobile-low-latency-1`, `mobile-versatile-1`, + * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + * budget must be between 1,000 and 100,000 milli node hours, inclusive. + * The default value is 24, 000 which represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setTrainBudgetMilliNodeHours($var) + { + GPBUtil::checkInt64($var); + $this->train_budget_milli_node_hours = $var; + + return $this; + } + + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTrainCostMilliNodeHours() + { + return $this->train_cost_milli_node_hours; + } + + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTrainCostMilliNodeHours($var) + { + GPBUtil::checkInt64($var); + $this->train_cost_milli_node_hours = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataOperationMetadata.php new file mode 100644 index 000000000000..33f3202cd1f0 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.ImportDataOperationMetadata + */ +class ImportDataOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataRequest.php new file mode 100644 index 000000000000..c8b094af5d22 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataRequest.php @@ -0,0 +1,137 @@ +google.cloud.automl.v1.ImportDataRequest + */ +class ImportDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The desired input location and its domain specific semantics, + * if any. + * + * Generated from protobuf field .google.cloud.automl.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + + /** + * @param string $name Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. Please see + * {@see AutoMlClient::datasetName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\InputConfig $inputConfig Required. The desired input location and its domain specific semantics, + * if any. + * + * @return \Google\Cloud\AutoMl\V1\ImportDataRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\AutoMl\V1\InputConfig $inputConfig): self + { + return (new self()) + ->setName($name) + ->setInputConfig($inputConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * @type \Google\Cloud\AutoMl\V1\InputConfig $input_config + * Required. The desired input location and its domain specific semantics, + * if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The desired input location and its domain specific semantics, + * if any. + * + * Generated from protobuf field .google.cloud.automl.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Required. The desired input location and its domain specific semantics, + * if any. + * + * Generated from protobuf field .google.cloud.automl.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\InputConfig::class); + $this->input_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/InputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/InputConfig.php new file mode 100644 index 000000000000..eb2d04bbb9c0 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/InputConfig.php @@ -0,0 +1,614 @@ + + * + * #### AutoML Video Intelligence + * ##### Classification + * See [Preparing your training + * data](https://cloud.google.com/video-intelligence/automl/docs/prepare) for + * more information. + * CSV file(s) with each line in format: + * ML_USE,GCS_FILE_PATH + * For `ML_USE`, do not use `VALIDATE`. + * `GCS_FILE_PATH` is the path to another .csv file that describes training + * example for a given `ML_USE`, using the following row format: + * GCS_FILE_PATH,(LABEL,TIME_SEGMENT_START,TIME_SEGMENT_END | ,,) + * Here `GCS_FILE_PATH` leads to a video of up to 50GB in size and up + * to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. + * `TIME_SEGMENT_START` and `TIME_SEGMENT_END` must be within the + * length of the video, and the end time must be after the start time. Any + * segment of a video which has one or more labels on it, is considered a + * hard negative for all other labels. Any segment with no labels on + * it is considered to be unknown. If a whole video is unknown, then + * it should be mentioned just once with ",," in place of `LABEL, + * TIME_SEGMENT_START,TIME_SEGMENT_END`. + * Sample top level CSV file: + * TRAIN,gs://folder/train_videos.csv + * TEST,gs://folder/test_videos.csv + * UNASSIGNED,gs://folder/other_videos.csv + * Sample rows of a CSV file for a particular ML_USE: + * gs://folder/video1.avi,car,120,180.000021 + * gs://folder/video1.avi,bike,150,180.000021 + * gs://folder/vid2.avi,car,0,60.5 + * gs://folder/vid3.avi,,, + * ##### Object Tracking + * See [Preparing your training + * data](/video-intelligence/automl/object-tracking/docs/prepare) for more + * information. + * CSV file(s) with each line in format: + * ML_USE,GCS_FILE_PATH + * For `ML_USE`, do not use `VALIDATE`. + * `GCS_FILE_PATH` is the path to another .csv file that describes training + * example for a given `ML_USE`, using the following row format: + * GCS_FILE_PATH,LABEL,[INSTANCE_ID],TIMESTAMP,BOUNDING_BOX + * or + * GCS_FILE_PATH,,,,,,,,,, + * Here `GCS_FILE_PATH` leads to a video of up to 50GB in size and up + * to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. + * Providing `INSTANCE_ID`s can help to obtain a better model. When + * a specific labeled entity leaves the video frame, and shows up + * afterwards it is not required, albeit preferable, that the same + * `INSTANCE_ID` is given to it. + * `TIMESTAMP` must be within the length of the video, the + * `BOUNDING_BOX` is assumed to be drawn on the closest video's frame + * to the `TIMESTAMP`. Any mentioned by the `TIMESTAMP` frame is expected + * to be exhaustively labeled and no more than 500 `BOUNDING_BOX`-es per + * frame are allowed. If a whole video is unknown, then it should be + * mentioned just once with ",,,,,,,,,," in place of `LABEL, + * [INSTANCE_ID],TIMESTAMP,BOUNDING_BOX`. + * Sample top level CSV file: + * TRAIN,gs://folder/train_videos.csv + * TEST,gs://folder/test_videos.csv + * UNASSIGNED,gs://folder/other_videos.csv + * Seven sample rows of a CSV file for a particular ML_USE: + * gs://folder/video1.avi,car,1,12.10,0.8,0.8,0.9,0.8,0.9,0.9,0.8,0.9 + * gs://folder/video1.avi,car,1,12.90,0.4,0.8,0.5,0.8,0.5,0.9,0.4,0.9 + * gs://folder/video1.avi,car,2,12.10,.4,.2,.5,.2,.5,.3,.4,.3 + * gs://folder/video1.avi,car,2,12.90,.8,.2,,,.9,.3,, + * gs://folder/video1.avi,bike,,12.50,.45,.45,,,.55,.55,, + * gs://folder/video2.avi,car,1,0,.1,.9,,,.9,.1,, + * gs://folder/video2.avi,,,,,,,,,,, + * #### AutoML Natural Language + * ##### Entity Extraction + * See [Preparing your training + * data](/natural-language/automl/entity-analysis/docs/prepare) for more + * information. + * One or more CSV file(s) with each line in the following format: + * ML_USE,GCS_FILE_PATH + * * `ML_USE` - Identifies the data set that the current row (file) applies + * to. + * This value can be one of the following: + * * `TRAIN` - Rows in this file are used to train the model. + * * `TEST` - Rows in this file are used to test the model during training. + * * `UNASSIGNED` - Rows in this file are not categorized. They are + * Automatically divided into train and test data. 80% for training and + * 20% for testing.. + * * `GCS_FILE_PATH` - a Identifies JSON Lines (.JSONL) file stored in + * Google Cloud Storage that contains in-line text in-line as documents + * for model training. + * After the training data set has been determined from the `TRAIN` and + * `UNASSIGNED` CSV files, the training data is divided into train and + * validation data sets. 70% for training and 30% for validation. + * For example: + * TRAIN,gs://folder/file1.jsonl + * VALIDATE,gs://folder/file2.jsonl + * TEST,gs://folder/file3.jsonl + * **In-line JSONL files** + * In-line .JSONL files contain, per line, a JSON document that wraps a + * [`text_snippet`][google.cloud.automl.v1.TextSnippet] field followed by + * one or more [`annotations`][google.cloud.automl.v1.AnnotationPayload] + * fields, which have `display_name` and `text_extraction` fields to describe + * the entity from the text snippet. Multiple JSON documents can be separated + * using line breaks (\n). + * The supplied text must be annotated exhaustively. For example, if you + * include the text "horse", but do not label it as "animal", + * then "horse" is assumed to not be an "animal". + * Any given text snippet content must have 30,000 characters or + * less, and also be UTF-8 NFC encoded. ASCII is accepted as it is + * UTF-8 NFC encoded. + * For example: + * { + * "text_snippet": { + * "content": "dog car cat" + * }, + * "annotations": [ + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 0, "end_offset": 2} + * } + * }, + * { + * "display_name": "vehicle", + * "text_extraction": { + * "text_segment": {"start_offset": 4, "end_offset": 6} + * } + * }, + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 8, "end_offset": 10} + * } + * } + * ] + * }\n + * { + * "text_snippet": { + * "content": "This dog is good." + * }, + * "annotations": [ + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 5, "end_offset": 7} + * } + * } + * ] + * } + * **JSONL files that reference documents** + * .JSONL files contain, per line, a JSON document that wraps a + * `input_config` that contains the path to a source document. + * Multiple JSON documents can be separated using line breaks (\n). + * Supported document extensions: .PDF, .TIF, .TIFF + * For example: + * { + * "document": { + * "input_config": { + * "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] + * } + * } + * } + * }\n + * { + * "document": { + * "input_config": { + * "gcs_source": { "input_uris": [ "gs://folder/document2.tif" ] + * } + * } + * } + * } + * **In-line JSONL files with document layout information** + * **Note:** You can only annotate documents using the UI. The format described + * below applies to annotated documents exported using the UI or `exportData`. + * In-line .JSONL files for documents contain, per line, a JSON document + * that wraps a `document` field that provides the textual content of the + * document and the layout information. + * For example: + * { + * "document": { + * "document_text": { + * "content": "dog car cat" + * } + * "layout": [ + * { + * "text_segment": { + * "start_offset": 0, + * "end_offset": 11, + * }, + * "page_number": 1, + * "bounding_poly": { + * "normalized_vertices": [ + * {"x": 0.1, "y": 0.1}, + * {"x": 0.1, "y": 0.3}, + * {"x": 0.3, "y": 0.3}, + * {"x": 0.3, "y": 0.1}, + * ], + * }, + * "text_segment_type": TOKEN, + * } + * ], + * "document_dimensions": { + * "width": 8.27, + * "height": 11.69, + * "unit": INCH, + * } + * "page_count": 3, + * }, + * "annotations": [ + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 0, "end_offset": 3} + * } + * }, + * { + * "display_name": "vehicle", + * "text_extraction": { + * "text_segment": {"start_offset": 4, "end_offset": 7} + * } + * }, + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 8, "end_offset": 11} + * } + * }, + * ], + * ##### Classification + * See [Preparing your training + * data](https://cloud.google.com/natural-language/automl/docs/prepare) for more + * information. + * One or more CSV file(s) with each line in the following format: + * ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,... + * * `ML_USE` - Identifies the data set that the current row (file) applies + * to. + * This value can be one of the following: + * * `TRAIN` - Rows in this file are used to train the model. + * * `TEST` - Rows in this file are used to test the model during training. + * * `UNASSIGNED` - Rows in this file are not categorized. They are + * Automatically divided into train and test data. 80% for training and + * 20% for testing. + * * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If + * the column content is a valid Google Cloud Storage file path, that is, + * prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if + * the content is enclosed in double quotes (""), it is treated as a + * `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a + * file with supported extension and UTF-8 encoding, for example, + * "gs://folder/content.txt" AutoML imports the file content + * as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content + * excluding quotes. In both cases, size of the content must be 10MB or + * less in size. For zip files, the size of each file inside the zip must be + * 10MB or less in size. + * For the `MULTICLASS` classification type, at most one `LABEL` is allowed. + * The `ML_USE` and `LABEL` columns are optional. + * Supported file extensions: .TXT, .PDF, .TIF, .TIFF, .ZIP + * A maximum of 100 unique labels are allowed per CSV row. + * Sample rows: + * TRAIN,"They have bad food and very rude",RudeService,BadFood + * gs://folder/content.txt,SlowService + * TEST,gs://folder/document.pdf + * VALIDATE,gs://folder/text_files.zip,BadFood + * ##### Sentiment Analysis + * See [Preparing your training + * data](https://cloud.google.com/natural-language/automl/docs/prepare) for more + * information. + * CSV file(s) with each line in format: + * ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT + * * `ML_USE` - Identifies the data set that the current row (file) applies + * to. + * This value can be one of the following: + * * `TRAIN` - Rows in this file are used to train the model. + * * `TEST` - Rows in this file are used to test the model during training. + * * `UNASSIGNED` - Rows in this file are not categorized. They are + * Automatically divided into train and test data. 80% for training and + * 20% for testing. + * * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If + * the column content is a valid Google Cloud Storage file path, that is, + * prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if + * the content is enclosed in double quotes (""), it is treated as a + * `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a + * file with supported extension and UTF-8 encoding, for example, + * "gs://folder/content.txt" AutoML imports the file content + * as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content + * excluding quotes. In both cases, size of the content must be 128kB or + * less in size. For zip files, the size of each file inside the zip must be + * 128kB or less in size. + * The `ML_USE` and `SENTIMENT` columns are optional. + * Supported file extensions: .TXT, .PDF, .TIF, .TIFF, .ZIP + * * `SENTIMENT` - An integer between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max + * (inclusive). Describes the ordinal of the sentiment - higher + * value means a more positive sentiment. All the values are + * completely relative, i.e. neither 0 needs to mean a negative or + * neutral sentiment nor sentiment_max needs to mean a positive one - + * it is just required that 0 is the least positive sentiment + * in the data, and sentiment_max is the most positive one. + * The SENTIMENT shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * All SENTIMENT values between 0 and sentiment_max must be + * represented in the imported data. On prediction the same 0 to + * sentiment_max range will be used. The difference between + * neighboring sentiment values needs not to be uniform, e.g. 1 and + * 2 may be similar whereas the difference between 2 and 3 may be + * large. + * Sample rows: + * TRAIN,"@freewrytin this is way too good for your product",2 + * gs://folder/content.txt,3 + * TEST,gs://folder/document.pdf + * VALIDATE,gs://folder/text_files.zip,2 + * #### AutoML Tables + * See [Preparing your training + * data](https://cloud.google.com/automl-tables/docs/prepare) for more + * information. + * You can use either + * [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] or + * [bigquery_source][google.cloud.automl.v1.InputConfig.bigquery_source]. + * All input is concatenated into a + * single + * [primary_table_spec_id][google.cloud.automl.v1.TablesDatasetMetadata.primary_table_spec_id] + * **For gcs_source:** + * CSV file(s), where the first row of the first file is the header, + * containing unique column names. If the first row of a subsequent + * file is the same as the header, then it is also treated as a + * header. All other rows contain values for the corresponding + * columns. + * Each .CSV file by itself must be 10GB or smaller, and their total + * size must be 100GB or smaller. + * First three sample rows of a CSV file: + *
+ * "Id","First Name","Last Name","Dob","Addresses"
+ * "1","John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]"
+ * "2","Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]}
+ * 
+ * **For bigquery_source:** + * An URI of a BigQuery table. The user data size of the BigQuery + * table must be 100GB or smaller. + * An imported table must have between 2 and 1,000 columns, inclusive, + * and between 1000 and 100,000,000 rows, inclusive. There are at most 5 + * import data running in parallel. + * **Input field definitions:** + * `ML_USE` + * : ("TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED") + * Describes how the given example (file) should be used for model + * training. "UNASSIGNED" can be used when user has no preference. + * `GCS_FILE_PATH` + * : The path to a file on Google Cloud Storage. For example, + * "gs://folder/image1.png". + * `LABEL` + * : A display name of an object on an image, video etc., e.g. "dog". + * Must be up to 32 characters long and can consist only of ASCII + * Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9. + * For each label an AnnotationSpec is created which display_name + * becomes the label; AnnotationSpecs are given back in predictions. + * `INSTANCE_ID` + * : A positive integer that identifies a specific instance of a + * labeled entity on an example. Used e.g. to track two cars on + * a video while being able to tell apart which one is which. + * `BOUNDING_BOX` + * : (`VERTEX,VERTEX,VERTEX,VERTEX` | `VERTEX,,,VERTEX,,`) + * A rectangle parallel to the frame of the example (image, + * video). If 4 vertices are given they are connected by edges + * in the order provided, if 2 are given they are recognized + * as diagonally opposite vertices of the rectangle. + * `VERTEX` + * : (`COORDINATE,COORDINATE`) + * First coordinate is horizontal (x), the second is vertical (y). + * `COORDINATE` + * : A float in 0 to 1 range, relative to total length of + * image or video in given dimension. For fractions the + * leading non-decimal 0 can be omitted (i.e. 0.3 = .3). + * Point 0,0 is in top left. + * `TIME_SEGMENT_START` + * : (`TIME_OFFSET`) + * Expresses a beginning, inclusive, of a time segment + * within an example that has a time dimension + * (e.g. video). + * `TIME_SEGMENT_END` + * : (`TIME_OFFSET`) + * Expresses an end, exclusive, of a time segment within + * n example that has a time dimension (e.g. video). + * `TIME_OFFSET` + * : A number of seconds as measured from the start of an + * example (e.g. video). Fractions are allowed, up to a + * microsecond precision. "inf" is allowed, and it means the end + * of the example. + * `TEXT_SNIPPET` + * : The content of a text snippet, UTF-8 encoded, enclosed within + * double quotes (""). + * `DOCUMENT` + * : A field that provides the textual content with document and the layout + * information. + * **Errors:** + * If any of the provided CSV files can't be parsed or if more than certain + * percent of CSV rows cannot be processed then the operation fails and + * nothing is imported. Regardless of overall success or failure the per-row + * failures, up to a certain count cap, is listed in + * Operation.metadata.partial_failures. + * + * Generated from protobuf message google.cloud.automl.v1.InputConfig + */ +class InputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Additional domain-specific parameters describing the semantic of the + * imported data, any string must be up to 25000 + * characters long. + * #### AutoML Tables + * `schema_inference_version` + * : (integer) This value must be supplied. + * The version of the + * algorithm to use for the initial inference of the + * column data types of the imported table. Allowed values: "1". + * + * Generated from protobuf field map params = 2; + */ + private $params; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsSource $gcs_source + * The Google Cloud Storage location for the input content. + * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData], + * `gcs_source` points to a CSV file with a structure described in + * [InputConfig][google.cloud.automl.v1.InputConfig]. + * @type array|\Google\Protobuf\Internal\MapField $params + * Additional domain-specific parameters describing the semantic of the + * imported data, any string must be up to 25000 + * characters long. + * #### AutoML Tables + * `schema_inference_version` + * : (integer) This value must be supplied. + * The version of the + * algorithm to use for the initial inference of the + * column data types of the imported table. Allowed values: "1". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * The Google Cloud Storage location for the input content. + * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData], + * `gcs_source` points to a CSV file with a structure described in + * [InputConfig][google.cloud.automl.v1.InputConfig]. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1; + * @return \Google\Cloud\AutoMl\V1\GcsSource|null + */ + public function getGcsSource() + { + return $this->readOneof(1); + } + + public function hasGcsSource() + { + return $this->hasOneof(1); + } + + /** + * The Google Cloud Storage location for the input content. + * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData], + * `gcs_source` points to a CSV file with a structure described in + * [InputConfig][google.cloud.automl.v1.InputConfig]. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1; + * @param \Google\Cloud\AutoMl\V1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Additional domain-specific parameters describing the semantic of the + * imported data, any string must be up to 25000 + * characters long. + * #### AutoML Tables + * `schema_inference_version` + * : (integer) This value must be supplied. + * The version of the + * algorithm to use for the initial inference of the + * column data types of the imported table. Allowed values: "1". + * + * Generated from protobuf field map params = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParams() + { + return $this->params; + } + + /** + * Additional domain-specific parameters describing the semantic of the + * imported data, any string must be up to 25000 + * characters long. + * #### AutoML Tables + * `schema_inference_version` + * : (integer) This value must be supplied. + * The version of the + * algorithm to use for the initial inference of the + * column data types of the imported table. Allowed values: "1". + * + * Generated from protobuf field map params = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setParams($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->params = $arr; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsRequest.php new file mode 100644 index 000000000000..e769688ed858 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsRequest.php @@ -0,0 +1,215 @@ +google.cloud.automl.v1.ListDatasetsRequest + */ +class ListDatasetsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the project from which to list datasets. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * + * Generated from protobuf field string filter = 3; + */ + protected $filter = ''; + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous + * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call. + * + * Generated from protobuf field string page_token = 6; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The resource name of the project from which to list datasets. Please see + * {@see AutoMlClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\ListDatasetsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the project from which to list datasets. + * @type string $filter + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @type int $page_size + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @type string $page_token + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous + * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the project from which to list datasets. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the project from which to list datasets. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * + * Generated from protobuf field string filter = 3; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * + * Generated from protobuf field string filter = 3; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous + * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call. + * + * Generated from protobuf field string page_token = 6; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous + * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call. + * + * Generated from protobuf field string page_token = 6; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsResponse.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsResponse.php new file mode 100644 index 000000000000..f2d797616ee3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsResponse.php @@ -0,0 +1,105 @@ +google.cloud.automl.v1.ListDatasetsResponse + */ +class ListDatasetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The datasets read. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + private $datasets; + /** + * A token to retrieve next page of results. + * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AutoMl\V1\Dataset>|\Google\Protobuf\Internal\RepeatedField $datasets + * The datasets read. + * @type string $next_page_token + * A token to retrieve next page of results. + * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The datasets read. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Dataset datasets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatasets() + { + return $this->datasets; + } + + /** + * The datasets read. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Dataset datasets = 1; + * @param array<\Google\Cloud\AutoMl\V1\Dataset>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatasets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\Dataset::class); + $this->datasets = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsRequest.php new file mode 100644 index 000000000000..cd2ede27676c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsRequest.php @@ -0,0 +1,245 @@ +google.cloud.automl.v1.ListModelEvaluationsRequest + */ +class ListModelEvaluationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call. + * + * Generated from protobuf field string page_token = 6; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * @param string $filter Required. An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * + * @return \Google\Cloud\AutoMl\V1\ListModelEvaluationsRequest + * + * @experimental + */ + public static function build(string $parent, string $filter): self + { + return (new self()) + ->setParent($parent) + ->setFilter($filter); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @type string $filter + * Required. An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @type int $page_size + * Requested page size. + * @type string $page_token + * A token identifying a page of results for the server to return. + * Typically obtained via + * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call. + * + * Generated from protobuf field string page_token = 6; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call. + * + * Generated from protobuf field string page_token = 6; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsResponse.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsResponse.php new file mode 100644 index 000000000000..c1bfdafea3e1 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsResponse.php @@ -0,0 +1,109 @@ +google.cloud.automl.v1.ListModelEvaluationsResponse + */ +class ListModelEvaluationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of model evaluations in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + private $model_evaluation; + /** + * A token to retrieve next page of results. + * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AutoMl\V1\ModelEvaluation>|\Google\Protobuf\Internal\RepeatedField $model_evaluation + * List of model evaluations in the requested page. + * @type string $next_page_token + * A token to retrieve next page of results. + * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * List of model evaluations in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModelEvaluation() + { + return $this->model_evaluation; + } + + /** + * List of model evaluations in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + * @param array<\Google\Cloud\AutoMl\V1\ModelEvaluation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModelEvaluation($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\ModelEvaluation::class); + $this->model_evaluation = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsRequest.php new file mode 100644 index 000000000000..948b62bb0955 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsRequest.php @@ -0,0 +1,219 @@ +google.cloud.automl.v1.ListModelsRequest + */ +class ListModelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the project, from which to list the models. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * + * Generated from protobuf field string filter = 3; + */ + protected $filter = ''; + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous + * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call. + * + * Generated from protobuf field string page_token = 6; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Resource name of the project, from which to list the models. Please see + * {@see AutoMlClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\ListModelsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the project, from which to list the models. + * @type string $filter + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @type int $page_size + * Requested page size. + * @type string $page_token + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous + * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the project, from which to list the models. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource name of the project, from which to list the models. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * + * Generated from protobuf field string filter = 3; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * + * Generated from protobuf field string filter = 3; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous + * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call. + * + * Generated from protobuf field string page_token = 6; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous + * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call. + * + * Generated from protobuf field string page_token = 6; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsResponse.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsResponse.php new file mode 100644 index 000000000000..f59c0ca288d3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsResponse.php @@ -0,0 +1,105 @@ +google.cloud.automl.v1.ListModelsResponse + */ +class ListModelsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of models in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Model model = 1; + */ + private $model; + /** + * A token to retrieve next page of results. + * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AutoMl\V1\Model>|\Google\Protobuf\Internal\RepeatedField $model + * List of models in the requested page. + * @type string $next_page_token + * A token to retrieve next page of results. + * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * List of models in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Model model = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModel() + { + return $this->model; + } + + /** + * List of models in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Model model = 1; + * @param array<\Google\Cloud\AutoMl\V1\Model>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModel($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\Model::class); + $this->model = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model.php new file mode 100644 index 000000000000..0d84d2014398 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model.php @@ -0,0 +1,580 @@ +google.cloud.automl.v1.Model + */ +class Model extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Resource name of the model. + * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The name of the model to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. It must start with a letter. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Required. The resource ID of the dataset used to create the model. The dataset must + * come from the same ancestor project and location. + * + * Generated from protobuf field string dataset_id = 3; + */ + protected $dataset_id = ''; + /** + * Output only. Timestamp when the model training finished and can be used for prediction. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + */ + protected $create_time = null; + /** + * Output only. Timestamp when this model was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; + */ + protected $update_time = null; + /** + * Output only. Deployment state of the model. A model can only serve + * prediction requests after it gets deployed. + * + * Generated from protobuf field .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + */ + protected $deployment_state = 0; + /** + * Used to perform a consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 10; + */ + protected $etag = ''; + /** + * Optional. The labels with user-defined metadata to organize your model. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 34; + */ + private $labels; + protected $model_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TranslationModelMetadata $translation_model_metadata + * Metadata for translation models. + * @type \Google\Cloud\AutoMl\V1\ImageClassificationModelMetadata $image_classification_model_metadata + * Metadata for image classification models. + * @type \Google\Cloud\AutoMl\V1\TextClassificationModelMetadata $text_classification_model_metadata + * Metadata for text classification models. + * @type \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelMetadata $image_object_detection_model_metadata + * Metadata for image object detection models. + * @type \Google\Cloud\AutoMl\V1\TextExtractionModelMetadata $text_extraction_model_metadata + * Metadata for text extraction models. + * @type \Google\Cloud\AutoMl\V1\TextSentimentModelMetadata $text_sentiment_model_metadata + * Metadata for text sentiment models. + * @type string $name + * Output only. Resource name of the model. + * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + * @type string $display_name + * Required. The name of the model to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. It must start with a letter. + * @type string $dataset_id + * Required. The resource ID of the dataset used to create the model. The dataset must + * come from the same ancestor project and location. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when the model training finished and can be used for prediction. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp when this model was last updated. + * @type int $deployment_state + * Output only. Deployment state of the model. A model can only serve + * prediction requests after it gets deployed. + * @type string $etag + * Used to perform a consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels with user-defined metadata to organize your model. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Model::initOnce(); + parent::__construct($data); + } + + /** + * Metadata for translation models. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * @return \Google\Cloud\AutoMl\V1\TranslationModelMetadata|null + */ + public function getTranslationModelMetadata() + { + return $this->readOneof(15); + } + + public function hasTranslationModelMetadata() + { + return $this->hasOneof(15); + } + + /** + * Metadata for translation models. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * @param \Google\Cloud\AutoMl\V1\TranslationModelMetadata $var + * @return $this + */ + public function setTranslationModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TranslationModelMetadata::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Metadata for image classification models. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * @return \Google\Cloud\AutoMl\V1\ImageClassificationModelMetadata|null + */ + public function getImageClassificationModelMetadata() + { + return $this->readOneof(13); + } + + public function hasImageClassificationModelMetadata() + { + return $this->hasOneof(13); + } + + /** + * Metadata for image classification models. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * @param \Google\Cloud\AutoMl\V1\ImageClassificationModelMetadata $var + * @return $this + */ + public function setImageClassificationModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageClassificationModelMetadata::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Metadata for text classification models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * @return \Google\Cloud\AutoMl\V1\TextClassificationModelMetadata|null + */ + public function getTextClassificationModelMetadata() + { + return $this->readOneof(14); + } + + public function hasTextClassificationModelMetadata() + { + return $this->hasOneof(14); + } + + /** + * Metadata for text classification models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * @param \Google\Cloud\AutoMl\V1\TextClassificationModelMetadata $var + * @return $this + */ + public function setTextClassificationModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextClassificationModelMetadata::class); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * Metadata for image object detection models. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * @return \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelMetadata|null + */ + public function getImageObjectDetectionModelMetadata() + { + return $this->readOneof(20); + } + + public function hasImageObjectDetectionModelMetadata() + { + return $this->hasOneof(20); + } + + /** + * Metadata for image object detection models. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * @param \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelMetadata $var + * @return $this + */ + public function setImageObjectDetectionModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelMetadata::class); + $this->writeOneof(20, $var); + + return $this; + } + + /** + * Metadata for text extraction models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * @return \Google\Cloud\AutoMl\V1\TextExtractionModelMetadata|null + */ + public function getTextExtractionModelMetadata() + { + return $this->readOneof(19); + } + + public function hasTextExtractionModelMetadata() + { + return $this->hasOneof(19); + } + + /** + * Metadata for text extraction models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * @param \Google\Cloud\AutoMl\V1\TextExtractionModelMetadata $var + * @return $this + */ + public function setTextExtractionModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextExtractionModelMetadata::class); + $this->writeOneof(19, $var); + + return $this; + } + + /** + * Metadata for text sentiment models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; + * @return \Google\Cloud\AutoMl\V1\TextSentimentModelMetadata|null + */ + public function getTextSentimentModelMetadata() + { + return $this->readOneof(22); + } + + public function hasTextSentimentModelMetadata() + { + return $this->hasOneof(22); + } + + /** + * Metadata for text sentiment models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; + * @param \Google\Cloud\AutoMl\V1\TextSentimentModelMetadata $var + * @return $this + */ + public function setTextSentimentModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSentimentModelMetadata::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * Output only. Resource name of the model. + * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Resource name of the model. + * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of the model to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. It must start with a letter. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the model to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. It must start with a letter. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. The resource ID of the dataset used to create the model. The dataset must + * come from the same ancestor project and location. + * + * Generated from protobuf field string dataset_id = 3; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * Required. The resource ID of the dataset used to create the model. The dataset must + * come from the same ancestor project and location. + * + * Generated from protobuf field string dataset_id = 3; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * Output only. Timestamp when the model training finished and can be used for prediction. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Timestamp when the model training finished and can be used for prediction. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Timestamp when this model was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Timestamp when this model was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Deployment state of the model. A model can only serve + * prediction requests after it gets deployed. + * + * Generated from protobuf field .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + * @return int + */ + public function getDeploymentState() + { + return $this->deployment_state; + } + + /** + * Output only. Deployment state of the model. A model can only serve + * prediction requests after it gets deployed. + * + * Generated from protobuf field .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + * @param int $var + * @return $this + */ + public function setDeploymentState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\Model\DeploymentState::class); + $this->deployment_state = $var; + + return $this; + } + + /** + * Used to perform a consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 10; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Used to perform a consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 10; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. The labels with user-defined metadata to organize your model. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 34; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels with user-defined metadata to organize your model. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 34; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * @return string + */ + public function getModelMetadata() + { + return $this->whichOneof("model_metadata"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model/DeploymentState.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model/DeploymentState.php new file mode 100644 index 000000000000..717194cacb0f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model/DeploymentState.php @@ -0,0 +1,64 @@ +google.cloud.automl.v1.Model.DeploymentState + */ +class DeploymentState +{ + /** + * Should not be used, an un-set enum has this value by default. + * + * Generated from protobuf enum DEPLOYMENT_STATE_UNSPECIFIED = 0; + */ + const DEPLOYMENT_STATE_UNSPECIFIED = 0; + /** + * Model is deployed. + * + * Generated from protobuf enum DEPLOYED = 1; + */ + const DEPLOYED = 1; + /** + * Model is not deployed. + * + * Generated from protobuf enum UNDEPLOYED = 2; + */ + const UNDEPLOYED = 2; + + private static $valueToName = [ + self::DEPLOYMENT_STATE_UNSPECIFIED => 'DEPLOYMENT_STATE_UNSPECIFIED', + self::DEPLOYED => 'DEPLOYED', + self::UNDEPLOYED => 'UNDEPLOYED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DeploymentState::class, \Google\Cloud\AutoMl\V1\Model_DeploymentState::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelEvaluation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelEvaluation.php new file mode 100644 index 000000000000..bbe35143df37 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelEvaluation.php @@ -0,0 +1,496 @@ +google.cloud.automl.v1.ModelEvaluation + */ +class ModelEvaluation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Resource name of the model evaluation. + * Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The ID of the annotation spec that the model evaluation applies to. The + * The ID is empty for the overall model evaluation. + * For Tables annotation specs in the dataset do not exist and this ID is + * always not set, but for CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * the + * [display_name][google.cloud.automl.v1.ModelEvaluation.display_name] + * field is used. + * + * Generated from protobuf field string annotation_spec_id = 2; + */ + protected $annotation_spec_id = ''; + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * at the moment when the model was trained. Because this field returns a + * value at model training time, for different models trained from the same + * dataset, the values may differ, since display names could had been changed + * between the two model's trainings. For Tables CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * distinct values of the target column at the moment of the model evaluation + * are populated here. + * The display_name is empty for the overall model evaluation. + * + * Generated from protobuf field string display_name = 15; + */ + protected $display_name = ''; + /** + * Output only. Timestamp when this model evaluation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + */ + protected $create_time = null; + /** + * Output only. The number of examples used for model evaluation, i.e. for + * which ground truth from time of model creation is compared against the + * predicted annotations created by the model. + * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + * the total number of all examples used for evaluation. + * Otherwise, this is the count of examples that according to the ground + * truth were annotated by the + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. + * + * Generated from protobuf field int32 evaluated_example_count = 6; + */ + protected $evaluated_example_count = 0; + protected $metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics $classification_evaluation_metrics + * Model evaluation metrics for image, text, video and tables + * classification. + * Tables problem is considered a classification when the target column + * is CATEGORY DataType. + * @type \Google\Cloud\AutoMl\V1\TranslationEvaluationMetrics $translation_evaluation_metrics + * Model evaluation metrics for translation. + * @type \Google\Cloud\AutoMl\V1\ImageObjectDetectionEvaluationMetrics $image_object_detection_evaluation_metrics + * Model evaluation metrics for image object detection. + * @type \Google\Cloud\AutoMl\V1\TextSentimentEvaluationMetrics $text_sentiment_evaluation_metrics + * Evaluation metrics for text sentiment models. + * @type \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics $text_extraction_evaluation_metrics + * Evaluation metrics for text extraction models. + * @type string $name + * Output only. Resource name of the model evaluation. + * Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + * @type string $annotation_spec_id + * Output only. The ID of the annotation spec that the model evaluation applies to. The + * The ID is empty for the overall model evaluation. + * For Tables annotation specs in the dataset do not exist and this ID is + * always not set, but for CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * the + * [display_name][google.cloud.automl.v1.ModelEvaluation.display_name] + * field is used. + * @type string $display_name + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * at the moment when the model was trained. Because this field returns a + * value at model training time, for different models trained from the same + * dataset, the values may differ, since display names could had been changed + * between the two model's trainings. For Tables CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * distinct values of the target column at the moment of the model evaluation + * are populated here. + * The display_name is empty for the overall model evaluation. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when this model evaluation was created. + * @type int $evaluated_example_count + * Output only. The number of examples used for model evaluation, i.e. for + * which ground truth from time of model creation is compared against the + * predicted annotations created by the model. + * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + * the total number of all examples used for evaluation. + * Otherwise, this is the count of examples that according to the ground + * truth were annotated by the + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\ModelEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Model evaluation metrics for image, text, video and tables + * classification. + * Tables problem is considered a classification when the target column + * is CATEGORY DataType. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * @return \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics|null + */ + public function getClassificationEvaluationMetrics() + { + return $this->readOneof(8); + } + + public function hasClassificationEvaluationMetrics() + { + return $this->hasOneof(8); + } + + /** + * Model evaluation metrics for image, text, video and tables + * classification. + * Tables problem is considered a classification when the target column + * is CATEGORY DataType. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * @param \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics $var + * @return $this + */ + public function setClassificationEvaluationMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Model evaluation metrics for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * @return \Google\Cloud\AutoMl\V1\TranslationEvaluationMetrics|null + */ + public function getTranslationEvaluationMetrics() + { + return $this->readOneof(9); + } + + public function hasTranslationEvaluationMetrics() + { + return $this->hasOneof(9); + } + + /** + * Model evaluation metrics for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * @param \Google\Cloud\AutoMl\V1\TranslationEvaluationMetrics $var + * @return $this + */ + public function setTranslationEvaluationMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TranslationEvaluationMetrics::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Model evaluation metrics for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * @return \Google\Cloud\AutoMl\V1\ImageObjectDetectionEvaluationMetrics|null + */ + public function getImageObjectDetectionEvaluationMetrics() + { + return $this->readOneof(12); + } + + public function hasImageObjectDetectionEvaluationMetrics() + { + return $this->hasOneof(12); + } + + /** + * Model evaluation metrics for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * @param \Google\Cloud\AutoMl\V1\ImageObjectDetectionEvaluationMetrics $var + * @return $this + */ + public function setImageObjectDetectionEvaluationMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageObjectDetectionEvaluationMetrics::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Evaluation metrics for text sentiment models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * @return \Google\Cloud\AutoMl\V1\TextSentimentEvaluationMetrics|null + */ + public function getTextSentimentEvaluationMetrics() + { + return $this->readOneof(11); + } + + public function hasTextSentimentEvaluationMetrics() + { + return $this->hasOneof(11); + } + + /** + * Evaluation metrics for text sentiment models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * @param \Google\Cloud\AutoMl\V1\TextSentimentEvaluationMetrics $var + * @return $this + */ + public function setTextSentimentEvaluationMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSentimentEvaluationMetrics::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Evaluation metrics for text extraction models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + * @return \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics|null + */ + public function getTextExtractionEvaluationMetrics() + { + return $this->readOneof(13); + } + + public function hasTextExtractionEvaluationMetrics() + { + return $this->hasOneof(13); + } + + /** + * Evaluation metrics for text extraction models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + * @param \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics $var + * @return $this + */ + public function setTextExtractionEvaluationMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Output only. Resource name of the model evaluation. + * Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Resource name of the model evaluation. + * Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The ID of the annotation spec that the model evaluation applies to. The + * The ID is empty for the overall model evaluation. + * For Tables annotation specs in the dataset do not exist and this ID is + * always not set, but for CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * the + * [display_name][google.cloud.automl.v1.ModelEvaluation.display_name] + * field is used. + * + * Generated from protobuf field string annotation_spec_id = 2; + * @return string + */ + public function getAnnotationSpecId() + { + return $this->annotation_spec_id; + } + + /** + * Output only. The ID of the annotation spec that the model evaluation applies to. The + * The ID is empty for the overall model evaluation. + * For Tables annotation specs in the dataset do not exist and this ID is + * always not set, but for CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * the + * [display_name][google.cloud.automl.v1.ModelEvaluation.display_name] + * field is used. + * + * Generated from protobuf field string annotation_spec_id = 2; + * @param string $var + * @return $this + */ + public function setAnnotationSpecId($var) + { + GPBUtil::checkString($var, True); + $this->annotation_spec_id = $var; + + return $this; + } + + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * at the moment when the model was trained. Because this field returns a + * value at model training time, for different models trained from the same + * dataset, the values may differ, since display names could had been changed + * between the two model's trainings. For Tables CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * distinct values of the target column at the moment of the model evaluation + * are populated here. + * The display_name is empty for the overall model evaluation. + * + * Generated from protobuf field string display_name = 15; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * at the moment when the model was trained. Because this field returns a + * value at model training time, for different models trained from the same + * dataset, the values may differ, since display names could had been changed + * between the two model's trainings. For Tables CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * distinct values of the target column at the moment of the model evaluation + * are populated here. + * The display_name is empty for the overall model evaluation. + * + * Generated from protobuf field string display_name = 15; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Timestamp when this model evaluation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Timestamp when this model evaluation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The number of examples used for model evaluation, i.e. for + * which ground truth from time of model creation is compared against the + * predicted annotations created by the model. + * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + * the total number of all examples used for evaluation. + * Otherwise, this is the count of examples that according to the ground + * truth were annotated by the + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. + * + * Generated from protobuf field int32 evaluated_example_count = 6; + * @return int + */ + public function getEvaluatedExampleCount() + { + return $this->evaluated_example_count; + } + + /** + * Output only. The number of examples used for model evaluation, i.e. for + * which ground truth from time of model creation is compared against the + * predicted annotations created by the model. + * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + * the total number of all examples used for evaluation. + * Otherwise, this is the count of examples that according to the ground + * truth were annotated by the + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. + * + * Generated from protobuf field int32 evaluated_example_count = 6; + * @param int $var + * @return $this + */ + public function setEvaluatedExampleCount($var) + { + GPBUtil::checkInt32($var); + $this->evaluated_example_count = $var; + + return $this; + } + + /** + * @return string + */ + public function getMetrics() + { + return $this->whichOneof("metrics"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelExportOutputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelExportOutputConfig.php new file mode 100644 index 000000000000..47df2eba0472 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelExportOutputConfig.php @@ -0,0 +1,291 @@ +google.cloud.automl.v1.ModelExportOutputConfig + */ +class ModelExportOutputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The format in which the model must be exported. The available, and default, + * formats depend on the problem and model type (if given problem and type + * combination doesn't have a format listed, it means its models are not + * exportable): + * * For Image Classification mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + * "docker". + * * For Image Classification mobile-core-ml-low-latency-1, + * mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + * "core_ml" (default). + * * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite", "tf_saved_model", "tf_js". + * Formats description: + * * tflite - Used for Android mobile devices. + * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + * devices. + * * tf_saved_model - A tensorflow model in SavedModel format. + * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + * be used in the browser and in Node.js using JavaScript. + * * docker - Used for Docker containers. Use the params field to customize + * the container. The container is verified to work correctly on + * ubuntu 16.04 operating system. See more at + * [containers + * quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + * * core_ml - Used for iOS mobile devices. + * + * Generated from protobuf field string model_format = 4; + */ + protected $model_format = ''; + /** + * Additional model-type and format specific parameters describing the + * requirements for the to be exported model files, any string must be up to + * 25000 characters long. + * * For `docker` format: + * `cpu_architecture` - (string) "x86_64" (default). + * `gpu_architecture` - (string) "none" (default), "nvidia". + * + * Generated from protobuf field map params = 2; + */ + private $params; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsDestination $gcs_destination + * Required. The Google Cloud Storage location where the model is to be + * written to. This location may only be set for the following model + * formats: + * "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + * Under the directory given as the destination a new one with name + * "model-export--", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + * will be created. Inside the model and any of its supporting files + * will be written. + * @type string $model_format + * The format in which the model must be exported. The available, and default, + * formats depend on the problem and model type (if given problem and type + * combination doesn't have a format listed, it means its models are not + * exportable): + * * For Image Classification mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + * "docker". + * * For Image Classification mobile-core-ml-low-latency-1, + * mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + * "core_ml" (default). + * * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite", "tf_saved_model", "tf_js". + * Formats description: + * * tflite - Used for Android mobile devices. + * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + * devices. + * * tf_saved_model - A tensorflow model in SavedModel format. + * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + * be used in the browser and in Node.js using JavaScript. + * * docker - Used for Docker containers. Use the params field to customize + * the container. The container is verified to work correctly on + * ubuntu 16.04 operating system. See more at + * [containers + * quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + * * core_ml - Used for iOS mobile devices. + * @type array|\Google\Protobuf\Internal\MapField $params + * Additional model-type and format specific parameters describing the + * requirements for the to be exported model files, any string must be up to + * 25000 characters long. + * * For `docker` format: + * `cpu_architecture` - (string) "x86_64" (default). + * `gpu_architecture` - (string) "none" (default), "nvidia". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Google Cloud Storage location where the model is to be + * written to. This location may only be set for the following model + * formats: + * "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + * Under the directory given as the destination a new one with name + * "model-export--", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + * will be created. Inside the model and any of its supporting files + * will be written. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * Required. The Google Cloud Storage location where the model is to be + * written to. This location may only be set for the following model + * formats: + * "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + * Under the directory given as the destination a new one with name + * "model-export--", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + * will be created. Inside the model and any of its supporting files + * will be written. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The format in which the model must be exported. The available, and default, + * formats depend on the problem and model type (if given problem and type + * combination doesn't have a format listed, it means its models are not + * exportable): + * * For Image Classification mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + * "docker". + * * For Image Classification mobile-core-ml-low-latency-1, + * mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + * "core_ml" (default). + * * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite", "tf_saved_model", "tf_js". + * Formats description: + * * tflite - Used for Android mobile devices. + * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + * devices. + * * tf_saved_model - A tensorflow model in SavedModel format. + * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + * be used in the browser and in Node.js using JavaScript. + * * docker - Used for Docker containers. Use the params field to customize + * the container. The container is verified to work correctly on + * ubuntu 16.04 operating system. See more at + * [containers + * quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + * * core_ml - Used for iOS mobile devices. + * + * Generated from protobuf field string model_format = 4; + * @return string + */ + public function getModelFormat() + { + return $this->model_format; + } + + /** + * The format in which the model must be exported. The available, and default, + * formats depend on the problem and model type (if given problem and type + * combination doesn't have a format listed, it means its models are not + * exportable): + * * For Image Classification mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + * "docker". + * * For Image Classification mobile-core-ml-low-latency-1, + * mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + * "core_ml" (default). + * * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite", "tf_saved_model", "tf_js". + * Formats description: + * * tflite - Used for Android mobile devices. + * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + * devices. + * * tf_saved_model - A tensorflow model in SavedModel format. + * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + * be used in the browser and in Node.js using JavaScript. + * * docker - Used for Docker containers. Use the params field to customize + * the container. The container is verified to work correctly on + * ubuntu 16.04 operating system. See more at + * [containers + * quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + * * core_ml - Used for iOS mobile devices. + * + * Generated from protobuf field string model_format = 4; + * @param string $var + * @return $this + */ + public function setModelFormat($var) + { + GPBUtil::checkString($var, True); + $this->model_format = $var; + + return $this; + } + + /** + * Additional model-type and format specific parameters describing the + * requirements for the to be exported model files, any string must be up to + * 25000 characters long. + * * For `docker` format: + * `cpu_architecture` - (string) "x86_64" (default). + * `gpu_architecture` - (string) "none" (default), "nvidia". + * + * Generated from protobuf field map params = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParams() + { + return $this->params; + } + + /** + * Additional model-type and format specific parameters describing the + * requirements for the to be exported model files, any string must be up to + * 25000 characters long. + * * For `docker` format: + * `cpu_architecture` - (string) "x86_64" (default). + * `gpu_architecture` - (string) "none" (default), "nvidia". + * + * Generated from protobuf field map params = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setParams($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->params = $arr; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/NormalizedVertex.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/NormalizedVertex.php new file mode 100644 index 000000000000..f32853bc25e8 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/NormalizedVertex.php @@ -0,0 +1,105 @@ +google.cloud.automl.v1.NormalizedVertex + */ +class NormalizedVertex extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Horizontal coordinate. + * + * Generated from protobuf field float x = 1; + */ + protected $x = 0.0; + /** + * Required. Vertical coordinate. + * + * Generated from protobuf field float y = 2; + */ + protected $y = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $x + * Required. Horizontal coordinate. + * @type float $y + * Required. Vertical coordinate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Geometry::initOnce(); + parent::__construct($data); + } + + /** + * Required. Horizontal coordinate. + * + * Generated from protobuf field float x = 1; + * @return float + */ + public function getX() + { + return $this->x; + } + + /** + * Required. Horizontal coordinate. + * + * Generated from protobuf field float x = 1; + * @param float $var + * @return $this + */ + public function setX($var) + { + GPBUtil::checkFloat($var); + $this->x = $var; + + return $this; + } + + /** + * Required. Vertical coordinate. + * + * Generated from protobuf field float y = 2; + * @return float + */ + public function getY() + { + return $this->y; + } + + /** + * Required. Vertical coordinate. + * + * Generated from protobuf field float y = 2; + * @param float $var + * @return $this + */ + public function setY($var) + { + GPBUtil::checkFloat($var); + $this->y = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OperationMetadata.php new file mode 100644 index 000000000000..e6b98b84fc49 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OperationMetadata.php @@ -0,0 +1,511 @@ +google.cloud.automl.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Progress of operation. Range: [0, 100]. + * Not used currently. + * + * Generated from protobuf field int32 progress_percent = 13; + */ + protected $progress_percent = 0; + /** + * Output only. Partial failures encountered. + * E.g. single files that couldn't be read. + * This field should never exceed 20 entries. + * Status details field will contain standard GCP error details. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + */ + private $partial_failures; + /** + * Output only. Time when the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + /** + * Output only. Time when the operation was updated for the last time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + protected $update_time = null; + protected $details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\DeleteOperationMetadata $delete_details + * Details of a Delete operation. + * @type \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata $deploy_model_details + * Details of a DeployModel operation. + * @type \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata $undeploy_model_details + * Details of an UndeployModel operation. + * @type \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata $create_model_details + * Details of CreateModel operation. + * @type \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata $create_dataset_details + * Details of CreateDataset operation. + * @type \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata $import_data_details + * Details of ImportData operation. + * @type \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata $batch_predict_details + * Details of BatchPredict operation. + * @type \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata $export_data_details + * Details of ExportData operation. + * @type \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata $export_model_details + * Details of ExportModel operation. + * @type int $progress_percent + * Output only. Progress of operation. Range: [0, 100]. + * Not used currently. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $partial_failures + * Output only. Partial failures encountered. + * E.g. single files that couldn't be read. + * This field should never exceed 20 entries. + * Status details field will contain standard GCP error details. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time when the operation was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Time when the operation was updated for the last time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * Details of a Delete operation. + * + * Generated from protobuf field .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + * @return \Google\Cloud\AutoMl\V1\DeleteOperationMetadata|null + */ + public function getDeleteDetails() + { + return $this->readOneof(8); + } + + public function hasDeleteDetails() + { + return $this->hasOneof(8); + } + + /** + * Details of a Delete operation. + * + * Generated from protobuf field .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + * @param \Google\Cloud\AutoMl\V1\DeleteOperationMetadata $var + * @return $this + */ + public function setDeleteDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\DeleteOperationMetadata::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Details of a DeployModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; + * @return \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata|null + */ + public function getDeployModelDetails() + { + return $this->readOneof(24); + } + + public function hasDeployModelDetails() + { + return $this->hasOneof(24); + } + + /** + * Details of a DeployModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; + * @param \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata $var + * @return $this + */ + public function setDeployModelDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata::class); + $this->writeOneof(24, $var); + + return $this; + } + + /** + * Details of an UndeployModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * @return \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata|null + */ + public function getUndeployModelDetails() + { + return $this->readOneof(25); + } + + public function hasUndeployModelDetails() + { + return $this->hasOneof(25); + } + + /** + * Details of an UndeployModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * @param \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata $var + * @return $this + */ + public function setUndeployModelDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata::class); + $this->writeOneof(25, $var); + + return $this; + } + + /** + * Details of CreateModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * @return \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata|null + */ + public function getCreateModelDetails() + { + return $this->readOneof(10); + } + + public function hasCreateModelDetails() + { + return $this->hasOneof(10); + } + + /** + * Details of CreateModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * @param \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata $var + * @return $this + */ + public function setCreateModelDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Details of CreateDataset operation. + * + * Generated from protobuf field .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * @return \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata|null + */ + public function getCreateDatasetDetails() + { + return $this->readOneof(30); + } + + public function hasCreateDatasetDetails() + { + return $this->hasOneof(30); + } + + /** + * Details of CreateDataset operation. + * + * Generated from protobuf field .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * @param \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata $var + * @return $this + */ + public function setCreateDatasetDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata::class); + $this->writeOneof(30, $var); + + return $this; + } + + /** + * Details of ImportData operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + * @return \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata|null + */ + public function getImportDataDetails() + { + return $this->readOneof(15); + } + + public function hasImportDataDetails() + { + return $this->hasOneof(15); + } + + /** + * Details of ImportData operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + * @param \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata $var + * @return $this + */ + public function setImportDataDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Details of BatchPredict operation. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * @return \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata|null + */ + public function getBatchPredictDetails() + { + return $this->readOneof(16); + } + + public function hasBatchPredictDetails() + { + return $this->hasOneof(16); + } + + /** + * Details of BatchPredict operation. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * @param \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata $var + * @return $this + */ + public function setBatchPredictDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Details of ExportData operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + * @return \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata|null + */ + public function getExportDataDetails() + { + return $this->readOneof(21); + } + + public function hasExportDataDetails() + { + return $this->hasOneof(21); + } + + /** + * Details of ExportData operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + * @param \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata $var + * @return $this + */ + public function setExportDataDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata::class); + $this->writeOneof(21, $var); + + return $this; + } + + /** + * Details of ExportModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + * @return \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata|null + */ + public function getExportModelDetails() + { + return $this->readOneof(22); + } + + public function hasExportModelDetails() + { + return $this->hasOneof(22); + } + + /** + * Details of ExportModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + * @param \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata $var + * @return $this + */ + public function setExportModelDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * Output only. Progress of operation. Range: [0, 100]. + * Not used currently. + * + * Generated from protobuf field int32 progress_percent = 13; + * @return int + */ + public function getProgressPercent() + { + return $this->progress_percent; + } + + /** + * Output only. Progress of operation. Range: [0, 100]. + * Not used currently. + * + * Generated from protobuf field int32 progress_percent = 13; + * @param int $var + * @return $this + */ + public function setProgressPercent($var) + { + GPBUtil::checkInt32($var); + $this->progress_percent = $var; + + return $this; + } + + /** + * Output only. Partial failures encountered. + * E.g. single files that couldn't be read. + * This field should never exceed 20 entries. + * Status details field will contain standard GCP error details. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPartialFailures() + { + return $this->partial_failures; + } + + /** + * Output only. Partial failures encountered. + * E.g. single files that couldn't be read. + * This field should never exceed 20 entries. + * Status details field will contain standard GCP error details. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPartialFailures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->partial_failures = $arr; + + return $this; + } + + /** + * Output only. Time when the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Time when the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Time when the operation was updated for the last time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Time when the operation was updated for the last time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getDetails() + { + return $this->whichOneof("details"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OutputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OutputConfig.php new file mode 100644 index 000000000000..72789ddf8aad --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OutputConfig.php @@ -0,0 +1,119 @@ +_` + * where will be made + * BigQuery-dataset-name compatible (e.g. most special characters will + * become underscores), and timestamp will be in + * YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that + * dataset a new table called `primary_table` will be created, and + * filled with precisely the same data as this obtained on import. + * + * Generated from protobuf message google.cloud.automl.v1.OutputConfig + */ +class OutputConfig extends \Google\Protobuf\Internal\Message +{ + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsDestination $gcs_destination + * Required. The Google Cloud Storage location where the output is to be + * written to. For Image Object Detection, Text Extraction, Video + * Classification and Tables, in the given directory a new directory will be + * created with name: + * export_data-- where + * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + * output will be written into that directory. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Google Cloud Storage location where the output is to be + * written to. For Image Object Detection, Text Extraction, Video + * Classification and Tables, in the given directory a new directory will be + * created with name: + * export_data-- where + * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + * output will be written into that directory. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * Required. The Google Cloud Storage location where the output is to be + * written to. For Image Object Detection, Text Extraction, Video + * Classification and Tables, in the given directory a new directory will be + * created with name: + * export_data-- where + * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + * output will be written into that directory. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictRequest.php new file mode 100644 index 000000000000..fe8b74d90ec0 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictRequest.php @@ -0,0 +1,285 @@ +google.cloud.automl.v1.PredictRequest + */ +class PredictRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the model requested to serve the prediction. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $payload = null; + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * AutoML Tables + * `feature_importance` + * : (boolean) Whether + * [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + * is populated in the returned list of + * [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + * objects. The default is false. + * + * Generated from protobuf field map params = 3; + */ + private $params; + + /** + * @param string $name Required. Name of the model requested to serve the prediction. Please see + * {@see PredictionServiceClient::modelName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\ExamplePayload $payload Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * @param array $params Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * + * AutoML Vision Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * + * AutoML Vision Object Detection + * + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * + * AutoML Tables + * + * `feature_importance` + * : (boolean) Whether + * [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + * is populated in the returned list of + * [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + * objects. The default is false. + * + * @return \Google\Cloud\AutoMl\V1\PredictRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\AutoMl\V1\ExamplePayload $payload, array $params): self + { + return (new self()) + ->setName($name) + ->setPayload($payload) + ->setParams($params); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the model requested to serve the prediction. + * @type \Google\Cloud\AutoMl\V1\ExamplePayload $payload + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * @type array|\Google\Protobuf\Internal\MapField $params + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * AutoML Tables + * `feature_importance` + * : (boolean) Whether + * [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + * is populated in the returned list of + * [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + * objects. The default is false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the model requested to serve the prediction. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the model requested to serve the prediction. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\ExamplePayload|null + */ + public function getPayload() + { + return $this->payload; + } + + public function hasPayload() + { + return isset($this->payload); + } + + public function clearPayload() + { + unset($this->payload); + } + + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\ExamplePayload $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExamplePayload::class); + $this->payload = $var; + + return $this; + } + + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * AutoML Tables + * `feature_importance` + * : (boolean) Whether + * [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + * is populated in the returned list of + * [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + * objects. The default is false. + * + * Generated from protobuf field map params = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParams() + { + return $this->params; + } + + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * AutoML Tables + * `feature_importance` + * : (boolean) Whether + * [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + * is populated in the returned list of + * [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + * objects. The default is false. + * + * Generated from protobuf field map params = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setParams($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->params = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictResponse.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictResponse.php new file mode 100644 index 000000000000..e87737cc5e77 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictResponse.php @@ -0,0 +1,229 @@ +google.cloud.automl.v1.PredictResponse + */ +class PredictResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Prediction result. + * AutoML Translation and AutoML Natural Language Sentiment Analysis + * return precisely one payload. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + private $payload; + /** + * The preprocessed example that AutoML actually makes prediction on. + * Empty if AutoML does not preprocess the input example. + * For AutoML Natural Language (Classification, Entity Extraction, and + * Sentiment Analysis), if the input is a document, the recognized text is + * returned in the + * [document_text][google.cloud.automl.v1.Document.document_text] + * property. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + protected $preprocessed_input = null; + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes to return per image. + * AutoML Natural Language Sentiment Analysis + * `sentiment_score` + * : (float, deprecated) A value between -1 and 1, + * -1 maps to least positive sentiment, while 1 maps to the most positive + * one and the higher the score, the more positive the sentiment in the + * document is. Yet these values are relative to the training data, so + * e.g. if all data was positive then -1 is also positive (though + * the least). + * `sentiment_score` is not the same as "score" and "magnitude" + * from Sentiment Analysis in the Natural Language API. + * + * Generated from protobuf field map metadata = 2; + */ + private $metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AutoMl\V1\AnnotationPayload>|\Google\Protobuf\Internal\RepeatedField $payload + * Prediction result. + * AutoML Translation and AutoML Natural Language Sentiment Analysis + * return precisely one payload. + * @type \Google\Cloud\AutoMl\V1\ExamplePayload $preprocessed_input + * The preprocessed example that AutoML actually makes prediction on. + * Empty if AutoML does not preprocess the input example. + * For AutoML Natural Language (Classification, Entity Extraction, and + * Sentiment Analysis), if the input is a document, the recognized text is + * returned in the + * [document_text][google.cloud.automl.v1.Document.document_text] + * property. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes to return per image. + * AutoML Natural Language Sentiment Analysis + * `sentiment_score` + * : (float, deprecated) A value between -1 and 1, + * -1 maps to least positive sentiment, while 1 maps to the most positive + * one and the higher the score, the more positive the sentiment in the + * document is. Yet these values are relative to the training data, so + * e.g. if all data was positive then -1 is also positive (though + * the least). + * `sentiment_score` is not the same as "score" and "magnitude" + * from Sentiment Analysis in the Natural Language API. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * Prediction result. + * AutoML Translation and AutoML Natural Language Sentiment Analysis + * return precisely one payload. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPayload() + { + return $this->payload; + } + + /** + * Prediction result. + * AutoML Translation and AutoML Natural Language Sentiment Analysis + * return precisely one payload. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + * @param array<\Google\Cloud\AutoMl\V1\AnnotationPayload>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPayload($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\AnnotationPayload::class); + $this->payload = $arr; + + return $this; + } + + /** + * The preprocessed example that AutoML actually makes prediction on. + * Empty if AutoML does not preprocess the input example. + * For AutoML Natural Language (Classification, Entity Extraction, and + * Sentiment Analysis), if the input is a document, the recognized text is + * returned in the + * [document_text][google.cloud.automl.v1.Document.document_text] + * property. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + * @return \Google\Cloud\AutoMl\V1\ExamplePayload|null + */ + public function getPreprocessedInput() + { + return $this->preprocessed_input; + } + + public function hasPreprocessedInput() + { + return isset($this->preprocessed_input); + } + + public function clearPreprocessedInput() + { + unset($this->preprocessed_input); + } + + /** + * The preprocessed example that AutoML actually makes prediction on. + * Empty if AutoML does not preprocess the input example. + * For AutoML Natural Language (Classification, Entity Extraction, and + * Sentiment Analysis), if the input is a document, the recognized text is + * returned in the + * [document_text][google.cloud.automl.v1.Document.document_text] + * property. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + * @param \Google\Cloud\AutoMl\V1\ExamplePayload $var + * @return $this + */ + public function setPreprocessedInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExamplePayload::class); + $this->preprocessed_input = $var; + + return $this; + } + + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes to return per image. + * AutoML Natural Language Sentiment Analysis + * `sentiment_score` + * : (float, deprecated) A value between -1 and 1, + * -1 maps to least positive sentiment, while 1 maps to the most positive + * one and the higher the score, the more positive the sentiment in the + * document is. Yet these values are relative to the training data, so + * e.g. if all data was positive then -1 is also positive (though + * the least). + * `sentiment_score` is not the same as "score" and "magnitude" + * from Sentiment Analysis in the Natural Language API. + * + * Generated from protobuf field map metadata = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes to return per image. + * AutoML Natural Language Sentiment Analysis + * `sentiment_score` + * : (float, deprecated) A value between -1 and 1, + * -1 maps to least positive sentiment, while 1 maps to the most positive + * one and the higher the score, the more positive the sentiment in the + * document is. Yet these values are relative to the training data, so + * e.g. if all data was positive then -1 is also positive (though + * the least). + * `sentiment_score` is not the same as "score" and "magnitude" + * from Sentiment Analysis in the Natural Language API. + * + * Generated from protobuf field map metadata = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationDatasetMetadata.php new file mode 100644 index 000000000000..d174bc8d04a8 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationDatasetMetadata.php @@ -0,0 +1,67 @@ +google.cloud.automl.v1.TextClassificationDatasetMetadata + */ +class TextClassificationDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + protected $classification_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $classification_type + * Required. Type of the classification problem. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1; + * @return int + */ + public function getClassificationType() + { + return $this->classification_type; + } + + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1; + * @param int $var + * @return $this + */ + public function setClassificationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\ClassificationType::class); + $this->classification_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationModelMetadata.php new file mode 100644 index 000000000000..2d1a81c94f42 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationModelMetadata.php @@ -0,0 +1,67 @@ +google.cloud.automl.v1.TextClassificationModelMetadata + */ +class TextClassificationModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Classification type of the dataset used to train this model. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 3; + */ + protected $classification_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $classification_type + * Output only. Classification type of the dataset used to train this model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Classification type of the dataset used to train this model. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 3; + * @return int + */ + public function getClassificationType() + { + return $this->classification_type; + } + + /** + * Output only. Classification type of the dataset used to train this model. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 3; + * @param int $var + * @return $this + */ + public function setClassificationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\ClassificationType::class); + $this->classification_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionAnnotation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionAnnotation.php new file mode 100644 index 000000000000..38691a3cc831 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionAnnotation.php @@ -0,0 +1,116 @@ +google.cloud.automl.v1.TextExtractionAnnotation + */ +class TextExtractionAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence in correctness of the annotation. + * + * Generated from protobuf field float score = 1; + */ + protected $score = 0.0; + protected $annotation; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TextSegment $text_segment + * An entity annotation will set this, which is the part of the original + * text to which the annotation pertains. + * @type float $score + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence in correctness of the annotation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextExtraction::initOnce(); + parent::__construct($data); + } + + /** + * An entity annotation will set this, which is the part of the original + * text to which the annotation pertains. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSegment text_segment = 3; + * @return \Google\Cloud\AutoMl\V1\TextSegment|null + */ + public function getTextSegment() + { + return $this->readOneof(3); + } + + public function hasTextSegment() + { + return $this->hasOneof(3); + } + + /** + * An entity annotation will set this, which is the part of the original + * text to which the annotation pertains. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSegment text_segment = 3; + * @param \Google\Cloud\AutoMl\V1\TextSegment $var + * @return $this + */ + public function setTextSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSegment::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence in correctness of the annotation. + * + * Generated from protobuf field float score = 1; + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence in correctness of the annotation. + * + * Generated from protobuf field float score = 1; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + + /** + * @return string + */ + public function getAnnotation() + { + return $this->whichOneof("annotation"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionDatasetMetadata.php new file mode 100644 index 000000000000..b6c10c7bd5f5 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionDatasetMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.TextExtractionDatasetMetadata + */ +class TextExtractionDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics.php new file mode 100644 index 000000000000..2acd2cd4824d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics.php @@ -0,0 +1,105 @@ +google.cloud.automl.v1.TextExtractionEvaluationMetrics + */ +class TextExtractionEvaluationMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The Area under precision recall curve metric. + * + * Generated from protobuf field float au_prc = 1; + */ + protected $au_prc = 0.0; + /** + * Output only. Metrics that have confidence thresholds. + * Precision-recall curve can be derived from it. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + */ + private $confidence_metrics_entries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $au_prc + * Output only. The Area under precision recall curve metric. + * @type array<\Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $confidence_metrics_entries + * Output only. Metrics that have confidence thresholds. + * Precision-recall curve can be derived from it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextExtraction::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The Area under precision recall curve metric. + * + * Generated from protobuf field float au_prc = 1; + * @return float + */ + public function getAuPrc() + { + return $this->au_prc; + } + + /** + * Output only. The Area under precision recall curve metric. + * + * Generated from protobuf field float au_prc = 1; + * @param float $var + * @return $this + */ + public function setAuPrc($var) + { + GPBUtil::checkFloat($var); + $this->au_prc = $var; + + return $this; + } + + /** + * Output only. Metrics that have confidence thresholds. + * Precision-recall curve can be derived from it. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConfidenceMetricsEntries() + { + return $this->confidence_metrics_entries; + } + + /** + * Output only. Metrics that have confidence thresholds. + * Precision-recall curve can be derived from it. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * @param array<\Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConfidenceMetricsEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics\ConfidenceMetricsEntry::class); + $this->confidence_metrics_entries = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics/ConfidenceMetricsEntry.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics/ConfidenceMetricsEntry.php new file mode 100644 index 000000000000..8c833d3d60d6 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics/ConfidenceMetricsEntry.php @@ -0,0 +1,180 @@ +google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + */ +class ConfidenceMetricsEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The confidence threshold value used to compute the metrics. + * Only annotations with score of at least this threshold are considered to + * be ones the model would return. + * + * Generated from protobuf field float confidence_threshold = 1; + */ + protected $confidence_threshold = 0.0; + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 3; + */ + protected $recall = 0.0; + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 4; + */ + protected $precision = 0.0; + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 5; + */ + protected $f1_score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $confidence_threshold + * Output only. The confidence threshold value used to compute the metrics. + * Only annotations with score of at least this threshold are considered to + * be ones the model would return. + * @type float $recall + * Output only. Recall under the given confidence threshold. + * @type float $precision + * Output only. Precision under the given confidence threshold. + * @type float $f1_score + * Output only. The harmonic mean of recall and precision. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextExtraction::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The confidence threshold value used to compute the metrics. + * Only annotations with score of at least this threshold are considered to + * be ones the model would return. + * + * Generated from protobuf field float confidence_threshold = 1; + * @return float + */ + public function getConfidenceThreshold() + { + return $this->confidence_threshold; + } + + /** + * Output only. The confidence threshold value used to compute the metrics. + * Only annotations with score of at least this threshold are considered to + * be ones the model would return. + * + * Generated from protobuf field float confidence_threshold = 1; + * @param float $var + * @return $this + */ + public function setConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->confidence_threshold = $var; + + return $this; + } + + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 3; + * @return float + */ + public function getRecall() + { + return $this->recall; + } + + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 3; + * @param float $var + * @return $this + */ + public function setRecall($var) + { + GPBUtil::checkFloat($var); + $this->recall = $var; + + return $this; + } + + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 4; + * @return float + */ + public function getPrecision() + { + return $this->precision; + } + + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 4; + * @param float $var + * @return $this + */ + public function setPrecision($var) + { + GPBUtil::checkFloat($var); + $this->precision = $var; + + return $this; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 5; + * @return float + */ + public function getF1Score() + { + return $this->f1_score; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 5; + * @param float $var + * @return $this + */ + public function setF1Score($var) + { + GPBUtil::checkFloat($var); + $this->f1_score = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConfidenceMetricsEntry::class, \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics_ConfidenceMetricsEntry::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionModelMetadata.php new file mode 100644 index 000000000000..cdc4f068d268 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionModelMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.TextExtractionModelMetadata + */ +class TextExtractionModelMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSegment.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSegment.php new file mode 100644 index 000000000000..9ccbf189ab85 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSegment.php @@ -0,0 +1,147 @@ +google.cloud.automl.v1.TextSegment + */ +class TextSegment extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The content of the TextSegment. + * + * Generated from protobuf field string content = 3; + */ + protected $content = ''; + /** + * Required. Zero-based character index of the first character of the text + * segment (counting characters from the beginning of the text). + * + * Generated from protobuf field int64 start_offset = 1; + */ + protected $start_offset = 0; + /** + * Required. Zero-based character index of the first character past the end of + * the text segment (counting character from the beginning of the text). + * The character at the end_offset is NOT included in the text segment. + * + * Generated from protobuf field int64 end_offset = 2; + */ + protected $end_offset = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * Output only. The content of the TextSegment. + * @type int|string $start_offset + * Required. Zero-based character index of the first character of the text + * segment (counting characters from the beginning of the text). + * @type int|string $end_offset + * Required. Zero-based character index of the first character past the end of + * the text segment (counting character from the beginning of the text). + * The character at the end_offset is NOT included in the text segment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextSegment::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The content of the TextSegment. + * + * Generated from protobuf field string content = 3; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Output only. The content of the TextSegment. + * + * Generated from protobuf field string content = 3; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Required. Zero-based character index of the first character of the text + * segment (counting characters from the beginning of the text). + * + * Generated from protobuf field int64 start_offset = 1; + * @return int|string + */ + public function getStartOffset() + { + return $this->start_offset; + } + + /** + * Required. Zero-based character index of the first character of the text + * segment (counting characters from the beginning of the text). + * + * Generated from protobuf field int64 start_offset = 1; + * @param int|string $var + * @return $this + */ + public function setStartOffset($var) + { + GPBUtil::checkInt64($var); + $this->start_offset = $var; + + return $this; + } + + /** + * Required. Zero-based character index of the first character past the end of + * the text segment (counting character from the beginning of the text). + * The character at the end_offset is NOT included in the text segment. + * + * Generated from protobuf field int64 end_offset = 2; + * @return int|string + */ + public function getEndOffset() + { + return $this->end_offset; + } + + /** + * Required. Zero-based character index of the first character past the end of + * the text segment (counting character from the beginning of the text). + * The character at the end_offset is NOT included in the text segment. + * + * Generated from protobuf field int64 end_offset = 2; + * @param int|string $var + * @return $this + */ + public function setEndOffset($var) + { + GPBUtil::checkInt64($var); + $this->end_offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentAnnotation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentAnnotation.php new file mode 100644 index 000000000000..1c95dbd25468 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentAnnotation.php @@ -0,0 +1,111 @@ +google.cloud.automl.v1.TextSentimentAnnotation + */ +class TextSentimentAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The sentiment with the semantic, as given to the + * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used + * for the prediction had been trained. + * The sentiment values are between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + * with higher value meaning more positive sentiment. They are completely + * relative, i.e. 0 means least positive sentiment and sentiment_max means + * the most positive from the sentiments present in the train data. Therefore + * e.g. if train data had only negative sentiment, then sentiment_max, would + * be still negative (although least negative). + * The sentiment shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * + * Generated from protobuf field int32 sentiment = 1; + */ + protected $sentiment = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $sentiment + * Output only. The sentiment with the semantic, as given to the + * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used + * for the prediction had been trained. + * The sentiment values are between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + * with higher value meaning more positive sentiment. They are completely + * relative, i.e. 0 means least positive sentiment and sentiment_max means + * the most positive from the sentiments present in the train data. Therefore + * e.g. if train data had only negative sentiment, then sentiment_max, would + * be still negative (although least negative). + * The sentiment shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextSentiment::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The sentiment with the semantic, as given to the + * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used + * for the prediction had been trained. + * The sentiment values are between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + * with higher value meaning more positive sentiment. They are completely + * relative, i.e. 0 means least positive sentiment and sentiment_max means + * the most positive from the sentiments present in the train data. Therefore + * e.g. if train data had only negative sentiment, then sentiment_max, would + * be still negative (although least negative). + * The sentiment shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * + * Generated from protobuf field int32 sentiment = 1; + * @return int + */ + public function getSentiment() + { + return $this->sentiment; + } + + /** + * Output only. The sentiment with the semantic, as given to the + * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used + * for the prediction had been trained. + * The sentiment values are between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + * with higher value meaning more positive sentiment. They are completely + * relative, i.e. 0 means least positive sentiment and sentiment_max means + * the most positive from the sentiments present in the train data. Therefore + * e.g. if train data had only negative sentiment, then sentiment_max, would + * be still negative (although least negative). + * The sentiment shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * + * Generated from protobuf field int32 sentiment = 1; + * @param int $var + * @return $this + */ + public function setSentiment($var) + { + GPBUtil::checkInt32($var); + $this->sentiment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentDatasetMetadata.php new file mode 100644 index 000000000000..352d7dfd4d45 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentDatasetMetadata.php @@ -0,0 +1,87 @@ +google.cloud.automl.v1.TextSentimentDatasetMetadata + */ +class TextSentimentDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A sentiment is expressed as an integer ordinal, where higher value + * means a more positive sentiment. The range of sentiments that will be used + * is between 0 and sentiment_max (inclusive on both ends), and all the values + * in the range must be represented in the dataset before a model can be + * created. + * sentiment_max value must be between 1 and 10 (inclusive). + * + * Generated from protobuf field int32 sentiment_max = 1; + */ + protected $sentiment_max = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $sentiment_max + * Required. A sentiment is expressed as an integer ordinal, where higher value + * means a more positive sentiment. The range of sentiments that will be used + * is between 0 and sentiment_max (inclusive on both ends), and all the values + * in the range must be represented in the dataset before a model can be + * created. + * sentiment_max value must be between 1 and 10 (inclusive). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + + /** + * Required. A sentiment is expressed as an integer ordinal, where higher value + * means a more positive sentiment. The range of sentiments that will be used + * is between 0 and sentiment_max (inclusive on both ends), and all the values + * in the range must be represented in the dataset before a model can be + * created. + * sentiment_max value must be between 1 and 10 (inclusive). + * + * Generated from protobuf field int32 sentiment_max = 1; + * @return int + */ + public function getSentimentMax() + { + return $this->sentiment_max; + } + + /** + * Required. A sentiment is expressed as an integer ordinal, where higher value + * means a more positive sentiment. The range of sentiments that will be used + * is between 0 and sentiment_max (inclusive on both ends), and all the values + * in the range must be represented in the dataset before a model can be + * created. + * sentiment_max value must be between 1 and 10 (inclusive). + * + * Generated from protobuf field int32 sentiment_max = 1; + * @param int $var + * @return $this + */ + public function setSentimentMax($var) + { + GPBUtil::checkInt32($var); + $this->sentiment_max = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentEvaluationMetrics.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentEvaluationMetrics.php new file mode 100644 index 000000000000..3d45752c0090 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentEvaluationMetrics.php @@ -0,0 +1,339 @@ +google.cloud.automl.v1.TextSentimentEvaluationMetrics + */ +class TextSentimentEvaluationMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Precision. + * + * Generated from protobuf field float precision = 1; + */ + protected $precision = 0.0; + /** + * Output only. Recall. + * + * Generated from protobuf field float recall = 2; + */ + protected $recall = 0.0; + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 3; + */ + protected $f1_score = 0.0; + /** + * Output only. Mean absolute error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_absolute_error = 4; + */ + protected $mean_absolute_error = 0.0; + /** + * Output only. Mean squared error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_squared_error = 5; + */ + protected $mean_squared_error = 0.0; + /** + * Output only. Linear weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float linear_kappa = 6; + */ + protected $linear_kappa = 0.0; + /** + * Output only. Quadratic weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float quadratic_kappa = 7; + */ + protected $quadratic_kappa = 0.0; + /** + * Output only. Confusion matrix of the evaluation. + * Only set for the overall model evaluation, not for evaluation of a single + * annotation spec. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + */ + protected $confusion_matrix = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $precision + * Output only. Precision. + * @type float $recall + * Output only. Recall. + * @type float $f1_score + * Output only. The harmonic mean of recall and precision. + * @type float $mean_absolute_error + * Output only. Mean absolute error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * @type float $mean_squared_error + * Output only. Mean squared error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * @type float $linear_kappa + * Output only. Linear weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * @type float $quadratic_kappa + * Output only. Quadratic weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * @type \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix $confusion_matrix + * Output only. Confusion matrix of the evaluation. + * Only set for the overall model evaluation, not for evaluation of a single + * annotation spec. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextSentiment::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Precision. + * + * Generated from protobuf field float precision = 1; + * @return float + */ + public function getPrecision() + { + return $this->precision; + } + + /** + * Output only. Precision. + * + * Generated from protobuf field float precision = 1; + * @param float $var + * @return $this + */ + public function setPrecision($var) + { + GPBUtil::checkFloat($var); + $this->precision = $var; + + return $this; + } + + /** + * Output only. Recall. + * + * Generated from protobuf field float recall = 2; + * @return float + */ + public function getRecall() + { + return $this->recall; + } + + /** + * Output only. Recall. + * + * Generated from protobuf field float recall = 2; + * @param float $var + * @return $this + */ + public function setRecall($var) + { + GPBUtil::checkFloat($var); + $this->recall = $var; + + return $this; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 3; + * @return float + */ + public function getF1Score() + { + return $this->f1_score; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 3; + * @param float $var + * @return $this + */ + public function setF1Score($var) + { + GPBUtil::checkFloat($var); + $this->f1_score = $var; + + return $this; + } + + /** + * Output only. Mean absolute error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_absolute_error = 4; + * @return float + */ + public function getMeanAbsoluteError() + { + return $this->mean_absolute_error; + } + + /** + * Output only. Mean absolute error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_absolute_error = 4; + * @param float $var + * @return $this + */ + public function setMeanAbsoluteError($var) + { + GPBUtil::checkFloat($var); + $this->mean_absolute_error = $var; + + return $this; + } + + /** + * Output only. Mean squared error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_squared_error = 5; + * @return float + */ + public function getMeanSquaredError() + { + return $this->mean_squared_error; + } + + /** + * Output only. Mean squared error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_squared_error = 5; + * @param float $var + * @return $this + */ + public function setMeanSquaredError($var) + { + GPBUtil::checkFloat($var); + $this->mean_squared_error = $var; + + return $this; + } + + /** + * Output only. Linear weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float linear_kappa = 6; + * @return float + */ + public function getLinearKappa() + { + return $this->linear_kappa; + } + + /** + * Output only. Linear weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float linear_kappa = 6; + * @param float $var + * @return $this + */ + public function setLinearKappa($var) + { + GPBUtil::checkFloat($var); + $this->linear_kappa = $var; + + return $this; + } + + /** + * Output only. Quadratic weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float quadratic_kappa = 7; + * @return float + */ + public function getQuadraticKappa() + { + return $this->quadratic_kappa; + } + + /** + * Output only. Quadratic weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float quadratic_kappa = 7; + * @param float $var + * @return $this + */ + public function setQuadraticKappa($var) + { + GPBUtil::checkFloat($var); + $this->quadratic_kappa = $var; + + return $this; + } + + /** + * Output only. Confusion matrix of the evaluation. + * Only set for the overall model evaluation, not for evaluation of a single + * annotation spec. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * @return \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix|null + */ + public function getConfusionMatrix() + { + return $this->confusion_matrix; + } + + public function hasConfusionMatrix() + { + return isset($this->confusion_matrix); + } + + public function clearConfusionMatrix() + { + unset($this->confusion_matrix); + } + + /** + * Output only. Confusion matrix of the evaluation. + * Only set for the overall model evaluation, not for evaluation of a single + * annotation spec. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * @param \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix $var + * @return $this + */ + public function setConfusionMatrix($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix::class); + $this->confusion_matrix = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentModelMetadata.php new file mode 100644 index 000000000000..67524cbc7e25 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentModelMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.TextSentimentModelMetadata + */ +class TextSentimentModelMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSnippet.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSnippet.php new file mode 100644 index 000000000000..0ddb5bffe51f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSnippet.php @@ -0,0 +1,147 @@ +google.cloud.automl.v1.TextSnippet + */ +class TextSnippet extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The content of the text snippet as a string. Up to 250000 + * characters long. + * + * Generated from protobuf field string content = 1; + */ + protected $content = ''; + /** + * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed + * values are "text/html" and "text/plain". If left blank, the format is + * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + * + * Generated from protobuf field string mime_type = 2; + */ + protected $mime_type = ''; + /** + * Output only. HTTP URI where you can download the content. + * + * Generated from protobuf field string content_uri = 4; + */ + protected $content_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * Required. The content of the text snippet as a string. Up to 250000 + * characters long. + * @type string $mime_type + * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed + * values are "text/html" and "text/plain". If left blank, the format is + * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + * @type string $content_uri + * Output only. HTTP URI where you can download the content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * Required. The content of the text snippet as a string. Up to 250000 + * characters long. + * + * Generated from protobuf field string content = 1; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Required. The content of the text snippet as a string. Up to 250000 + * characters long. + * + * Generated from protobuf field string content = 1; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed + * values are "text/html" and "text/plain". If left blank, the format is + * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + * + * Generated from protobuf field string mime_type = 2; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed + * values are "text/html" and "text/plain". If left blank, the format is + * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + * + * Generated from protobuf field string mime_type = 2; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + + /** + * Output only. HTTP URI where you can download the content. + * + * Generated from protobuf field string content_uri = 4; + * @return string + */ + public function getContentUri() + { + return $this->content_uri; + } + + /** + * Output only. HTTP URI where you can download the content. + * + * Generated from protobuf field string content_uri = 4; + * @param string $var + * @return $this + */ + public function setContentUri($var) + { + GPBUtil::checkString($var, True); + $this->content_uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationAnnotation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationAnnotation.php new file mode 100644 index 000000000000..f0331be6b72b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationAnnotation.php @@ -0,0 +1,77 @@ +google.cloud.automl.v1.TranslationAnnotation + */ +class TranslationAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only . The translated content. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + protected $translated_content = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TextSnippet $translated_content + * Output only . The translated content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Translation::initOnce(); + parent::__construct($data); + } + + /** + * Output only . The translated content. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet translated_content = 1; + * @return \Google\Cloud\AutoMl\V1\TextSnippet|null + */ + public function getTranslatedContent() + { + return $this->translated_content; + } + + public function hasTranslatedContent() + { + return isset($this->translated_content); + } + + public function clearTranslatedContent() + { + unset($this->translated_content); + } + + /** + * Output only . The translated content. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet translated_content = 1; + * @param \Google\Cloud\AutoMl\V1\TextSnippet $var + * @return $this + */ + public function setTranslatedContent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSnippet::class); + $this->translated_content = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationDatasetMetadata.php new file mode 100644 index 000000000000..37554063e8e1 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationDatasetMetadata.php @@ -0,0 +1,101 @@ +google.cloud.automl.v1.TranslationDatasetMetadata + */ +class TranslationDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The BCP-47 language code of the source language. + * + * Generated from protobuf field string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $source_language_code = ''; + /** + * Required. The BCP-47 language code of the target language. + * + * Generated from protobuf field string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $source_language_code + * Required. The BCP-47 language code of the source language. + * @type string $target_language_code + * Required. The BCP-47 language code of the target language. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Translation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The BCP-47 language code of the source language. + * + * Generated from protobuf field string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSourceLanguageCode() + { + return $this->source_language_code; + } + + /** + * Required. The BCP-47 language code of the source language. + * + * Generated from protobuf field string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSourceLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->source_language_code = $var; + + return $this; + } + + /** + * Required. The BCP-47 language code of the target language. + * + * Generated from protobuf field string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetLanguageCode() + { + return $this->target_language_code; + } + + /** + * Required. The BCP-47 language code of the target language. + * + * Generated from protobuf field string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->target_language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationEvaluationMetrics.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationEvaluationMetrics.php new file mode 100644 index 000000000000..824df4fb470d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationEvaluationMetrics.php @@ -0,0 +1,101 @@ +google.cloud.automl.v1.TranslationEvaluationMetrics + */ +class TranslationEvaluationMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. BLEU score. + * + * Generated from protobuf field double bleu_score = 1; + */ + protected $bleu_score = 0.0; + /** + * Output only. BLEU score for base model. + * + * Generated from protobuf field double base_bleu_score = 2; + */ + protected $base_bleu_score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $bleu_score + * Output only. BLEU score. + * @type float $base_bleu_score + * Output only. BLEU score for base model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Translation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. BLEU score. + * + * Generated from protobuf field double bleu_score = 1; + * @return float + */ + public function getBleuScore() + { + return $this->bleu_score; + } + + /** + * Output only. BLEU score. + * + * Generated from protobuf field double bleu_score = 1; + * @param float $var + * @return $this + */ + public function setBleuScore($var) + { + GPBUtil::checkDouble($var); + $this->bleu_score = $var; + + return $this; + } + + /** + * Output only. BLEU score for base model. + * + * Generated from protobuf field double base_bleu_score = 2; + * @return float + */ + public function getBaseBleuScore() + { + return $this->base_bleu_score; + } + + /** + * Output only. BLEU score for base model. + * + * Generated from protobuf field double base_bleu_score = 2; + * @param float $var + * @return $this + */ + public function setBaseBleuScore($var) + { + GPBUtil::checkDouble($var); + $this->base_bleu_score = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationModelMetadata.php new file mode 100644 index 000000000000..7271f3e10913 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationModelMetadata.php @@ -0,0 +1,155 @@ +google.cloud.automl.v1.TranslationModelMetadata + */ +class TranslationModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the model to use as a baseline to train the custom + * model. If unset, we use the default base model provided by Google + * Translate. Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * Generated from protobuf field string base_model = 1; + */ + protected $base_model = ''; + /** + * Output only. Inferred from the dataset. + * The source language (The BCP-47 language code) that is used for training. + * + * Generated from protobuf field string source_language_code = 2; + */ + protected $source_language_code = ''; + /** + * Output only. The target language (The BCP-47 language code) that is used + * for training. + * + * Generated from protobuf field string target_language_code = 3; + */ + protected $target_language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $base_model + * The resource name of the model to use as a baseline to train the custom + * model. If unset, we use the default base model provided by Google + * Translate. Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}` + * @type string $source_language_code + * Output only. Inferred from the dataset. + * The source language (The BCP-47 language code) that is used for training. + * @type string $target_language_code + * Output only. The target language (The BCP-47 language code) that is used + * for training. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Translation::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the model to use as a baseline to train the custom + * model. If unset, we use the default base model provided by Google + * Translate. Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * Generated from protobuf field string base_model = 1; + * @return string + */ + public function getBaseModel() + { + return $this->base_model; + } + + /** + * The resource name of the model to use as a baseline to train the custom + * model. If unset, we use the default base model provided by Google + * Translate. Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * Generated from protobuf field string base_model = 1; + * @param string $var + * @return $this + */ + public function setBaseModel($var) + { + GPBUtil::checkString($var, True); + $this->base_model = $var; + + return $this; + } + + /** + * Output only. Inferred from the dataset. + * The source language (The BCP-47 language code) that is used for training. + * + * Generated from protobuf field string source_language_code = 2; + * @return string + */ + public function getSourceLanguageCode() + { + return $this->source_language_code; + } + + /** + * Output only. Inferred from the dataset. + * The source language (The BCP-47 language code) that is used for training. + * + * Generated from protobuf field string source_language_code = 2; + * @param string $var + * @return $this + */ + public function setSourceLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->source_language_code = $var; + + return $this; + } + + /** + * Output only. The target language (The BCP-47 language code) that is used + * for training. + * + * Generated from protobuf field string target_language_code = 3; + * @return string + */ + public function getTargetLanguageCode() + { + return $this->target_language_code; + } + + /** + * Output only. The target language (The BCP-47 language code) that is used + * for training. + * + * Generated from protobuf field string target_language_code = 3; + * @param string $var + * @return $this + */ + public function setTargetLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->target_language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelOperationMetadata.php new file mode 100644 index 000000000000..437d6e00c14c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.UndeployModelOperationMetadata + */ +class UndeployModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelRequest.php new file mode 100644 index 000000000000..fc39415291db --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.UndeployModelRequest + */ +class UndeployModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the model to undeploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the model to undeploy. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\UndeployModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the model to undeploy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the model to undeploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the model to undeploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateDatasetRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateDatasetRequest.php new file mode 100644 index 000000000000..2beb23764837 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateDatasetRequest.php @@ -0,0 +1,136 @@ +google.cloud.automl.v1.UpdateDatasetRequest + */ +class UpdateDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The dataset which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset = null; + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\AutoMl\V1\Dataset $dataset Required. The dataset which replaces the resource on the server. + * @param \Google\Protobuf\FieldMask $updateMask Required. The update mask applies to the resource. + * + * @return \Google\Cloud\AutoMl\V1\UpdateDatasetRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AutoMl\V1\Dataset $dataset, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDataset($dataset) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\Dataset $dataset + * Required. The dataset which replaces the resource on the server. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The update mask applies to the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The dataset which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\Dataset|null + */ + public function getDataset() + { + return $this->dataset; + } + + public function hasDataset() + { + return isset($this->dataset); + } + + public function clearDataset() + { + unset($this->dataset); + } + + /** + * Required. The dataset which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\Dataset $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Dataset::class); + $this->dataset = $var; + + return $this; + } + + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateModelRequest.php new file mode 100644 index 000000000000..0408ab2efb2a --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateModelRequest.php @@ -0,0 +1,136 @@ +google.cloud.automl.v1.UpdateModelRequest + */ +class UpdateModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The model which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $model = null; + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\AutoMl\V1\Model $model Required. The model which replaces the resource on the server. + * @param \Google\Protobuf\FieldMask $updateMask Required. The update mask applies to the resource. + * + * @return \Google\Cloud\AutoMl\V1\UpdateModelRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AutoMl\V1\Model $model, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setModel($model) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\Model $model + * Required. The model which replaces the resource on the server. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The update mask applies to the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The model which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\Model|null + */ + public function getModel() + { + return $this->model; + } + + public function hasModel() + { + return isset($this->model); + } + + public function clearModel() + { + unset($this->model); + } + + /** + * Required. The model which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\Model $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Model::class); + $this->model = $var; + + return $this; + } + + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_dataset.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_dataset.php new file mode 100644 index 000000000000..d0614e92c97e --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_dataset.php @@ -0,0 +1,85 @@ +setParent($formattedParent) + ->setDataset($dataset); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->createDataset($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Dataset $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AutoMlClient::locationName('[PROJECT]', '[LOCATION]'); + + create_dataset_sample($formattedParent); +} +// [END automl_v1_generated_AutoMl_CreateDataset_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_model.php new file mode 100644 index 000000000000..69f95a54b186 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_model.php @@ -0,0 +1,89 @@ +setParent($formattedParent) + ->setModel($model); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->createModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Model $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AutoMlClient::locationName('[PROJECT]', '[LOCATION]'); + + create_model_sample($formattedParent); +} +// [END automl_v1_generated_AutoMl_CreateModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_dataset.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_dataset.php new file mode 100644 index 000000000000..cc27e08bc16d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_dataset.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->deleteDataset($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AutoMlClient::datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + + delete_dataset_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_DeleteDataset_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_model.php new file mode 100644 index 000000000000..51ad90525937 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_model.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->deleteModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + + delete_model_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_DeleteModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/deploy_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/deploy_model.php new file mode 100644 index 000000000000..342e9a950952 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/deploy_model.php @@ -0,0 +1,90 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->deployModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + + deploy_model_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_DeployModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_data.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_data.php new file mode 100644 index 000000000000..28d17822fa67 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_data.php @@ -0,0 +1,98 @@ +setOutputUriPrefix($outputConfigGcsDestinationOutputUriPrefix); + $outputConfig = (new OutputConfig()) + ->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportDataRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->exportData($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AutoMlClient::datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $outputConfigGcsDestinationOutputUriPrefix = '[OUTPUT_URI_PREFIX]'; + + export_data_sample($formattedName, $outputConfigGcsDestinationOutputUriPrefix); +} +// [END automl_v1_generated_AutoMl_ExportData_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_model.php new file mode 100644 index 000000000000..d482584b3b8a --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_model.php @@ -0,0 +1,102 @@ +setOutputUriPrefix($outputConfigGcsDestinationOutputUriPrefix); + $outputConfig = (new ModelExportOutputConfig()) + ->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportModelRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->exportModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $outputConfigGcsDestinationOutputUriPrefix = '[OUTPUT_URI_PREFIX]'; + + export_model_sample($formattedName, $outputConfigGcsDestinationOutputUriPrefix); +} +// [END automl_v1_generated_AutoMl_ExportModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_annotation_spec.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_annotation_spec.php new file mode 100644 index 000000000000..52a862870be4 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_annotation_spec.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AnnotationSpec $response */ + $response = $autoMlClient->getAnnotationSpec($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AutoMlClient::annotationSpecName( + '[PROJECT]', + '[LOCATION]', + '[DATASET]', + '[ANNOTATION_SPEC]' + ); + + get_annotation_spec_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_GetAnnotationSpec_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_dataset.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_dataset.php new file mode 100644 index 000000000000..664f48931c27 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_dataset.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Dataset $response */ + $response = $autoMlClient->getDataset($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AutoMlClient::datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + + get_dataset_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_GetDataset_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model.php new file mode 100644 index 000000000000..9f35305c88cf --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Model $response */ + $response = $autoMlClient->getModel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + + get_model_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_GetModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model_evaluation.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model_evaluation.php new file mode 100644 index 000000000000..fd11ecf2cec8 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model_evaluation.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ModelEvaluation $response */ + $response = $autoMlClient->getModelEvaluation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AutoMlClient::modelEvaluationName( + '[PROJECT]', + '[LOCATION]', + '[MODEL]', + '[MODEL_EVALUATION]' + ); + + get_model_evaluation_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_GetModelEvaluation_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/import_data.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/import_data.php new file mode 100644 index 000000000000..561944ff9b65 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/import_data.php @@ -0,0 +1,92 @@ +setName($formattedName) + ->setInputConfig($inputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->importData($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AutoMlClient::datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + + import_data_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_ImportData_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_datasets.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_datasets.php new file mode 100644 index 000000000000..d33650ae5385 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_datasets.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $autoMlClient->listDatasets($request); + + /** @var Dataset $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AutoMlClient::locationName('[PROJECT]', '[LOCATION]'); + + list_datasets_sample($formattedParent); +} +// [END automl_v1_generated_AutoMl_ListDatasets_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_model_evaluations.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_model_evaluations.php new file mode 100644 index 000000000000..22972bcdd8ca --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_model_evaluations.php @@ -0,0 +1,91 @@ + The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + */ +function list_model_evaluations_sample(string $formattedParent, string $filter): void +{ + // Create a client. + $autoMlClient = new AutoMlClient(); + + // Prepare the request message. + $request = (new ListModelEvaluationsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $autoMlClient->listModelEvaluations($request); + + /** @var ModelEvaluation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $filter = '[FILTER]'; + + list_model_evaluations_sample($formattedParent, $filter); +} +// [END automl_v1_generated_AutoMl_ListModelEvaluations_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_models.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_models.php new file mode 100644 index 000000000000..dfe234500d3d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_models.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $autoMlClient->listModels($request); + + /** @var Model $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AutoMlClient::locationName('[PROJECT]', '[LOCATION]'); + + list_models_sample($formattedParent); +} +// [END automl_v1_generated_AutoMl_ListModels_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/undeploy_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/undeploy_model.php new file mode 100644 index 000000000000..8aac610a235b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/undeploy_model.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->undeployModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + + undeploy_model_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_UndeployModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_dataset.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_dataset.php new file mode 100644 index 000000000000..cb6d571bf1ec --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_dataset.php @@ -0,0 +1,62 @@ +setDataset($dataset) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Dataset $response */ + $response = $autoMlClient->updateDataset($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END automl_v1_generated_AutoMl_UpdateDataset_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_model.php new file mode 100644 index 000000000000..a04d31b68e67 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_model.php @@ -0,0 +1,62 @@ +setModel($model) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Model $response */ + $response = $autoMlClient->updateModel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END automl_v1_generated_AutoMl_UpdateModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/batch_predict.php b/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/batch_predict.php new file mode 100644 index 000000000000..04e99da93e38 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/batch_predict.php @@ -0,0 +1,130 @@ +setInputUris($inputConfigGcsSourceInputUris); + $inputConfig = (new BatchPredictInputConfig()) + ->setGcsSource($inputConfigGcsSource); + $outputConfigGcsDestination = (new GcsDestination()) + ->setOutputUriPrefix($outputConfigGcsDestinationOutputUriPrefix); + $outputConfig = (new BatchPredictOutputConfig()) + ->setGcsDestination($outputConfigGcsDestination); + $request = (new BatchPredictRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig) + ->setOutputConfig($outputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $predictionServiceClient->batchPredict($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchPredictResult $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = PredictionServiceClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $inputConfigGcsSourceInputUrisElement = '[INPUT_URIS]'; + $outputConfigGcsDestinationOutputUriPrefix = '[OUTPUT_URI_PREFIX]'; + + batch_predict_sample( + $formattedName, + $inputConfigGcsSourceInputUrisElement, + $outputConfigGcsDestinationOutputUriPrefix + ); +} +// [END automl_v1_generated_PredictionService_BatchPredict_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/predict.php b/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/predict.php new file mode 100644 index 000000000000..ab9ba2bbea5f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/predict.php @@ -0,0 +1,109 @@ +setName($formattedName) + ->setPayload($payload); + + // Call the API and handle any network failures. + try { + /** @var PredictResponse $response */ + $response = $predictionServiceClient->predict($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = PredictionServiceClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + + predict_sample($formattedName); +} +// [END automl_v1_generated_PredictionService_Predict_sync] diff --git a/owl-bot-staging/AutoMl/v1/src/V1/Client/AutoMlClient.php b/owl-bot-staging/AutoMl/v1/src/V1/Client/AutoMlClient.php new file mode 100644 index 000000000000..44554b2cf5a7 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/Client/AutoMlClient.php @@ -0,0 +1,916 @@ + createDatasetAsync(CreateDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface createModelAsync(CreateModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteDatasetAsync(DeleteDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteModelAsync(DeleteModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface deployModelAsync(DeployModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportDataAsync(ExportDataRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportModelAsync(ExportModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAnnotationSpecAsync(GetAnnotationSpecRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDatasetAsync(GetDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface getModelAsync(GetModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getModelEvaluationAsync(GetModelEvaluationRequest $request, array $optionalArgs = []) + * @method PromiseInterface importDataAsync(ImportDataRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDatasetsAsync(ListDatasetsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listModelEvaluationsAsync(ListModelEvaluationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listModelsAsync(ListModelsRequest $request, array $optionalArgs = []) + * @method PromiseInterface undeployModelAsync(UndeployModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDatasetAsync(UpdateDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateModelAsync(UpdateModelRequest $request, array $optionalArgs = []) + */ +final class AutoMlClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.automl.v1.AutoMl'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'automl.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'automl.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/auto_ml_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/auto_ml_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/auto_ml_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/auto_ml_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * annotation_spec resource. + * + * @param string $project + * @param string $location + * @param string $dataset + * @param string $annotationSpec + * + * @return string The formatted annotation_spec resource. + */ + public static function annotationSpecName(string $project, string $location, string $dataset, string $annotationSpec): string + { + return self::getPathTemplate('annotationSpec')->render([ + 'project' => $project, + 'location' => $location, + 'dataset' => $dataset, + 'annotation_spec' => $annotationSpec, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a dataset + * resource. + * + * @param string $project + * @param string $location + * @param string $dataset + * + * @return string The formatted dataset resource. + */ + public static function datasetName(string $project, string $location, string $dataset): string + { + return self::getPathTemplate('dataset')->render([ + 'project' => $project, + 'location' => $location, + 'dataset' => $dataset, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a model + * resource. + * + * @param string $project + * @param string $location + * @param string $model + * + * @return string The formatted model resource. + */ + public static function modelName(string $project, string $location, string $model): string + { + return self::getPathTemplate('model')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * model_evaluation resource. + * + * @param string $project + * @param string $location + * @param string $model + * @param string $modelEvaluation + * + * @return string The formatted model_evaluation resource. + */ + public static function modelEvaluationName(string $project, string $location, string $model, string $modelEvaluation): string + { + return self::getPathTemplate('modelEvaluation')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + 'model_evaluation' => $modelEvaluation, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - annotationSpec: projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec} + * - dataset: projects/{project}/locations/{location}/datasets/{dataset} + * - location: projects/{project}/locations/{location} + * - model: projects/{project}/locations/{location}/models/{model} + * - modelEvaluation: projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'automl.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a dataset. + * + * The async variant is {@see AutoMlClient::createDatasetAsync()} . + * + * @example samples/V1/AutoMlClient/create_dataset.php + * + * @param CreateDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createDataset(CreateDatasetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateDataset', $request, $callOptions)->wait(); + } + + /** + * Creates a model. + * Returns a Model in the [response][google.longrunning.Operation.response] + * field when it completes. + * When you create a model, several model evaluations are created for it: + * a global evaluation, and one evaluation for each annotation spec. + * + * The async variant is {@see AutoMlClient::createModelAsync()} . + * + * @example samples/V1/AutoMlClient/create_model.php + * + * @param CreateModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createModel(CreateModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateModel', $request, $callOptions)->wait(); + } + + /** + * Deletes a dataset and all of its contents. + * Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, + * and `delete_details` in the + * [metadata][google.longrunning.Operation.metadata] field. + * + * The async variant is {@see AutoMlClient::deleteDatasetAsync()} . + * + * @example samples/V1/AutoMlClient/delete_dataset.php + * + * @param DeleteDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteDataset(DeleteDatasetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteDataset', $request, $callOptions)->wait(); + } + + /** + * Deletes a model. + * Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, + * and `delete_details` in the + * [metadata][google.longrunning.Operation.metadata] field. + * + * The async variant is {@see AutoMlClient::deleteModelAsync()} . + * + * @example samples/V1/AutoMlClient/delete_model.php + * + * @param DeleteModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteModel(DeleteModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteModel', $request, $callOptions)->wait(); + } + + /** + * Deploys a model. If a model is already deployed, deploying it with the + * same parameters has no effect. Deploying with different parametrs + * (as e.g. changing + * [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + * Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + * deployment automatically. + * + * Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + * The async variant is {@see AutoMlClient::deployModelAsync()} . + * + * @example samples/V1/AutoMlClient/deploy_model.php + * + * @param DeployModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deployModel(DeployModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeployModel', $request, $callOptions)->wait(); + } + + /** + * Exports dataset's data to the provided output location. + * Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + * The async variant is {@see AutoMlClient::exportDataAsync()} . + * + * @example samples/V1/AutoMlClient/export_data.php + * + * @param ExportDataRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportData(ExportDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportData', $request, $callOptions)->wait(); + } + + /** + * Exports a trained, "export-able", model to a user specified Google Cloud + * Storage location. A model is considered export-able if and only if it has + * an export format defined for it in + * [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + * + * Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + * The async variant is {@see AutoMlClient::exportModelAsync()} . + * + * @example samples/V1/AutoMlClient/export_model.php + * + * @param ExportModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportModel(ExportModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportModel', $request, $callOptions)->wait(); + } + + /** + * Gets an annotation spec. + * + * The async variant is {@see AutoMlClient::getAnnotationSpecAsync()} . + * + * @example samples/V1/AutoMlClient/get_annotation_spec.php + * + * @param GetAnnotationSpecRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnnotationSpec + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAnnotationSpec(GetAnnotationSpecRequest $request, array $callOptions = []): AnnotationSpec + { + return $this->startApiCall('GetAnnotationSpec', $request, $callOptions)->wait(); + } + + /** + * Gets a dataset. + * + * The async variant is {@see AutoMlClient::getDatasetAsync()} . + * + * @example samples/V1/AutoMlClient/get_dataset.php + * + * @param GetDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Dataset + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDataset(GetDatasetRequest $request, array $callOptions = []): Dataset + { + return $this->startApiCall('GetDataset', $request, $callOptions)->wait(); + } + + /** + * Gets a model. + * + * The async variant is {@see AutoMlClient::getModelAsync()} . + * + * @example samples/V1/AutoMlClient/get_model.php + * + * @param GetModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Model + * + * @throws ApiException Thrown if the API call fails. + */ + public function getModel(GetModelRequest $request, array $callOptions = []): Model + { + return $this->startApiCall('GetModel', $request, $callOptions)->wait(); + } + + /** + * Gets a model evaluation. + * + * The async variant is {@see AutoMlClient::getModelEvaluationAsync()} . + * + * @example samples/V1/AutoMlClient/get_model_evaluation.php + * + * @param GetModelEvaluationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ModelEvaluation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getModelEvaluation(GetModelEvaluationRequest $request, array $callOptions = []): ModelEvaluation + { + return $this->startApiCall('GetModelEvaluation', $request, $callOptions)->wait(); + } + + /** + * Imports data into a dataset. + * For Tables this method can only be called on an empty Dataset. + * + * For Tables: + * * A + * [schema_inference_version][google.cloud.automl.v1.InputConfig.params] + * parameter must be explicitly set. + * Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + * The async variant is {@see AutoMlClient::importDataAsync()} . + * + * @example samples/V1/AutoMlClient/import_data.php + * + * @param ImportDataRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importData(ImportDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportData', $request, $callOptions)->wait(); + } + + /** + * Lists datasets in a project. + * + * The async variant is {@see AutoMlClient::listDatasetsAsync()} . + * + * @example samples/V1/AutoMlClient/list_datasets.php + * + * @param ListDatasetsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDatasets(ListDatasetsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDatasets', $request, $callOptions); + } + + /** + * Lists model evaluations. + * + * The async variant is {@see AutoMlClient::listModelEvaluationsAsync()} . + * + * @example samples/V1/AutoMlClient/list_model_evaluations.php + * + * @param ListModelEvaluationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listModelEvaluations(ListModelEvaluationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListModelEvaluations', $request, $callOptions); + } + + /** + * Lists models. + * + * The async variant is {@see AutoMlClient::listModelsAsync()} . + * + * @example samples/V1/AutoMlClient/list_models.php + * + * @param ListModelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listModels(ListModelsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListModels', $request, $callOptions); + } + + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + * Only applicable for Text Classification, Image Object Detection and Tables; + * all other domains manage deployment automatically. + * + * Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + * The async variant is {@see AutoMlClient::undeployModelAsync()} . + * + * @example samples/V1/AutoMlClient/undeploy_model.php + * + * @param UndeployModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function undeployModel(UndeployModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UndeployModel', $request, $callOptions)->wait(); + } + + /** + * Updates a dataset. + * + * The async variant is {@see AutoMlClient::updateDatasetAsync()} . + * + * @example samples/V1/AutoMlClient/update_dataset.php + * + * @param UpdateDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Dataset + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDataset(UpdateDatasetRequest $request, array $callOptions = []): Dataset + { + return $this->startApiCall('UpdateDataset', $request, $callOptions)->wait(); + } + + /** + * Updates a model. + * + * The async variant is {@see AutoMlClient::updateModelAsync()} . + * + * @example samples/V1/AutoMlClient/update_model.php + * + * @param UpdateModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Model + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateModel(UpdateModelRequest $request, array $callOptions = []): Model + { + return $this->startApiCall('UpdateModel', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/AutoMl/v1/src/V1/Client/PredictionServiceClient.php b/owl-bot-staging/AutoMl/v1/src/V1/Client/PredictionServiceClient.php new file mode 100644 index 000000000000..7822e95e74af --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/Client/PredictionServiceClient.php @@ -0,0 +1,378 @@ + batchPredictAsync(BatchPredictRequest $request, array $optionalArgs = []) + * @method PromiseInterface predictAsync(PredictRequest $request, array $optionalArgs = []) + */ +final class PredictionServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.automl.v1.PredictionService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'automl.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'automl.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/prediction_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/prediction_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/prediction_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/prediction_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a model + * resource. + * + * @param string $project + * @param string $location + * @param string $model + * + * @return string The formatted model resource. + */ + public static function modelName(string $project, string $location, string $model): string + { + return self::getPathTemplate('model')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - model: projects/{project}/locations/{location}/models/{model} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'automl.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch + * prediction result won't be immediately available in the response. Instead, + * a long running operation object is returned. User can poll the operation + * result via [GetOperation][google.longrunning.Operations.GetOperation] + * method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in + * the [response][google.longrunning.Operation.response] field. + * Available for following ML scenarios: + * + * * AutoML Vision Classification + * * AutoML Vision Object Detection + * * AutoML Video Intelligence Classification + * * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification + * * AutoML Natural Language Entity Extraction + * * AutoML Natural Language Sentiment Analysis + * * AutoML Tables + * + * The async variant is {@see PredictionServiceClient::batchPredictAsync()} . + * + * @example samples/V1/PredictionServiceClient/batch_predict.php + * + * @param BatchPredictRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchPredict(BatchPredictRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchPredict', $request, $callOptions)->wait(); + } + + /** + * Perform an online prediction. The prediction result is directly + * returned in the response. + * Available for following ML scenarios, and their expected request payloads: + * + * AutoML Vision Classification + * + * * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + * + * AutoML Vision Object Detection + * + * * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + * + * AutoML Natural Language Classification + * + * * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + * .PDF, .TIF or .TIFF format with size upto 2MB. + * + * AutoML Natural Language Entity Extraction + * + * * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document + * in .PDF, .TIF or .TIFF format with size upto 20MB. + * + * AutoML Natural Language Sentiment Analysis + * + * * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + * .PDF, .TIF or .TIFF format with size upto 2MB. + * + * AutoML Translation + * + * * A TextSnippet up to 25,000 characters, UTF-8 encoded. + * + * AutoML Tables + * + * * A row with column values matching + * the columns of the model, up to 5MB. Not available for FORECASTING + * `prediction_type`. + * + * The async variant is {@see PredictionServiceClient::predictAsync()} . + * + * @example samples/V1/PredictionServiceClient/predict.php + * + * @param PredictRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PredictResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function predict(PredictRequest $request, array $callOptions = []): PredictResponse + { + return $this->startApiCall('Predict', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/AutoMl/v1/src/V1/gapic_metadata.json b/owl-bot-staging/AutoMl/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..0c6570bd7d8b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/gapic_metadata.json @@ -0,0 +1,127 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.automl.v1", + "libraryPackage": "Google\\Cloud\\AutoMl\\V1", + "services": { + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceGapicClient", + "rpcs": { + "BatchPredict": { + "methods": [ + "batchPredict" + ] + }, + "Predict": { + "methods": [ + "predict" + ] + } + } + } + } + }, + "AutoMl": { + "clients": { + "grpc": { + "libraryClient": "AutoMlGapicClient", + "rpcs": { + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "CreateModel": { + "methods": [ + "createModel" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "GetModel": { + "methods": [ + "getModel" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations" + ] + }, + "ListModels": { + "methods": [ + "listModels" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "UpdateModel": { + "methods": [ + "updateModel" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_client_config.json b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_client_config.json new file mode 100644 index 000000000000..086602a0938f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_client_config.json @@ -0,0 +1,135 @@ +{ + "interfaces": { + "google.cloud.automl.v1.AutoMl": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 5000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000, + "total_timeout_millis": 5000 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 5000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000, + "total_timeout_millis": 5000 + } + }, + "methods": { + "CreateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateModel": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteDataset": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteModel": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ExportData": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ExportModel": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetAnnotationSpec": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDataset": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetModel": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetModelEvaluation": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportData": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListDatasets": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListModelEvaluations": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListModels": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UndeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateModel": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_descriptor_config.php b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_descriptor_config.php new file mode 100644 index 000000000000..2f2030959022 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_descriptor_config.php @@ -0,0 +1,340 @@ + [ + 'google.cloud.automl.v1.AutoMl' => [ + 'CreateDataset' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AutoMl\V1\Dataset', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AutoMl\V1\Model', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataset' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeployModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UndeployModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetAnnotationSpec' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\AnnotationSpec', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDataset' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\Dataset', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\Model', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetModelEvaluation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\ModelEvaluation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListDatasets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDatasets', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\ListDatasetsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListModelEvaluations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getModelEvaluation', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\ListModelEvaluationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListModels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getModel', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\ListModelsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateDataset' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\Dataset', + 'headerParams' => [ + [ + 'keyName' => 'dataset.name', + 'fieldAccessors' => [ + 'getDataset', + 'getName', + ], + ], + ], + ], + 'UpdateModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\Model', + 'headerParams' => [ + [ + 'keyName' => 'model.name', + 'fieldAccessors' => [ + 'getModel', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'annotationSpec' => 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}', + 'dataset' => 'projects/{project}/locations/{location}/datasets/{dataset}', + 'location' => 'projects/{project}/locations/{location}', + 'model' => 'projects/{project}/locations/{location}/models/{model}', + 'modelEvaluation' => 'projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}', + ], + ], + ], +]; diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_rest_client_config.php b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_rest_client_config.php new file mode 100644 index 000000000000..bbff0ff1693d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_rest_client_config.php @@ -0,0 +1,389 @@ + [ + 'google.cloud.automl.v1.AutoMl' => [ + 'CreateDataset' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/datasets', + 'body' => 'dataset', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/models', + 'body' => 'model', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataset' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/datasets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteModel' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeployModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}:deploy', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportData' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/datasets/*}:exportData', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}:export', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAnnotationSpec' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDataset' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/datasets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetModel' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetModelEvaluation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportData' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/datasets/*}:importData', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListDatasets' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/datasets', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListModelEvaluations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'filter', + ], + ], + 'ListModels' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/models', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UndeployModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}:undeploy', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateDataset' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{dataset.name=projects/*/locations/*/datasets/*}', + 'body' => 'dataset', + 'placeholders' => [ + 'dataset.name' => [ + 'getters' => [ + 'getDataset', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateModel' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{model.name=projects/*/locations/*/models/*}', + 'body' => 'model', + 'placeholders' => [ + 'model.name' => [ + 'getters' => [ + 'getModel', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/**}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_client_config.json b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_client_config.json new file mode 100644 index 000000000000..be950636b88e --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.automl.v1.PredictionService": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_2_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_2_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "BatchPredict": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" + }, + "Predict": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" + } + } + } + } +} diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_descriptor_config.php b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_descriptor_config.php new file mode 100644 index 000000000000..df0456c861c3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_descriptor_config.php @@ -0,0 +1,62 @@ + [ + 'google.cloud.automl.v1.PredictionService' => [ + 'BatchPredict' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AutoMl\V1\BatchPredictResult', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'Predict' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\PredictResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'model' => 'projects/{project}/locations/{location}/models/{model}', + ], + ], + ], +]; diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_rest_client_config.php b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_rest_client_config.php new file mode 100644 index 000000000000..e4707be02c0e --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_rest_client_config.php @@ -0,0 +1,195 @@ + [ + 'google.cloud.automl.v1.PredictionService' => [ + 'BatchPredict' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}:batchPredict', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'Predict' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}:predict', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/**}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/AutoMlClientTest.php b/owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/AutoMlClientTest.php new file mode 100644 index 000000000000..4596acf3cb67 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/AutoMlClientTest.php @@ -0,0 +1,1982 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AutoMlClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AutoMlClient($options); + } + + /** @test */ + public function createDatasetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $exampleCount = 1517063674; + $etag = 'etag3123477'; + $expectedResponse = new Dataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setExampleCount($exampleCount); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataset = new Dataset(); + $request = (new CreateDatasetRequest()) + ->setParent($formattedParent) + ->setDataset($dataset); + $response = $gapicClient->createDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/CreateDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDataset(); + $this->assertProtobufEquals($dataset, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDatasetTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createDatasetExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataset = new Dataset(); + $request = (new CreateDatasetRequest()) + ->setParent($formattedParent) + ->setDataset($dataset); + $response = $gapicClient->createDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDatasetTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $datasetId = 'datasetId-2115646910'; + $etag = 'etag3123477'; + $expectedResponse = new Model(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDatasetId($datasetId); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $model = new Model(); + $request = (new CreateModelRequest()) + ->setParent($formattedParent) + ->setModel($model); + $response = $gapicClient->createModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/CreateModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getModel(); + $this->assertProtobufEquals($model, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $model = new Model(); + $request = (new CreateModelRequest()) + ->setParent($formattedParent) + ->setModel($model); + $response = $gapicClient->createModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteDatasetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $request = (new DeleteDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/DeleteDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDatasetTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteDatasetExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $request = (new DeleteDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDatasetTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new DeleteModelRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/DeleteModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new DeleteModelRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deployModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deployModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new DeployModelRequest()) + ->setName($formattedName); + $response = $gapicClient->deployModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/DeployModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deployModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new DeployModelRequest()) + ->setName($formattedName); + $response = $gapicClient->deployModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportDataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $outputConfig = new OutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportDataRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/ExportData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDataTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportDataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $outputConfig = new OutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportDataRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDataTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $outputConfig = new ModelExportOutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportModelRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/ExportModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $outputConfig = new ModelExportOutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportModelRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getAnnotationSpecTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $exampleCount = 1517063674; + $expectedResponse = new AnnotationSpec(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setExampleCount($exampleCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->annotationSpecName('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]'); + $request = (new GetAnnotationSpecRequest()) + ->setName($formattedName); + $response = $gapicClient->getAnnotationSpec($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/GetAnnotationSpec', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAnnotationSpecExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->annotationSpecName('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]'); + $request = (new GetAnnotationSpecRequest()) + ->setName($formattedName); + try { + $gapicClient->getAnnotationSpec($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDatasetTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $exampleCount = 1517063674; + $etag = 'etag3123477'; + $expectedResponse = new Dataset(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setExampleCount($exampleCount); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $request = (new GetDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->getDataset($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/GetDataset', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDatasetExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $request = (new GetDatasetRequest()) + ->setName($formattedName); + try { + $gapicClient->getDataset($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $datasetId = 'datasetId-2115646910'; + $etag = 'etag3123477'; + $expectedResponse = new Model(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDatasetId($datasetId); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new GetModelRequest()) + ->setName($formattedName); + $response = $gapicClient->getModel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/GetModel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getModelExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new GetModelRequest()) + ->setName($formattedName); + try { + $gapicClient->getModel($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getModelEvaluationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $annotationSpecId = 'annotationSpecId60690191'; + $displayName = 'displayName1615086568'; + $evaluatedExampleCount = 277565350; + $expectedResponse = new ModelEvaluation(); + $expectedResponse->setName($name2); + $expectedResponse->setAnnotationSpecId($annotationSpecId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEvaluatedExampleCount($evaluatedExampleCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[MODEL_EVALUATION]'); + $request = (new GetModelEvaluationRequest()) + ->setName($formattedName); + $response = $gapicClient->getModelEvaluation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/GetModelEvaluation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getModelEvaluationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[MODEL_EVALUATION]'); + $request = (new GetModelEvaluationRequest()) + ->setName($formattedName); + try { + $gapicClient->getModelEvaluation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function importDataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $inputConfig = new InputConfig(); + $request = (new ImportDataRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig); + $response = $gapicClient->importData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/ImportData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDataTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importDataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $inputConfig = new InputConfig(); + $request = (new ImportDataRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig); + $response = $gapicClient->importData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDataTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listDatasetsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $datasetsElement = new Dataset(); + $datasets = [ + $datasetsElement, + ]; + $expectedResponse = new ListDatasetsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDatasets($datasets); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListDatasetsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listDatasets($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDatasets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/ListDatasets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDatasetsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListDatasetsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listDatasets($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listModelEvaluationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $modelEvaluationElement = new ModelEvaluation(); + $modelEvaluation = [ + $modelEvaluationElement, + ]; + $expectedResponse = new ListModelEvaluationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setModelEvaluation($modelEvaluation); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $filter = 'filter-1274492040'; + $request = (new ListModelEvaluationsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + $response = $gapicClient->listModelEvaluations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getModelEvaluation()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/ListModelEvaluations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getFilter(); + $this->assertProtobufEquals($filter, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listModelEvaluationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $filter = 'filter-1274492040'; + $request = (new ListModelEvaluationsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + try { + $gapicClient->listModelEvaluations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listModelsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $modelElement = new Model(); + $model = [ + $modelElement, + ]; + $expectedResponse = new ListModelsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setModel($model); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListModelsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listModels($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getModel()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/ListModels', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listModelsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListModelsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listModels($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function undeployModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeployModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new UndeployModelRequest()) + ->setName($formattedName); + $response = $gapicClient->undeployModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/UndeployModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function undeployModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new UndeployModelRequest()) + ->setName($formattedName); + $response = $gapicClient->undeployModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateDatasetTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $exampleCount = 1517063674; + $etag = 'etag3123477'; + $expectedResponse = new Dataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setExampleCount($exampleCount); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $dataset = new Dataset(); + $updateMask = new FieldMask(); + $request = (new UpdateDatasetRequest()) + ->setDataset($dataset) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateDataset($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/UpdateDataset', $actualFuncCall); + $actualValue = $actualRequestObject->getDataset(); + $this->assertProtobufEquals($dataset, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDatasetExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $dataset = new Dataset(); + $updateMask = new FieldMask(); + $request = (new UpdateDatasetRequest()) + ->setDataset($dataset) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateDataset($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $datasetId = 'datasetId-2115646910'; + $etag = 'etag3123477'; + $expectedResponse = new Model(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDatasetId($datasetId); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $model = new Model(); + $updateMask = new FieldMask(); + $request = (new UpdateModelRequest()) + ->setModel($model) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateModel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/UpdateModel', $actualFuncCall); + $actualValue = $actualRequestObject->getModel(); + $this->assertProtobufEquals($model, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateModelExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $model = new Model(); + $updateMask = new FieldMask(); + $request = (new UpdateModelRequest()) + ->setModel($model) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateModel($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDatasetAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $exampleCount = 1517063674; + $etag = 'etag3123477'; + $expectedResponse = new Dataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setExampleCount($exampleCount); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataset = new Dataset(); + $request = (new CreateDatasetRequest()) + ->setParent($formattedParent) + ->setDataset($dataset); + $response = $gapicClient->createDatasetAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/CreateDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDataset(); + $this->assertProtobufEquals($dataset, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDatasetTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/PredictionServiceClientTest.php b/owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/PredictionServiceClientTest.php new file mode 100644 index 000000000000..1baca4b26f48 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/PredictionServiceClientTest.php @@ -0,0 +1,370 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PredictionServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PredictionServiceClient($options); + } + + /** @test */ + public function batchPredictTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchPredictTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchPredictResult(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchPredictTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $inputConfig = new BatchPredictInputConfig(); + $inputConfigGcsSource = new GcsSource(); + $gcsSourceInputUris = []; + $inputConfigGcsSource->setInputUris($gcsSourceInputUris); + $inputConfig->setGcsSource($inputConfigGcsSource); + $outputConfig = new BatchPredictOutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new BatchPredictRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig) + ->setOutputConfig($outputConfig); + $response = $gapicClient->batchPredict($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.PredictionService/BatchPredict', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchPredictTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchPredictExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchPredictTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $inputConfig = new BatchPredictInputConfig(); + $inputConfigGcsSource = new GcsSource(); + $gcsSourceInputUris = []; + $inputConfigGcsSource->setInputUris($gcsSourceInputUris); + $inputConfig->setGcsSource($inputConfigGcsSource); + $outputConfig = new BatchPredictOutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new BatchPredictRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig) + ->setOutputConfig($outputConfig); + $response = $gapicClient->batchPredict($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchPredictTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function predictTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new PredictResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $payload = new ExamplePayload(); + $request = (new PredictRequest()) + ->setName($formattedName) + ->setPayload($payload); + $response = $gapicClient->predict($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.PredictionService/Predict', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getPayload(); + $this->assertProtobufEquals($payload, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function predictExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $payload = new ExamplePayload(); + $request = (new PredictRequest()) + ->setName($formattedName) + ->setPayload($payload); + try { + $gapicClient->predict($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchPredictAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchPredictTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchPredictResult(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchPredictTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $inputConfig = new BatchPredictInputConfig(); + $inputConfigGcsSource = new GcsSource(); + $gcsSourceInputUris = []; + $inputConfigGcsSource->setInputUris($gcsSourceInputUris); + $inputConfig->setGcsSource($inputConfigGcsSource); + $outputConfig = new BatchPredictOutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new BatchPredictRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig) + ->setOutputConfig($outputConfig); + $response = $gapicClient->batchPredictAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.PredictionService/BatchPredict', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchPredictTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupdr.php b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupdr.php new file mode 100644 index 000000000000..fde6b0d8cfbd Binary files /dev/null and b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupdr.php differ diff --git a/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupplan.php b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupplan.php new file mode 100644 index 000000000000..6bfd440367ce Binary files /dev/null and b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupplan.php differ diff --git a/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupplanassociation.php b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupplanassociation.php new file mode 100644 index 000000000000..f2c6692f67f7 Binary files /dev/null and b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupplanassociation.php differ diff --git a/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupvault.php b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupvault.php new file mode 100644 index 000000000000..23fe82324104 Binary files /dev/null and b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupvault.php differ diff --git a/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/BackupvaultBa.php b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/BackupvaultBa.php new file mode 100644 index 000000000000..06aa2a0bd464 Binary files /dev/null and b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/BackupvaultBa.php differ diff --git a/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/BackupvaultGce.php b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/BackupvaultGce.php new file mode 100644 index 000000000000..6a830e43e0cc Binary files /dev/null and b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/BackupvaultGce.php differ diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AcceleratorConfig.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AcceleratorConfig.php new file mode 100644 index 000000000000..5a0f3dce0b04 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AcceleratorConfig.php @@ -0,0 +1,130 @@ +google.cloud.backupdr.v1.AcceleratorConfig + */ +class AcceleratorConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Full or partial URL of the accelerator type resource to attach to + * this instance. + * + * Generated from protobuf field optional string accelerator_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $accelerator_type = null; + /** + * Optional. The number of the guest accelerator cards exposed to this + * instance. + * + * Generated from protobuf field optional int32 accelerator_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $accelerator_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $accelerator_type + * Optional. Full or partial URL of the accelerator type resource to attach to + * this instance. + * @type int $accelerator_count + * Optional. The number of the guest accelerator cards exposed to this + * instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Full or partial URL of the accelerator type resource to attach to + * this instance. + * + * Generated from protobuf field optional string accelerator_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAcceleratorType() + { + return isset($this->accelerator_type) ? $this->accelerator_type : ''; + } + + public function hasAcceleratorType() + { + return isset($this->accelerator_type); + } + + public function clearAcceleratorType() + { + unset($this->accelerator_type); + } + + /** + * Optional. Full or partial URL of the accelerator type resource to attach to + * this instance. + * + * Generated from protobuf field optional string accelerator_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAcceleratorType($var) + { + GPBUtil::checkString($var, True); + $this->accelerator_type = $var; + + return $this; + } + + /** + * Optional. The number of the guest accelerator cards exposed to this + * instance. + * + * Generated from protobuf field optional int32 accelerator_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAcceleratorCount() + { + return isset($this->accelerator_count) ? $this->accelerator_count : 0; + } + + public function hasAcceleratorCount() + { + return isset($this->accelerator_count); + } + + public function clearAcceleratorCount() + { + unset($this->accelerator_count); + } + + /** + * Optional. The number of the guest accelerator cards exposed to this + * instance. + * + * Generated from protobuf field optional int32 accelerator_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAcceleratorCount($var) + { + GPBUtil::checkInt32($var); + $this->accelerator_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AccessConfig.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AccessConfig.php new file mode 100644 index 000000000000..325e5e49dd31 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AccessConfig.php @@ -0,0 +1,406 @@ +google.cloud.backupdr.v1.AccessConfig + */ +class AccessConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. In accessConfigs (IPv4), the + * default and only option is ONE_TO_ONE_NAT. In + * ipv6AccessConfigs, the default and only option is + * DIRECT_IPV6. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.AccessType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = null; + /** + * Optional. The name of this access configuration. + * + * Generated from protobuf field optional string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = null; + /** + * Optional. The external IP address of this access configuration. + * + * Generated from protobuf field optional string external_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_ip = null; + /** + * Optional. The external IPv6 address of this access configuration. + * + * Generated from protobuf field optional string external_ipv6 = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_ipv6 = null; + /** + * Optional. The prefix length of the external IPv6 range. + * + * Generated from protobuf field optional int32 external_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_ipv6_prefix_length = null; + /** + * Optional. Specifies whether a public DNS 'PTR' record should be created to + * map the external IP address of the instance to a DNS domain name. + * + * Generated from protobuf field optional bool set_public_ptr = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $set_public_ptr = null; + /** + * Optional. The DNS domain name for the public PTR record. + * + * Generated from protobuf field optional string public_ptr_domain_name = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $public_ptr_domain_name = null; + /** + * Optional. This signifies the networking tier used for configuring this + * access + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.NetworkTier network_tier = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_tier = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Optional. In accessConfigs (IPv4), the + * default and only option is ONE_TO_ONE_NAT. In + * ipv6AccessConfigs, the default and only option is + * DIRECT_IPV6. + * @type string $name + * Optional. The name of this access configuration. + * @type string $external_ip + * Optional. The external IP address of this access configuration. + * @type string $external_ipv6 + * Optional. The external IPv6 address of this access configuration. + * @type int $external_ipv6_prefix_length + * Optional. The prefix length of the external IPv6 range. + * @type bool $set_public_ptr + * Optional. Specifies whether a public DNS 'PTR' record should be created to + * map the external IP address of the instance to a DNS domain name. + * @type string $public_ptr_domain_name + * Optional. The DNS domain name for the public PTR record. + * @type int $network_tier + * Optional. This signifies the networking tier used for configuring this + * access + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. In accessConfigs (IPv4), the + * default and only option is ONE_TO_ONE_NAT. In + * ipv6AccessConfigs, the default and only option is + * DIRECT_IPV6. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.AccessType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return isset($this->type) ? $this->type : 0; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * Optional. In accessConfigs (IPv4), the + * default and only option is ONE_TO_ONE_NAT. In + * ipv6AccessConfigs, the default and only option is + * DIRECT_IPV6. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.AccessType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AccessConfig\AccessType::class); + $this->type = $var; + + return $this; + } + + /** + * Optional. The name of this access configuration. + * + * Generated from protobuf field optional string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Optional. The name of this access configuration. + * + * Generated from protobuf field optional string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The external IP address of this access configuration. + * + * Generated from protobuf field optional string external_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getExternalIp() + { + return isset($this->external_ip) ? $this->external_ip : ''; + } + + public function hasExternalIp() + { + return isset($this->external_ip); + } + + public function clearExternalIp() + { + unset($this->external_ip); + } + + /** + * Optional. The external IP address of this access configuration. + * + * Generated from protobuf field optional string external_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setExternalIp($var) + { + GPBUtil::checkString($var, True); + $this->external_ip = $var; + + return $this; + } + + /** + * Optional. The external IPv6 address of this access configuration. + * + * Generated from protobuf field optional string external_ipv6 = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getExternalIpv6() + { + return isset($this->external_ipv6) ? $this->external_ipv6 : ''; + } + + public function hasExternalIpv6() + { + return isset($this->external_ipv6); + } + + public function clearExternalIpv6() + { + unset($this->external_ipv6); + } + + /** + * Optional. The external IPv6 address of this access configuration. + * + * Generated from protobuf field optional string external_ipv6 = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setExternalIpv6($var) + { + GPBUtil::checkString($var, True); + $this->external_ipv6 = $var; + + return $this; + } + + /** + * Optional. The prefix length of the external IPv6 range. + * + * Generated from protobuf field optional int32 external_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getExternalIpv6PrefixLength() + { + return isset($this->external_ipv6_prefix_length) ? $this->external_ipv6_prefix_length : 0; + } + + public function hasExternalIpv6PrefixLength() + { + return isset($this->external_ipv6_prefix_length); + } + + public function clearExternalIpv6PrefixLength() + { + unset($this->external_ipv6_prefix_length); + } + + /** + * Optional. The prefix length of the external IPv6 range. + * + * Generated from protobuf field optional int32 external_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setExternalIpv6PrefixLength($var) + { + GPBUtil::checkInt32($var); + $this->external_ipv6_prefix_length = $var; + + return $this; + } + + /** + * Optional. Specifies whether a public DNS 'PTR' record should be created to + * map the external IP address of the instance to a DNS domain name. + * + * Generated from protobuf field optional bool set_public_ptr = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSetPublicPtr() + { + return isset($this->set_public_ptr) ? $this->set_public_ptr : false; + } + + public function hasSetPublicPtr() + { + return isset($this->set_public_ptr); + } + + public function clearSetPublicPtr() + { + unset($this->set_public_ptr); + } + + /** + * Optional. Specifies whether a public DNS 'PTR' record should be created to + * map the external IP address of the instance to a DNS domain name. + * + * Generated from protobuf field optional bool set_public_ptr = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSetPublicPtr($var) + { + GPBUtil::checkBool($var); + $this->set_public_ptr = $var; + + return $this; + } + + /** + * Optional. The DNS domain name for the public PTR record. + * + * Generated from protobuf field optional string public_ptr_domain_name = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPublicPtrDomainName() + { + return isset($this->public_ptr_domain_name) ? $this->public_ptr_domain_name : ''; + } + + public function hasPublicPtrDomainName() + { + return isset($this->public_ptr_domain_name); + } + + public function clearPublicPtrDomainName() + { + unset($this->public_ptr_domain_name); + } + + /** + * Optional. The DNS domain name for the public PTR record. + * + * Generated from protobuf field optional string public_ptr_domain_name = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPublicPtrDomainName($var) + { + GPBUtil::checkString($var, True); + $this->public_ptr_domain_name = $var; + + return $this; + } + + /** + * Optional. This signifies the networking tier used for configuring this + * access + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.NetworkTier network_tier = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getNetworkTier() + { + return isset($this->network_tier) ? $this->network_tier : 0; + } + + public function hasNetworkTier() + { + return isset($this->network_tier); + } + + public function clearNetworkTier() + { + unset($this->network_tier); + } + + /** + * Optional. This signifies the networking tier used for configuring this + * access + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.NetworkTier network_tier = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setNetworkTier($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AccessConfig\NetworkTier::class); + $this->network_tier = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AccessConfig/AccessType.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AccessConfig/AccessType.php new file mode 100644 index 000000000000..aedd6203972c --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AccessConfig/AccessType.php @@ -0,0 +1,64 @@ +google.cloud.backupdr.v1.AccessConfig.AccessType + */ +class AccessType +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ACCESS_TYPE_UNSPECIFIED = 0; + */ + const ACCESS_TYPE_UNSPECIFIED = 0; + /** + * ONE_TO_ONE_NAT + * + * Generated from protobuf enum ONE_TO_ONE_NAT = 1; + */ + const ONE_TO_ONE_NAT = 1; + /** + * Direct IPv6 access. + * + * Generated from protobuf enum DIRECT_IPV6 = 2; + */ + const DIRECT_IPV6 = 2; + + private static $valueToName = [ + self::ACCESS_TYPE_UNSPECIFIED => 'ACCESS_TYPE_UNSPECIFIED', + self::ONE_TO_ONE_NAT => 'ONE_TO_ONE_NAT', + self::DIRECT_IPV6 => 'DIRECT_IPV6', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AccessType::class, \Google\Cloud\BackupDR\V1\AccessConfig_AccessType::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AccessConfig/NetworkTier.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AccessConfig/NetworkTier.php new file mode 100644 index 000000000000..181b61710791 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AccessConfig/NetworkTier.php @@ -0,0 +1,66 @@ +google.cloud.backupdr.v1.AccessConfig.NetworkTier + */ +class NetworkTier +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum NETWORK_TIER_UNSPECIFIED = 0; + */ + const NETWORK_TIER_UNSPECIFIED = 0; + /** + * High quality, Google-grade network tier, support for all networking + * products. + * + * Generated from protobuf enum PREMIUM = 1; + */ + const PREMIUM = 1; + /** + * Public internet quality, only limited support for other networking + * products. + * + * Generated from protobuf enum STANDARD = 2; + */ + const STANDARD = 2; + + private static $valueToName = [ + self::NETWORK_TIER_UNSPECIFIED => 'NETWORK_TIER_UNSPECIFIED', + self::PREMIUM => 'PREMIUM', + self::STANDARD => 'STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkTier::class, \Google\Cloud\BackupDR\V1\AccessConfig_NetworkTier::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AdvancedMachineFeatures.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AdvancedMachineFeatures.php new file mode 100644 index 000000000000..29901b19bd41 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AdvancedMachineFeatures.php @@ -0,0 +1,241 @@ +google.cloud.backupdr.v1.AdvancedMachineFeatures + */ +class AdvancedMachineFeatures extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether to enable nested virtualization or not (default is + * false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_nested_virtualization = null; + /** + * Optional. The number of threads per physical core. To disable simultaneous + * multithreading (SMT) set this to 1. If unset, the maximum number + * of threads supported per core by the underlying processor is + * assumed. + * + * Generated from protobuf field optional int32 threads_per_core = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $threads_per_core = null; + /** + * Optional. The number of physical cores to expose to an instance. Multiply + * by the number of threads per core to compute the total number of virtual + * CPUs to expose to the instance. If unset, the number of cores is + * inferred from the instance's nominal CPU count and the underlying + * platform's SMT width. + * + * Generated from protobuf field optional int32 visible_core_count = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $visible_core_count = null; + /** + * Optional. Whether to enable UEFI networking for instance creation. + * + * Generated from protobuf field optional bool enable_uefi_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_uefi_networking = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_nested_virtualization + * Optional. Whether to enable nested virtualization or not (default is + * false). + * @type int $threads_per_core + * Optional. The number of threads per physical core. To disable simultaneous + * multithreading (SMT) set this to 1. If unset, the maximum number + * of threads supported per core by the underlying processor is + * assumed. + * @type int $visible_core_count + * Optional. The number of physical cores to expose to an instance. Multiply + * by the number of threads per core to compute the total number of virtual + * CPUs to expose to the instance. If unset, the number of cores is + * inferred from the instance's nominal CPU count and the underlying + * platform's SMT width. + * @type bool $enable_uefi_networking + * Optional. Whether to enable UEFI networking for instance creation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether to enable nested virtualization or not (default is + * false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableNestedVirtualization() + { + return isset($this->enable_nested_virtualization) ? $this->enable_nested_virtualization : false; + } + + public function hasEnableNestedVirtualization() + { + return isset($this->enable_nested_virtualization); + } + + public function clearEnableNestedVirtualization() + { + unset($this->enable_nested_virtualization); + } + + /** + * Optional. Whether to enable nested virtualization or not (default is + * false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableNestedVirtualization($var) + { + GPBUtil::checkBool($var); + $this->enable_nested_virtualization = $var; + + return $this; + } + + /** + * Optional. The number of threads per physical core. To disable simultaneous + * multithreading (SMT) set this to 1. If unset, the maximum number + * of threads supported per core by the underlying processor is + * assumed. + * + * Generated from protobuf field optional int32 threads_per_core = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getThreadsPerCore() + { + return isset($this->threads_per_core) ? $this->threads_per_core : 0; + } + + public function hasThreadsPerCore() + { + return isset($this->threads_per_core); + } + + public function clearThreadsPerCore() + { + unset($this->threads_per_core); + } + + /** + * Optional. The number of threads per physical core. To disable simultaneous + * multithreading (SMT) set this to 1. If unset, the maximum number + * of threads supported per core by the underlying processor is + * assumed. + * + * Generated from protobuf field optional int32 threads_per_core = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setThreadsPerCore($var) + { + GPBUtil::checkInt32($var); + $this->threads_per_core = $var; + + return $this; + } + + /** + * Optional. The number of physical cores to expose to an instance. Multiply + * by the number of threads per core to compute the total number of virtual + * CPUs to expose to the instance. If unset, the number of cores is + * inferred from the instance's nominal CPU count and the underlying + * platform's SMT width. + * + * Generated from protobuf field optional int32 visible_core_count = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getVisibleCoreCount() + { + return isset($this->visible_core_count) ? $this->visible_core_count : 0; + } + + public function hasVisibleCoreCount() + { + return isset($this->visible_core_count); + } + + public function clearVisibleCoreCount() + { + unset($this->visible_core_count); + } + + /** + * Optional. The number of physical cores to expose to an instance. Multiply + * by the number of threads per core to compute the total number of virtual + * CPUs to expose to the instance. If unset, the number of cores is + * inferred from the instance's nominal CPU count and the underlying + * platform's SMT width. + * + * Generated from protobuf field optional int32 visible_core_count = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setVisibleCoreCount($var) + { + GPBUtil::checkInt32($var); + $this->visible_core_count = $var; + + return $this; + } + + /** + * Optional. Whether to enable UEFI networking for instance creation. + * + * Generated from protobuf field optional bool enable_uefi_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableUefiNetworking() + { + return isset($this->enable_uefi_networking) ? $this->enable_uefi_networking : false; + } + + public function hasEnableUefiNetworking() + { + return isset($this->enable_uefi_networking); + } + + public function clearEnableUefiNetworking() + { + unset($this->enable_uefi_networking); + } + + /** + * Optional. Whether to enable UEFI networking for instance creation. + * + * Generated from protobuf field optional bool enable_uefi_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableUefiNetworking($var) + { + GPBUtil::checkBool($var); + $this->enable_uefi_networking = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AliasIpRange.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AliasIpRange.php new file mode 100644 index 000000000000..c7fa6c80788b --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AliasIpRange.php @@ -0,0 +1,129 @@ +google.cloud.backupdr.v1.AliasIpRange + */ +class AliasIpRange extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The IP alias ranges to allocate for this interface. + * + * Generated from protobuf field optional string ip_cidr_range = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ip_cidr_range = null; + /** + * Optional. The name of a subnetwork secondary IP range from which to + * allocate an IP alias range. If not specified, the primary range of the + * subnetwork is used. + * + * Generated from protobuf field optional string subnetwork_range_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subnetwork_range_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip_cidr_range + * Optional. The IP alias ranges to allocate for this interface. + * @type string $subnetwork_range_name + * Optional. The name of a subnetwork secondary IP range from which to + * allocate an IP alias range. If not specified, the primary range of the + * subnetwork is used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The IP alias ranges to allocate for this interface. + * + * Generated from protobuf field optional string ip_cidr_range = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getIpCidrRange() + { + return isset($this->ip_cidr_range) ? $this->ip_cidr_range : ''; + } + + public function hasIpCidrRange() + { + return isset($this->ip_cidr_range); + } + + public function clearIpCidrRange() + { + unset($this->ip_cidr_range); + } + + /** + * Optional. The IP alias ranges to allocate for this interface. + * + * Generated from protobuf field optional string ip_cidr_range = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setIpCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_cidr_range = $var; + + return $this; + } + + /** + * Optional. The name of a subnetwork secondary IP range from which to + * allocate an IP alias range. If not specified, the primary range of the + * subnetwork is used. + * + * Generated from protobuf field optional string subnetwork_range_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubnetworkRangeName() + { + return isset($this->subnetwork_range_name) ? $this->subnetwork_range_name : ''; + } + + public function hasSubnetworkRangeName() + { + return isset($this->subnetwork_range_name); + } + + public function clearSubnetworkRangeName() + { + unset($this->subnetwork_range_name); + } + + /** + * Optional. The name of a subnetwork secondary IP range from which to + * allocate an IP alias range. If not specified, the primary range of the + * subnetwork is used. + * + * Generated from protobuf field optional string subnetwork_range_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubnetworkRangeName($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork_range_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AllocationAffinity.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AllocationAffinity.php new file mode 100644 index 000000000000..6eb73d7b0b92 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AllocationAffinity.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.AllocationAffinity + */ +class AllocationAffinity extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies the type of reservation from which this instance can + * consume + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $consume_allocation_type = null; + /** + * Optional. Corresponds to the label key of a reservation resource. + * + * Generated from protobuf field optional string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key = null; + /** + * Optional. Corresponds to the label values of a reservation resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $consume_allocation_type + * Optional. Specifies the type of reservation from which this instance can + * consume + * @type string $key + * Optional. Corresponds to the label key of a reservation resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * Optional. Corresponds to the label values of a reservation resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies the type of reservation from which this instance can + * consume + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getConsumeAllocationType() + { + return isset($this->consume_allocation_type) ? $this->consume_allocation_type : 0; + } + + public function hasConsumeAllocationType() + { + return isset($this->consume_allocation_type); + } + + public function clearConsumeAllocationType() + { + unset($this->consume_allocation_type); + } + + /** + * Optional. Specifies the type of reservation from which this instance can + * consume + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setConsumeAllocationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AllocationAffinity\Type::class); + $this->consume_allocation_type = $var; + + return $this; + } + + /** + * Optional. Corresponds to the label key of a reservation resource. + * + * Generated from protobuf field optional string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Optional. Corresponds to the label key of a reservation resource. + * + * Generated from protobuf field optional string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. Corresponds to the label values of a reservation resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Optional. Corresponds to the label values of a reservation resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AllocationAffinity/Type.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AllocationAffinity/Type.php new file mode 100644 index 000000000000..f6b1ff173e0d --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AllocationAffinity/Type.php @@ -0,0 +1,72 @@ +google.cloud.backupdr.v1.AllocationAffinity.Type + */ +class Type +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Do not consume from any allocated capacity. + * + * Generated from protobuf enum NO_RESERVATION = 1; + */ + const NO_RESERVATION = 1; + /** + * Consume any allocation available. + * + * Generated from protobuf enum ANY_RESERVATION = 2; + */ + const ANY_RESERVATION = 2; + /** + * Must consume from a specific reservation. Must specify key value fields + * for specifying the reservations. + * + * Generated from protobuf enum SPECIFIC_RESERVATION = 3; + */ + const SPECIFIC_RESERVATION = 3; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::NO_RESERVATION => 'NO_RESERVATION', + self::ANY_RESERVATION => 'ANY_RESERVATION', + self::SPECIFIC_RESERVATION => 'SPECIFIC_RESERVATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\BackupDR\V1\AllocationAffinity_Type::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk.php new file mode 100644 index 000000000000..6d06c12af671 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk.php @@ -0,0 +1,804 @@ +google.cloud.backupdr.v1.AttachedDisk + */ +class AttachedDisk extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies the parameters to initialize this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.InitializeParams initialize_params = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $initialize_params = null; + /** + * Optional. This is used as an identifier for the disks. This is the unique + * name has to provided to modify disk parameters like disk_name and + * replica_zones (in case of RePDs) + * + * Generated from protobuf field optional string device_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $device_name = null; + /** + * Optional. Type of the resource. + * + * Generated from protobuf field optional string kind = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $kind = null; + /** + * Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType disk_type_deprecated = 6 [deprecated = true]; + * @deprecated + */ + protected $disk_type_deprecated = null; + /** + * Optional. The mode in which to attach this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = null; + /** + * Optional. Specifies a valid partial or full URL to an existing Persistent + * Disk resource. + * + * Generated from protobuf field optional string source = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $source = null; + /** + * Optional. A zero-based index to this disk, where 0 is reserved for the + * boot disk. + * + * Generated from protobuf field optional int64 index = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $index = null; + /** + * Optional. Indicates that this is a boot disk. The virtual machine will use + * the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boot = null; + /** + * Optional. Specifies whether the disk will be auto-deleted when the instance + * is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $auto_delete = null; + /** + * Optional. Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string license = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $license; + /** + * Optional. Specifies the disk interface to use for attaching this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskInterface disk_interface = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_interface = null; + /** + * Optional. A list of features to enable on the guest operating system. + * Applicable only for bootable images. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.GuestOsFeature guest_os_feature = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $guest_os_feature; + /** + * Optional. Encrypts or decrypts a disk using a customer-supplied + * encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey disk_encryption_key = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_encryption_key = null; + /** + * Optional. The size of the disk in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_size_gb = null; + /** + * Optional. Output only. The state of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskSavedState saved_state = 17 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $saved_state = null; + /** + * Optional. Output only. The URI of the disk type resource. For example: + * projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + * + * Generated from protobuf field optional string disk_type = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $disk_type = null; + /** + * Optional. Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType type = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BackupDR\V1\AttachedDisk\InitializeParams $initialize_params + * Optional. Specifies the parameters to initialize this disk. + * @type string $device_name + * Optional. This is used as an identifier for the disks. This is the unique + * name has to provided to modify disk parameters like disk_name and + * replica_zones (in case of RePDs) + * @type string $kind + * Optional. Type of the resource. + * @type int $disk_type_deprecated + * Specifies the type of the disk. + * @type int $mode + * Optional. The mode in which to attach this disk. + * @type string $source + * Optional. Specifies a valid partial or full URL to an existing Persistent + * Disk resource. + * @type int|string $index + * Optional. A zero-based index to this disk, where 0 is reserved for the + * boot disk. + * @type bool $boot + * Optional. Indicates that this is a boot disk. The virtual machine will use + * the first partition of the disk for its root filesystem. + * @type bool $auto_delete + * Optional. Specifies whether the disk will be auto-deleted when the instance + * is deleted (but not when the disk is detached from the instance). + * @type array|\Google\Protobuf\Internal\RepeatedField $license + * Optional. Any valid publicly visible licenses. + * @type int $disk_interface + * Optional. Specifies the disk interface to use for attaching this disk. + * @type array<\Google\Cloud\BackupDR\V1\GuestOsFeature>|\Google\Protobuf\Internal\RepeatedField $guest_os_feature + * Optional. A list of features to enable on the guest operating system. + * Applicable only for bootable images. + * @type \Google\Cloud\BackupDR\V1\CustomerEncryptionKey $disk_encryption_key + * Optional. Encrypts or decrypts a disk using a customer-supplied + * encryption key. + * @type int|string $disk_size_gb + * Optional. The size of the disk in GB. + * @type int $saved_state + * Optional. Output only. The state of the disk. + * @type string $disk_type + * Optional. Output only. The URI of the disk type resource. For example: + * projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + * @type int $type + * Optional. Specifies the type of the disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies the parameters to initialize this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.InitializeParams initialize_params = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\AttachedDisk\InitializeParams|null + */ + public function getInitializeParams() + { + return $this->initialize_params; + } + + public function hasInitializeParams() + { + return isset($this->initialize_params); + } + + public function clearInitializeParams() + { + unset($this->initialize_params); + } + + /** + * Optional. Specifies the parameters to initialize this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.InitializeParams initialize_params = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\AttachedDisk\InitializeParams $var + * @return $this + */ + public function setInitializeParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\AttachedDisk\InitializeParams::class); + $this->initialize_params = $var; + + return $this; + } + + /** + * Optional. This is used as an identifier for the disks. This is the unique + * name has to provided to modify disk parameters like disk_name and + * replica_zones (in case of RePDs) + * + * Generated from protobuf field optional string device_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDeviceName() + { + return isset($this->device_name) ? $this->device_name : ''; + } + + public function hasDeviceName() + { + return isset($this->device_name); + } + + public function clearDeviceName() + { + unset($this->device_name); + } + + /** + * Optional. This is used as an identifier for the disks. This is the unique + * name has to provided to modify disk parameters like disk_name and + * replica_zones (in case of RePDs) + * + * Generated from protobuf field optional string device_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->device_name = $var; + + return $this; + } + + /** + * Optional. Type of the resource. + * + * Generated from protobuf field optional string kind = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKind() + { + return isset($this->kind) ? $this->kind : ''; + } + + public function hasKind() + { + return isset($this->kind); + } + + public function clearKind() + { + unset($this->kind); + } + + /** + * Optional. Type of the resource. + * + * Generated from protobuf field optional string kind = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkString($var, True); + $this->kind = $var; + + return $this; + } + + /** + * Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType disk_type_deprecated = 6 [deprecated = true]; + * @return int + * @deprecated + */ + public function getDiskTypeDeprecated() + { + @trigger_error('disk_type_deprecated is deprecated.', E_USER_DEPRECATED); + return isset($this->disk_type_deprecated) ? $this->disk_type_deprecated : 0; + } + + public function hasDiskTypeDeprecated() + { + @trigger_error('disk_type_deprecated is deprecated.', E_USER_DEPRECATED); + return isset($this->disk_type_deprecated); + } + + public function clearDiskTypeDeprecated() + { + @trigger_error('disk_type_deprecated is deprecated.', E_USER_DEPRECATED); + unset($this->disk_type_deprecated); + } + + /** + * Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType disk_type_deprecated = 6 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setDiskTypeDeprecated($var) + { + @trigger_error('disk_type_deprecated is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AttachedDisk\DiskType::class); + $this->disk_type_deprecated = $var; + + return $this; + } + + /** + * Optional. The mode in which to attach this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMode() + { + return isset($this->mode) ? $this->mode : 0; + } + + public function hasMode() + { + return isset($this->mode); + } + + public function clearMode() + { + unset($this->mode); + } + + /** + * Optional. The mode in which to attach this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AttachedDisk\DiskMode::class); + $this->mode = $var; + + return $this; + } + + /** + * Optional. Specifies a valid partial or full URL to an existing Persistent + * Disk resource. + * + * Generated from protobuf field optional string source = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSource() + { + return isset($this->source) ? $this->source : ''; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * Optional. Specifies a valid partial or full URL to an existing Persistent + * Disk resource. + * + * Generated from protobuf field optional string source = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * Optional. A zero-based index to this disk, where 0 is reserved for the + * boot disk. + * + * Generated from protobuf field optional int64 index = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getIndex() + { + return isset($this->index) ? $this->index : 0; + } + + public function hasIndex() + { + return isset($this->index); + } + + public function clearIndex() + { + unset($this->index); + } + + /** + * Optional. A zero-based index to this disk, where 0 is reserved for the + * boot disk. + * + * Generated from protobuf field optional int64 index = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt64($var); + $this->index = $var; + + return $this; + } + + /** + * Optional. Indicates that this is a boot disk. The virtual machine will use + * the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getBoot() + { + return isset($this->boot) ? $this->boot : false; + } + + public function hasBoot() + { + return isset($this->boot); + } + + public function clearBoot() + { + unset($this->boot); + } + + /** + * Optional. Indicates that this is a boot disk. The virtual machine will use + * the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setBoot($var) + { + GPBUtil::checkBool($var); + $this->boot = $var; + + return $this; + } + + /** + * Optional. Specifies whether the disk will be auto-deleted when the instance + * is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAutoDelete() + { + return isset($this->auto_delete) ? $this->auto_delete : false; + } + + public function hasAutoDelete() + { + return isset($this->auto_delete); + } + + public function clearAutoDelete() + { + unset($this->auto_delete); + } + + /** + * Optional. Specifies whether the disk will be auto-deleted when the instance + * is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAutoDelete($var) + { + GPBUtil::checkBool($var); + $this->auto_delete = $var; + + return $this; + } + + /** + * Optional. Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string license = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicense() + { + return $this->license; + } + + /** + * Optional. Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string license = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicense($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->license = $arr; + + return $this; + } + + /** + * Optional. Specifies the disk interface to use for attaching this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskInterface disk_interface = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDiskInterface() + { + return isset($this->disk_interface) ? $this->disk_interface : 0; + } + + public function hasDiskInterface() + { + return isset($this->disk_interface); + } + + public function clearDiskInterface() + { + unset($this->disk_interface); + } + + /** + * Optional. Specifies the disk interface to use for attaching this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskInterface disk_interface = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDiskInterface($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AttachedDisk\DiskInterface::class); + $this->disk_interface = $var; + + return $this; + } + + /** + * Optional. A list of features to enable on the guest operating system. + * Applicable only for bootable images. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.GuestOsFeature guest_os_feature = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestOsFeature() + { + return $this->guest_os_feature; + } + + /** + * Optional. A list of features to enable on the guest operating system. + * Applicable only for bootable images. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.GuestOsFeature guest_os_feature = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\GuestOsFeature>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestOsFeature($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\GuestOsFeature::class); + $this->guest_os_feature = $arr; + + return $this; + } + + /** + * Optional. Encrypts or decrypts a disk using a customer-supplied + * encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey disk_encryption_key = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\CustomerEncryptionKey|null + */ + public function getDiskEncryptionKey() + { + return $this->disk_encryption_key; + } + + public function hasDiskEncryptionKey() + { + return isset($this->disk_encryption_key); + } + + public function clearDiskEncryptionKey() + { + unset($this->disk_encryption_key); + } + + /** + * Optional. Encrypts or decrypts a disk using a customer-supplied + * encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey disk_encryption_key = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setDiskEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\CustomerEncryptionKey::class); + $this->disk_encryption_key = $var; + + return $this; + } + + /** + * Optional. The size of the disk in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getDiskSizeGb() + { + return isset($this->disk_size_gb) ? $this->disk_size_gb : 0; + } + + public function hasDiskSizeGb() + { + return isset($this->disk_size_gb); + } + + public function clearDiskSizeGb() + { + unset($this->disk_size_gb); + } + + /** + * Optional. The size of the disk in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->disk_size_gb = $var; + + return $this; + } + + /** + * Optional. Output only. The state of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskSavedState saved_state = 17 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSavedState() + { + return isset($this->saved_state) ? $this->saved_state : 0; + } + + public function hasSavedState() + { + return isset($this->saved_state); + } + + public function clearSavedState() + { + unset($this->saved_state); + } + + /** + * Optional. Output only. The state of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskSavedState saved_state = 17 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSavedState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AttachedDisk\DiskSavedState::class); + $this->saved_state = $var; + + return $this; + } + + /** + * Optional. Output only. The URI of the disk type resource. For example: + * projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + * + * Generated from protobuf field optional string disk_type = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDiskType() + { + return isset($this->disk_type) ? $this->disk_type : ''; + } + + public function hasDiskType() + { + return isset($this->disk_type); + } + + public function clearDiskType() + { + unset($this->disk_type); + } + + /** + * Optional. Output only. The URI of the disk type resource. For example: + * projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + * + * Generated from protobuf field optional string disk_type = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDiskType($var) + { + GPBUtil::checkString($var, True); + $this->disk_type = $var; + + return $this; + } + + /** + * Optional. Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType type = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return isset($this->type) ? $this->type : 0; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * Optional. Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType type = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AttachedDisk\DiskType::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskInterface.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskInterface.php new file mode 100644 index 000000000000..3dc9f131bda4 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskInterface.php @@ -0,0 +1,78 @@ +google.cloud.backupdr.v1.AttachedDisk.DiskInterface + */ +class DiskInterface +{ + /** + * Default value, which is unused. + * + * Generated from protobuf enum DISK_INTERFACE_UNSPECIFIED = 0; + */ + const DISK_INTERFACE_UNSPECIFIED = 0; + /** + * SCSI Disk Interface. + * + * Generated from protobuf enum SCSI = 1; + */ + const SCSI = 1; + /** + * NVME Disk Interface. + * + * Generated from protobuf enum NVME = 2; + */ + const NVME = 2; + /** + * NVDIMM Disk Interface. + * + * Generated from protobuf enum NVDIMM = 3; + */ + const NVDIMM = 3; + /** + * ISCSI Disk Interface. + * + * Generated from protobuf enum ISCSI = 4; + */ + const ISCSI = 4; + + private static $valueToName = [ + self::DISK_INTERFACE_UNSPECIFIED => 'DISK_INTERFACE_UNSPECIFIED', + self::SCSI => 'SCSI', + self::NVME => 'NVME', + self::NVDIMM => 'NVDIMM', + self::ISCSI => 'ISCSI', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DiskInterface::class, \Google\Cloud\BackupDR\V1\AttachedDisk_DiskInterface::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskMode.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskMode.php new file mode 100644 index 000000000000..f11c19ef3425 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskMode.php @@ -0,0 +1,76 @@ +google.cloud.backupdr.v1.AttachedDisk.DiskMode + */ +class DiskMode +{ + /** + * Default value, which is unused. + * + * Generated from protobuf enum DISK_MODE_UNSPECIFIED = 0; + */ + const DISK_MODE_UNSPECIFIED = 0; + /** + * Attaches this disk in read-write mode. Only one + * virtual machine at a time can be attached to a disk in read-write mode. + * + * Generated from protobuf enum READ_WRITE = 1; + */ + const READ_WRITE = 1; + /** + * Attaches this disk in read-only mode. Multiple virtual machines can use + * a disk in read-only mode at a time. + * + * Generated from protobuf enum READ_ONLY = 2; + */ + const READ_ONLY = 2; + /** + * The disk is locked for administrative reasons. Nobody else + * can use the disk. This mode is used (for example) when taking + * a snapshot of a disk to prevent mounting the disk while it is + * being snapshotted. + * + * Generated from protobuf enum LOCKED = 3; + */ + const LOCKED = 3; + + private static $valueToName = [ + self::DISK_MODE_UNSPECIFIED => 'DISK_MODE_UNSPECIFIED', + self::READ_WRITE => 'READ_WRITE', + self::READ_ONLY => 'READ_ONLY', + self::LOCKED => 'LOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DiskMode::class, \Google\Cloud\BackupDR\V1\AttachedDisk_DiskMode::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskSavedState.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskSavedState.php new file mode 100644 index 000000000000..2e994033207b --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskSavedState.php @@ -0,0 +1,57 @@ +google.cloud.backupdr.v1.AttachedDisk.DiskSavedState + */ +class DiskSavedState +{ + /** + * Default Disk state has not been preserved. + * + * Generated from protobuf enum DISK_SAVED_STATE_UNSPECIFIED = 0; + */ + const DISK_SAVED_STATE_UNSPECIFIED = 0; + /** + * Disk state has been preserved. + * + * Generated from protobuf enum PRESERVED = 1; + */ + const PRESERVED = 1; + + private static $valueToName = [ + self::DISK_SAVED_STATE_UNSPECIFIED => 'DISK_SAVED_STATE_UNSPECIFIED', + self::PRESERVED => 'PRESERVED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DiskSavedState::class, \Google\Cloud\BackupDR\V1\AttachedDisk_DiskSavedState::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskType.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskType.php new file mode 100644 index 000000000000..92697d619408 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/DiskType.php @@ -0,0 +1,64 @@ +google.cloud.backupdr.v1.AttachedDisk.DiskType + */ +class DiskType +{ + /** + * Default value, which is unused. + * + * Generated from protobuf enum DISK_TYPE_UNSPECIFIED = 0; + */ + const DISK_TYPE_UNSPECIFIED = 0; + /** + * A scratch disk type. + * + * Generated from protobuf enum SCRATCH = 1; + */ + const SCRATCH = 1; + /** + * A persistent disk type. + * + * Generated from protobuf enum PERSISTENT = 2; + */ + const PERSISTENT = 2; + + private static $valueToName = [ + self::DISK_TYPE_UNSPECIFIED => 'DISK_TYPE_UNSPECIFIED', + self::SCRATCH => 'SCRATCH', + self::PERSISTENT => 'PERSISTENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DiskType::class, \Google\Cloud\BackupDR\V1\AttachedDisk_DiskType::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/InitializeParams.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/InitializeParams.php new file mode 100644 index 000000000000..38c3ceb174c2 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/AttachedDisk/InitializeParams.php @@ -0,0 +1,122 @@ +google.cloud.backupdr.v1.AttachedDisk.InitializeParams + */ +class InitializeParams extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies the disk name. If not specified, the default is to + * use the name of the instance. + * + * Generated from protobuf field optional string disk_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_name = null; + /** + * Optional. URL of the zone where the disk should be created. + * Required for each regional disk associated with the instance. + * + * Generated from protobuf field repeated string replica_zones = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $replica_zones; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk_name + * Optional. Specifies the disk name. If not specified, the default is to + * use the name of the instance. + * @type array|\Google\Protobuf\Internal\RepeatedField $replica_zones + * Optional. URL of the zone where the disk should be created. + * Required for each regional disk associated with the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies the disk name. If not specified, the default is to + * use the name of the instance. + * + * Generated from protobuf field optional string disk_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDiskName() + { + return isset($this->disk_name) ? $this->disk_name : ''; + } + + public function hasDiskName() + { + return isset($this->disk_name); + } + + public function clearDiskName() + { + unset($this->disk_name); + } + + /** + * Optional. Specifies the disk name. If not specified, the default is to + * use the name of the instance. + * + * Generated from protobuf field optional string disk_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDiskName($var) + { + GPBUtil::checkString($var, True); + $this->disk_name = $var; + + return $this; + } + + /** + * Optional. URL of the zone where the disk should be created. + * Required for each regional disk associated with the instance. + * + * Generated from protobuf field repeated string replica_zones = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReplicaZones() + { + return $this->replica_zones; + } + + /** + * Optional. URL of the zone where the disk should be created. + * Required for each regional disk associated with the instance. + * + * Generated from protobuf field repeated string replica_zones = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReplicaZones($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->replica_zones = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InitializeParams::class, \Google\Cloud\BackupDR\V1\AttachedDisk_InitializeParams::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup.php new file mode 100644 index 000000000000..5639d7923c1e --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup.php @@ -0,0 +1,728 @@ +google.cloud.backupdr.v1.Backup + */ +class Backup extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. Name of the backup to create. It must have the + * format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + * `{backup}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the datasource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The description of the Backup instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = null; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. The backup can not be deleted before this time. + * + * Generated from protobuf field optional .google.protobuf.Timestamp enforced_retention_end_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enforced_retention_end_time = null; + /** + * Optional. When this backup is automatically expired. + * + * Generated from protobuf field optional .google.protobuf.Timestamp expire_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $expire_time = null; + /** + * Output only. The point in time when this backup was captured from the + * source. + * + * Generated from protobuf field optional .google.protobuf.Timestamp consistency_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $consistency_time = null; + /** + * Optional. Server specified ETag to prevent updates from overwriting each + * other. + * + * Generated from protobuf field optional string etag = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = null; + /** + * Output only. The Backup resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The list of BackupLocks taken by the service to prevent the + * deletion of the backup. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock service_locks = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $service_locks; + /** + * Optional. The list of BackupLocks taken by the accessor Backup Appliance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock backup_appliance_locks = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $backup_appliance_locks; + /** + * Output only. Type of the backup, unspecified, scheduled or ondemand. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.BackupType backup_type = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_type = 0; + /** + * Output only. source resource size in bytes at the time of the backup. + * + * Generated from protobuf field int64 resource_size_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $resource_size_bytes = 0; + protected $backup_properties; + protected $plan_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. Name of the backup to create. It must have the + * format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + * `{backup}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the datasource. + * @type string $description + * Output only. The description of the Backup instance (2048 characters or + * less). + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined. + * @type \Google\Protobuf\Timestamp $enforced_retention_end_time + * Optional. The backup can not be deleted before this time. + * @type \Google\Protobuf\Timestamp $expire_time + * Optional. When this backup is automatically expired. + * @type \Google\Protobuf\Timestamp $consistency_time + * Output only. The point in time when this backup was captured from the + * source. + * @type string $etag + * Optional. Server specified ETag to prevent updates from overwriting each + * other. + * @type int $state + * Output only. The Backup resource instance state. + * @type array<\Google\Cloud\BackupDR\V1\BackupLock>|\Google\Protobuf\Internal\RepeatedField $service_locks + * Output only. The list of BackupLocks taken by the service to prevent the + * deletion of the backup. + * @type array<\Google\Cloud\BackupDR\V1\BackupLock>|\Google\Protobuf\Internal\RepeatedField $backup_appliance_locks + * Optional. The list of BackupLocks taken by the accessor Backup Appliance. + * @type \Google\Cloud\BackupDR\V1\ComputeInstanceBackupProperties $compute_instance_backup_properties + * Output only. Compute Engine specific backup properties. + * @type \Google\Cloud\BackupDR\V1\BackupApplianceBackupProperties $backup_appliance_backup_properties + * Output only. Backup Appliance specific backup properties. + * @type int $backup_type + * Output only. Type of the backup, unspecified, scheduled or ondemand. + * @type \Google\Cloud\BackupDR\V1\Backup\GCPBackupPlanInfo $gcp_backup_plan_info + * Output only. Configuration for a Google Cloud resource. + * @type int|string $resource_size_bytes + * Output only. source resource size in bytes at the time of the backup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. Name of the backup to create. It must have the + * format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + * `{backup}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the datasource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. Name of the backup to create. It must have the + * format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + * `{backup}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the datasource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The description of the Backup instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Output only. The description of the Backup instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. The backup can not be deleted before this time. + * + * Generated from protobuf field optional .google.protobuf.Timestamp enforced_retention_end_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEnforcedRetentionEndTime() + { + return $this->enforced_retention_end_time; + } + + public function hasEnforcedRetentionEndTime() + { + return isset($this->enforced_retention_end_time); + } + + public function clearEnforcedRetentionEndTime() + { + unset($this->enforced_retention_end_time); + } + + /** + * Optional. The backup can not be deleted before this time. + * + * Generated from protobuf field optional .google.protobuf.Timestamp enforced_retention_end_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEnforcedRetentionEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->enforced_retention_end_time = $var; + + return $this; + } + + /** + * Optional. When this backup is automatically expired. + * + * Generated from protobuf field optional .google.protobuf.Timestamp expire_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Optional. When this backup is automatically expired. + * + * Generated from protobuf field optional .google.protobuf.Timestamp expire_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. The point in time when this backup was captured from the + * source. + * + * Generated from protobuf field optional .google.protobuf.Timestamp consistency_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getConsistencyTime() + { + return $this->consistency_time; + } + + public function hasConsistencyTime() + { + return isset($this->consistency_time); + } + + public function clearConsistencyTime() + { + unset($this->consistency_time); + } + + /** + * Output only. The point in time when this backup was captured from the + * source. + * + * Generated from protobuf field optional .google.protobuf.Timestamp consistency_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setConsistencyTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->consistency_time = $var; + + return $this; + } + + /** + * Optional. Server specified ETag to prevent updates from overwriting each + * other. + * + * Generated from protobuf field optional string etag = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Optional. Server specified ETag to prevent updates from overwriting each + * other. + * + * Generated from protobuf field optional string etag = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. The Backup resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The Backup resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Backup\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The list of BackupLocks taken by the service to prevent the + * deletion of the backup. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock service_locks = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceLocks() + { + return $this->service_locks; + } + + /** + * Output only. The list of BackupLocks taken by the service to prevent the + * deletion of the backup. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock service_locks = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BackupDR\V1\BackupLock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceLocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupLock::class); + $this->service_locks = $arr; + + return $this; + } + + /** + * Optional. The list of BackupLocks taken by the accessor Backup Appliance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock backup_appliance_locks = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupApplianceLocks() + { + return $this->backup_appliance_locks; + } + + /** + * Optional. The list of BackupLocks taken by the accessor Backup Appliance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock backup_appliance_locks = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\BackupLock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupApplianceLocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupLock::class); + $this->backup_appliance_locks = $arr; + + return $this; + } + + /** + * Output only. Compute Engine specific backup properties. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceBackupProperties compute_instance_backup_properties = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\ComputeInstanceBackupProperties|null + */ + public function getComputeInstanceBackupProperties() + { + return $this->readOneof(19); + } + + public function hasComputeInstanceBackupProperties() + { + return $this->hasOneof(19); + } + + /** + * Output only. Compute Engine specific backup properties. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceBackupProperties compute_instance_backup_properties = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\ComputeInstanceBackupProperties $var + * @return $this + */ + public function setComputeInstanceBackupProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ComputeInstanceBackupProperties::class); + $this->writeOneof(19, $var); + + return $this; + } + + /** + * Output only. Backup Appliance specific backup properties. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceBackupProperties backup_appliance_backup_properties = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\BackupApplianceBackupProperties|null + */ + public function getBackupApplianceBackupProperties() + { + return $this->readOneof(21); + } + + public function hasBackupApplianceBackupProperties() + { + return $this->hasOneof(21); + } + + /** + * Output only. Backup Appliance specific backup properties. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceBackupProperties backup_appliance_backup_properties = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\BackupApplianceBackupProperties $var + * @return $this + */ + public function setBackupApplianceBackupProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupApplianceBackupProperties::class); + $this->writeOneof(21, $var); + + return $this; + } + + /** + * Output only. Type of the backup, unspecified, scheduled or ondemand. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.BackupType backup_type = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getBackupType() + { + return $this->backup_type; + } + + /** + * Output only. Type of the backup, unspecified, scheduled or ondemand. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.BackupType backup_type = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setBackupType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Backup\BackupType::class); + $this->backup_type = $var; + + return $this; + } + + /** + * Output only. Configuration for a Google Cloud resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo gcp_backup_plan_info = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\Backup\GCPBackupPlanInfo|null + */ + public function getGcpBackupPlanInfo() + { + return $this->readOneof(22); + } + + public function hasGcpBackupPlanInfo() + { + return $this->hasOneof(22); + } + + /** + * Output only. Configuration for a Google Cloud resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo gcp_backup_plan_info = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\Backup\GCPBackupPlanInfo $var + * @return $this + */ + public function setGcpBackupPlanInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Backup\GCPBackupPlanInfo::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * Output only. source resource size in bytes at the time of the backup. + * + * Generated from protobuf field int64 resource_size_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getResourceSizeBytes() + { + return $this->resource_size_bytes; + } + + /** + * Output only. source resource size in bytes at the time of the backup. + * + * Generated from protobuf field int64 resource_size_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setResourceSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->resource_size_bytes = $var; + + return $this; + } + + /** + * @return string + */ + public function getBackupProperties() + { + return $this->whichOneof("backup_properties"); + } + + /** + * @return string + */ + public function getPlanInfo() + { + return $this->whichOneof("plan_info"); + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup/BackupType.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup/BackupType.php new file mode 100644 index 000000000000..4d787b1357be --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup/BackupType.php @@ -0,0 +1,64 @@ +google.cloud.backupdr.v1.Backup.BackupType + */ +class BackupType +{ + /** + * Backup type is unspecified. + * + * Generated from protobuf enum BACKUP_TYPE_UNSPECIFIED = 0; + */ + const BACKUP_TYPE_UNSPECIFIED = 0; + /** + * Scheduled backup. + * + * Generated from protobuf enum SCHEDULED = 1; + */ + const SCHEDULED = 1; + /** + * On demand backup. + * + * Generated from protobuf enum ON_DEMAND = 2; + */ + const ON_DEMAND = 2; + + private static $valueToName = [ + self::BACKUP_TYPE_UNSPECIFIED => 'BACKUP_TYPE_UNSPECIFIED', + self::SCHEDULED => 'SCHEDULED', + self::ON_DEMAND => 'ON_DEMAND', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BackupType::class, \Google\Cloud\BackupDR\V1\Backup_BackupType::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup/GCPBackupPlanInfo.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup/GCPBackupPlanInfo.php new file mode 100644 index 000000000000..8598637c8c8e --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup/GCPBackupPlanInfo.php @@ -0,0 +1,121 @@ +google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + */ +class GCPBackupPlanInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name of backup plan by which workload is protected at the time + * of the backup. + * Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + */ + protected $backup_plan = ''; + /** + * The rule id of the backup plan which triggered this backup in case of + * scheduled backup or used for + * + * Generated from protobuf field string backup_plan_rule_id = 2; + */ + protected $backup_plan_rule_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backup_plan + * Resource name of backup plan by which workload is protected at the time + * of the backup. + * Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * @type string $backup_plan_rule_id + * The rule id of the backup plan which triggered this backup in case of + * scheduled backup or used for + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Resource name of backup plan by which workload is protected at the time + * of the backup. + * Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getBackupPlan() + { + return $this->backup_plan; + } + + /** + * Resource name of backup plan by which workload is protected at the time + * of the backup. + * Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupPlan($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan = $var; + + return $this; + } + + /** + * The rule id of the backup plan which triggered this backup in case of + * scheduled backup or used for + * + * Generated from protobuf field string backup_plan_rule_id = 2; + * @return string + */ + public function getBackupPlanRuleId() + { + return $this->backup_plan_rule_id; + } + + /** + * The rule id of the backup plan which triggered this backup in case of + * scheduled backup or used for + * + * Generated from protobuf field string backup_plan_rule_id = 2; + * @param string $var + * @return $this + */ + public function setBackupPlanRuleId($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan_rule_id = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GCPBackupPlanInfo::class, \Google\Cloud\BackupDR\V1\Backup_GCPBackupPlanInfo::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup/State.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup/State.php new file mode 100644 index 000000000000..23b07ca7917c --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Backup/State.php @@ -0,0 +1,78 @@ +google.cloud.backupdr.v1.Backup.State + */ +class State +{ + /** + * State not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The backup is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The backup has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The backup is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The backup is experiencing an issue and might be unusable. + * + * Generated from protobuf enum ERROR = 4; + */ + const ERROR = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BackupDR\V1\Backup_State::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupApplianceBackupConfig.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupApplianceBackupConfig.php new file mode 100644 index 000000000000..b5d4c27f9480 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupApplianceBackupConfig.php @@ -0,0 +1,272 @@ +google.cloud.backupdr.v1.BackupApplianceBackupConfig + */ +class BackupApplianceBackupConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the backup appliance. + * + * Generated from protobuf field string backup_appliance_name = 1; + */ + protected $backup_appliance_name = ''; + /** + * The ID of the backup appliance. + * + * Generated from protobuf field int64 backup_appliance_id = 2; + */ + protected $backup_appliance_id = 0; + /** + * The ID of the SLA of this application. + * + * Generated from protobuf field int64 sla_id = 3; + */ + protected $sla_id = 0; + /** + * The name of the application. + * + * Generated from protobuf field string application_name = 4; + */ + protected $application_name = ''; + /** + * The name of the host where the application is running. + * + * Generated from protobuf field string host_name = 5; + */ + protected $host_name = ''; + /** + * The name of the SLT associated with the application. + * + * Generated from protobuf field string slt_name = 6; + */ + protected $slt_name = ''; + /** + * The name of the SLP associated with the application. + * + * Generated from protobuf field string slp_name = 7; + */ + protected $slp_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backup_appliance_name + * The name of the backup appliance. + * @type int|string $backup_appliance_id + * The ID of the backup appliance. + * @type int|string $sla_id + * The ID of the SLA of this application. + * @type string $application_name + * The name of the application. + * @type string $host_name + * The name of the host where the application is running. + * @type string $slt_name + * The name of the SLT associated with the application. + * @type string $slp_name + * The name of the SLP associated with the application. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The name of the backup appliance. + * + * Generated from protobuf field string backup_appliance_name = 1; + * @return string + */ + public function getBackupApplianceName() + { + return $this->backup_appliance_name; + } + + /** + * The name of the backup appliance. + * + * Generated from protobuf field string backup_appliance_name = 1; + * @param string $var + * @return $this + */ + public function setBackupApplianceName($var) + { + GPBUtil::checkString($var, True); + $this->backup_appliance_name = $var; + + return $this; + } + + /** + * The ID of the backup appliance. + * + * Generated from protobuf field int64 backup_appliance_id = 2; + * @return int|string + */ + public function getBackupApplianceId() + { + return $this->backup_appliance_id; + } + + /** + * The ID of the backup appliance. + * + * Generated from protobuf field int64 backup_appliance_id = 2; + * @param int|string $var + * @return $this + */ + public function setBackupApplianceId($var) + { + GPBUtil::checkInt64($var); + $this->backup_appliance_id = $var; + + return $this; + } + + /** + * The ID of the SLA of this application. + * + * Generated from protobuf field int64 sla_id = 3; + * @return int|string + */ + public function getSlaId() + { + return $this->sla_id; + } + + /** + * The ID of the SLA of this application. + * + * Generated from protobuf field int64 sla_id = 3; + * @param int|string $var + * @return $this + */ + public function setSlaId($var) + { + GPBUtil::checkInt64($var); + $this->sla_id = $var; + + return $this; + } + + /** + * The name of the application. + * + * Generated from protobuf field string application_name = 4; + * @return string + */ + public function getApplicationName() + { + return $this->application_name; + } + + /** + * The name of the application. + * + * Generated from protobuf field string application_name = 4; + * @param string $var + * @return $this + */ + public function setApplicationName($var) + { + GPBUtil::checkString($var, True); + $this->application_name = $var; + + return $this; + } + + /** + * The name of the host where the application is running. + * + * Generated from protobuf field string host_name = 5; + * @return string + */ + public function getHostName() + { + return $this->host_name; + } + + /** + * The name of the host where the application is running. + * + * Generated from protobuf field string host_name = 5; + * @param string $var + * @return $this + */ + public function setHostName($var) + { + GPBUtil::checkString($var, True); + $this->host_name = $var; + + return $this; + } + + /** + * The name of the SLT associated with the application. + * + * Generated from protobuf field string slt_name = 6; + * @return string + */ + public function getSltName() + { + return $this->slt_name; + } + + /** + * The name of the SLT associated with the application. + * + * Generated from protobuf field string slt_name = 6; + * @param string $var + * @return $this + */ + public function setSltName($var) + { + GPBUtil::checkString($var, True); + $this->slt_name = $var; + + return $this; + } + + /** + * The name of the SLP associated with the application. + * + * Generated from protobuf field string slp_name = 7; + * @return string + */ + public function getSlpName() + { + return $this->slp_name; + } + + /** + * The name of the SLP associated with the application. + * + * Generated from protobuf field string slp_name = 7; + * @param string $var + * @return $this + */ + public function setSlpName($var) + { + GPBUtil::checkString($var, True); + $this->slp_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupApplianceBackupProperties.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupApplianceBackupProperties.php new file mode 100644 index 000000000000..62bf277eea5e --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupApplianceBackupProperties.php @@ -0,0 +1,218 @@ +google.cloud.backupdr.v1.BackupApplianceBackupProperties + */ +class BackupApplianceBackupProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The numeric generation ID of the backup (monotonically + * increasing). + * + * Generated from protobuf field optional int32 generation_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation_id = null; + /** + * Output only. The time when this backup object was finalized (if none, + * backup is not finalized). + * + * Generated from protobuf field optional .google.protobuf.Timestamp finalize_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $finalize_time = null; + /** + * Optional. The earliest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_start_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $recovery_range_start_time = null; + /** + * Optional. The latest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_end_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $recovery_range_end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $generation_id + * Output only. The numeric generation ID of the backup (monotonically + * increasing). + * @type \Google\Protobuf\Timestamp $finalize_time + * Output only. The time when this backup object was finalized (if none, + * backup is not finalized). + * @type \Google\Protobuf\Timestamp $recovery_range_start_time + * Optional. The earliest timestamp of data available in this Backup. + * @type \Google\Protobuf\Timestamp $recovery_range_end_time + * Optional. The latest timestamp of data available in this Backup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultBa::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The numeric generation ID of the backup (monotonically + * increasing). + * + * Generated from protobuf field optional int32 generation_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getGenerationId() + { + return isset($this->generation_id) ? $this->generation_id : 0; + } + + public function hasGenerationId() + { + return isset($this->generation_id); + } + + public function clearGenerationId() + { + unset($this->generation_id); + } + + /** + * Output only. The numeric generation ID of the backup (monotonically + * increasing). + * + * Generated from protobuf field optional int32 generation_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setGenerationId($var) + { + GPBUtil::checkInt32($var); + $this->generation_id = $var; + + return $this; + } + + /** + * Output only. The time when this backup object was finalized (if none, + * backup is not finalized). + * + * Generated from protobuf field optional .google.protobuf.Timestamp finalize_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFinalizeTime() + { + return $this->finalize_time; + } + + public function hasFinalizeTime() + { + return isset($this->finalize_time); + } + + public function clearFinalizeTime() + { + unset($this->finalize_time); + } + + /** + * Output only. The time when this backup object was finalized (if none, + * backup is not finalized). + * + * Generated from protobuf field optional .google.protobuf.Timestamp finalize_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFinalizeTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->finalize_time = $var; + + return $this; + } + + /** + * Optional. The earliest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_start_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRecoveryRangeStartTime() + { + return $this->recovery_range_start_time; + } + + public function hasRecoveryRangeStartTime() + { + return isset($this->recovery_range_start_time); + } + + public function clearRecoveryRangeStartTime() + { + unset($this->recovery_range_start_time); + } + + /** + * Optional. The earliest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_start_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRecoveryRangeStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->recovery_range_start_time = $var; + + return $this; + } + + /** + * Optional. The latest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_end_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRecoveryRangeEndTime() + { + return $this->recovery_range_end_time; + } + + public function hasRecoveryRangeEndTime() + { + return isset($this->recovery_range_end_time); + } + + public function clearRecoveryRangeEndTime() + { + unset($this->recovery_range_end_time); + } + + /** + * Optional. The latest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_end_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRecoveryRangeEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->recovery_range_end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupApplianceLockInfo.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupApplianceLockInfo.php new file mode 100644 index 000000000000..f024d90f7bd8 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupApplianceLockInfo.php @@ -0,0 +1,252 @@ +google.cloud.backupdr.v1.BackupApplianceLockInfo + */ +class BackupApplianceLockInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field int64 backup_appliance_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_appliance_id = 0; + /** + * Required. The name of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field string backup_appliance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_appliance_name = ''; + /** + * Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + * value of this string is only meaningful to the client and it is not + * interpreted by the BackupVault service. + * + * Generated from protobuf field string lock_reason = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lock_reason = ''; + protected $lock_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $backup_appliance_id + * Required. The ID of the backup/recovery appliance that created this lock. + * @type string $backup_appliance_name + * Required. The name of the backup/recovery appliance that created this lock. + * @type string $lock_reason + * Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + * value of this string is only meaningful to the client and it is not + * interpreted by the BackupVault service. + * @type string $job_name + * The job name on the backup/recovery appliance that created this lock. + * @type string $backup_image + * The image name that depends on this Backup. + * @type int|string $sla_id + * The SLA on the backup/recovery appliance that owns the lock. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field int64 backup_appliance_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getBackupApplianceId() + { + return $this->backup_appliance_id; + } + + /** + * Required. The ID of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field int64 backup_appliance_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setBackupApplianceId($var) + { + GPBUtil::checkInt64($var); + $this->backup_appliance_id = $var; + + return $this; + } + + /** + * Required. The name of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field string backup_appliance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupApplianceName() + { + return $this->backup_appliance_name; + } + + /** + * Required. The name of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field string backup_appliance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupApplianceName($var) + { + GPBUtil::checkString($var, True); + $this->backup_appliance_name = $var; + + return $this; + } + + /** + * Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + * value of this string is only meaningful to the client and it is not + * interpreted by the BackupVault service. + * + * Generated from protobuf field string lock_reason = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLockReason() + { + return $this->lock_reason; + } + + /** + * Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + * value of this string is only meaningful to the client and it is not + * interpreted by the BackupVault service. + * + * Generated from protobuf field string lock_reason = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLockReason($var) + { + GPBUtil::checkString($var, True); + $this->lock_reason = $var; + + return $this; + } + + /** + * The job name on the backup/recovery appliance that created this lock. + * + * Generated from protobuf field string job_name = 6; + * @return string + */ + public function getJobName() + { + return $this->readOneof(6); + } + + public function hasJobName() + { + return $this->hasOneof(6); + } + + /** + * The job name on the backup/recovery appliance that created this lock. + * + * Generated from protobuf field string job_name = 6; + * @param string $var + * @return $this + */ + public function setJobName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The image name that depends on this Backup. + * + * Generated from protobuf field string backup_image = 7; + * @return string + */ + public function getBackupImage() + { + return $this->readOneof(7); + } + + public function hasBackupImage() + { + return $this->hasOneof(7); + } + + /** + * The image name that depends on this Backup. + * + * Generated from protobuf field string backup_image = 7; + * @param string $var + * @return $this + */ + public function setBackupImage($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * The SLA on the backup/recovery appliance that owns the lock. + * + * Generated from protobuf field int64 sla_id = 8; + * @return int|string + */ + public function getSlaId() + { + return $this->readOneof(8); + } + + public function hasSlaId() + { + return $this->hasOneof(8); + } + + /** + * The SLA on the backup/recovery appliance that owns the lock. + * + * Generated from protobuf field int64 sla_id = 8; + * @param int|string $var + * @return $this + */ + public function setSlaId($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * @return string + */ + public function getLockSource() + { + return $this->whichOneof("lock_source"); + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupConfigInfo.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupConfigInfo.php new file mode 100644 index 000000000000..910ef56ebd1e --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupConfigInfo.php @@ -0,0 +1,235 @@ +google.cloud.backupdr.v1.BackupConfigInfo + */ +class BackupConfigInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The status of the last backup to this BackupVault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState last_backup_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_backup_state = 0; + /** + * Output only. If the last backup were successful, this field has the + * consistency date. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_successful_backup_consistency_time = null; + /** + * Output only. If the last backup failed, this field has the error message. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_backup_error = null; + protected $backup_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $last_backup_state + * Output only. The status of the last backup to this BackupVault + * @type \Google\Protobuf\Timestamp $last_successful_backup_consistency_time + * Output only. If the last backup were successful, this field has the + * consistency date. + * @type \Google\Rpc\Status $last_backup_error + * Output only. If the last backup failed, this field has the error message. + * @type \Google\Cloud\BackupDR\V1\GcpBackupConfig $gcp_backup_config + * Configuration for a Google Cloud resource. + * @type \Google\Cloud\BackupDR\V1\BackupApplianceBackupConfig $backup_appliance_backup_config + * Configuration for an application backed up by a Backup Appliance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The status of the last backup to this BackupVault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState last_backup_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getLastBackupState() + { + return $this->last_backup_state; + } + + /** + * Output only. The status of the last backup to this BackupVault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState last_backup_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setLastBackupState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupConfigInfo\LastBackupState::class); + $this->last_backup_state = $var; + + return $this; + } + + /** + * Output only. If the last backup were successful, this field has the + * consistency date. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastSuccessfulBackupConsistencyTime() + { + return $this->last_successful_backup_consistency_time; + } + + public function hasLastSuccessfulBackupConsistencyTime() + { + return isset($this->last_successful_backup_consistency_time); + } + + public function clearLastSuccessfulBackupConsistencyTime() + { + unset($this->last_successful_backup_consistency_time); + } + + /** + * Output only. If the last backup were successful, this field has the + * consistency date. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastSuccessfulBackupConsistencyTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_successful_backup_consistency_time = $var; + + return $this; + } + + /** + * Output only. If the last backup failed, this field has the error message. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getLastBackupError() + { + return $this->last_backup_error; + } + + public function hasLastBackupError() + { + return isset($this->last_backup_error); + } + + public function clearLastBackupError() + { + unset($this->last_backup_error); + } + + /** + * Output only. If the last backup failed, this field has the error message. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setLastBackupError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->last_backup_error = $var; + + return $this; + } + + /** + * Configuration for a Google Cloud resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.GcpBackupConfig gcp_backup_config = 4; + * @return \Google\Cloud\BackupDR\V1\GcpBackupConfig|null + */ + public function getGcpBackupConfig() + { + return $this->readOneof(4); + } + + public function hasGcpBackupConfig() + { + return $this->hasOneof(4); + } + + /** + * Configuration for a Google Cloud resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.GcpBackupConfig gcp_backup_config = 4; + * @param \Google\Cloud\BackupDR\V1\GcpBackupConfig $var + * @return $this + */ + public function setGcpBackupConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\GcpBackupConfig::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Configuration for an application backed up by a Backup Appliance. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceBackupConfig backup_appliance_backup_config = 5; + * @return \Google\Cloud\BackupDR\V1\BackupApplianceBackupConfig|null + */ + public function getBackupApplianceBackupConfig() + { + return $this->readOneof(5); + } + + public function hasBackupApplianceBackupConfig() + { + return $this->hasOneof(5); + } + + /** + * Configuration for an application backed up by a Backup Appliance. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceBackupConfig backup_appliance_backup_config = 5; + * @param \Google\Cloud\BackupDR\V1\BackupApplianceBackupConfig $var + * @return $this + */ + public function setBackupApplianceBackupConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupApplianceBackupConfig::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getBackupConfig() + { + return $this->whichOneof("backup_config"); + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupConfigInfo/LastBackupState.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupConfigInfo/LastBackupState.php new file mode 100644 index 000000000000..0b4a9fb6b92a --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupConfigInfo/LastBackupState.php @@ -0,0 +1,80 @@ +google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState + */ +class LastBackupState +{ + /** + * Status not set. + * + * Generated from protobuf enum LAST_BACKUP_STATE_UNSPECIFIED = 0; + */ + const LAST_BACKUP_STATE_UNSPECIFIED = 0; + /** + * The first backup has not yet completed + * + * Generated from protobuf enum FIRST_BACKUP_PENDING = 1; + */ + const FIRST_BACKUP_PENDING = 1; + /** + * The most recent backup was successful + * + * Generated from protobuf enum SUCCEEDED = 2; + */ + const SUCCEEDED = 2; + /** + * The most recent backup failed + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + /** + * The most recent backup could not be run/failed because of the lack of + * permissions + * + * Generated from protobuf enum PERMISSION_DENIED = 4; + */ + const PERMISSION_DENIED = 4; + + private static $valueToName = [ + self::LAST_BACKUP_STATE_UNSPECIFIED => 'LAST_BACKUP_STATE_UNSPECIFIED', + self::FIRST_BACKUP_PENDING => 'FIRST_BACKUP_PENDING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::PERMISSION_DENIED => 'PERMISSION_DENIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LastBackupState::class, \Google\Cloud\BackupDR\V1\BackupConfigInfo_LastBackupState::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupConfigState.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupConfigState.php new file mode 100644 index 000000000000..8c760774704c --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupConfigState.php @@ -0,0 +1,63 @@ +google.cloud.backupdr.v1.BackupConfigState + */ +class BackupConfigState +{ + /** + * The possible states of backup configuration. + * Status not set. + * + * Generated from protobuf enum BACKUP_CONFIG_STATE_UNSPECIFIED = 0; + */ + const BACKUP_CONFIG_STATE_UNSPECIFIED = 0; + /** + * The data source is actively protected (i.e. there is a + * BackupPlanAssociation or Appliance SLA pointing to it) + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The data source is no longer protected (but may have backups under it) + * + * Generated from protobuf enum PASSIVE = 2; + */ + const PASSIVE = 2; + + private static $valueToName = [ + self::BACKUP_CONFIG_STATE_UNSPECIFIED => 'BACKUP_CONFIG_STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::PASSIVE => 'PASSIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupLock.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupLock.php new file mode 100644 index 000000000000..16c344cda822 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupLock.php @@ -0,0 +1,163 @@ +google.cloud.backupdr.v1.BackupLock + */ +class BackupLock extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The time after which this lock is not considered valid and will + * no longer protect the Backup from deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp lock_until_time = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lock_until_time = null; + protected $ClientLockInfo; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $lock_until_time + * Required. The time after which this lock is not considered valid and will + * no longer protect the Backup from deletion. + * @type \Google\Cloud\BackupDR\V1\BackupApplianceLockInfo $backup_appliance_lock_info + * If the client is a backup and recovery appliance, this + * contains metadata about why the lock exists. + * @type \Google\Cloud\BackupDR\V1\ServiceLockInfo $service_lock_info + * Output only. Contains metadata about the lock exist for Google Cloud + * native backups. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The time after which this lock is not considered valid and will + * no longer protect the Backup from deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp lock_until_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLockUntilTime() + { + return $this->lock_until_time; + } + + public function hasLockUntilTime() + { + return isset($this->lock_until_time); + } + + public function clearLockUntilTime() + { + unset($this->lock_until_time); + } + + /** + * Required. The time after which this lock is not considered valid and will + * no longer protect the Backup from deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp lock_until_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLockUntilTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->lock_until_time = $var; + + return $this; + } + + /** + * If the client is a backup and recovery appliance, this + * contains metadata about why the lock exists. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceLockInfo backup_appliance_lock_info = 3; + * @return \Google\Cloud\BackupDR\V1\BackupApplianceLockInfo|null + */ + public function getBackupApplianceLockInfo() + { + return $this->readOneof(3); + } + + public function hasBackupApplianceLockInfo() + { + return $this->hasOneof(3); + } + + /** + * If the client is a backup and recovery appliance, this + * contains metadata about why the lock exists. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceLockInfo backup_appliance_lock_info = 3; + * @param \Google\Cloud\BackupDR\V1\BackupApplianceLockInfo $var + * @return $this + */ + public function setBackupApplianceLockInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupApplianceLockInfo::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. Contains metadata about the lock exist for Google Cloud + * native backups. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ServiceLockInfo service_lock_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\ServiceLockInfo|null + */ + public function getServiceLockInfo() + { + return $this->readOneof(4); + } + + public function hasServiceLockInfo() + { + return $this->hasOneof(4); + } + + /** + * Output only. Contains metadata about the lock exist for Google Cloud + * native backups. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ServiceLockInfo service_lock_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\ServiceLockInfo $var + * @return $this + */ + public function setServiceLockInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ServiceLockInfo::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getClientLockInfo() + { + return $this->whichOneof("ClientLockInfo"); + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlan.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlan.php new file mode 100644 index 000000000000..5f4feca856b7 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlan.php @@ -0,0 +1,490 @@ +google.cloud.backupdr.v1.BackupPlan + */ +class BackupPlan extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name of the `BackupPlan`. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The description of the `BackupPlan` resource. + * The description allows for additional details about `BackupPlan` and its + * use cases to be provided. An example description is the following: "This + * is a backup plan that performs a daily backup at 6pm and retains data for 3 + * months". The description must be at most 2048 characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. This collection of key/value pairs allows for custom labels to be + * supplied by the user. Example, {"tag": "Weekly"}. + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. When the `BackupPlan` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. When the `BackupPlan` was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Required. The backup rules for this `BackupPlan`. There must be at least + * one `BackupRule` message. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupRule backup_rules = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + private $backup_rules; + /** + * Output only. The `State` for the `BackupPlan`. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. The resource type to which the `BackupPlan` will be applied. + * Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + * + * Generated from protobuf field string resource_type = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_type = ''; + /** + * Optional. `etag` is returned from the service in the response. As a user of + * the service, you may provide an etag value in this field to prevent stale + * resources. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Required. Resource name of backup vault which will be used as storage + * location for backups. Format: + * projects/{project}/locations/{location}/backupVaults/{backupvault} + * + * Generated from protobuf field string backup_vault = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $backup_vault = ''; + /** + * Output only. The Google Cloud Platform Service Account to be used by the + * BackupVault for taking backups. Specify the email address of the Backup + * Vault Service Account. + * + * Generated from protobuf field string backup_vault_service_account = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_vault_service_account = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name of the `BackupPlan`. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @type string $description + * Optional. The description of the `BackupPlan` resource. + * The description allows for additional details about `BackupPlan` and its + * use cases to be provided. An example description is the following: "This + * is a backup plan that performs a daily backup at 6pm and retains data for 3 + * months". The description must be at most 2048 characters. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. This collection of key/value pairs allows for custom labels to be + * supplied by the user. Example, {"tag": "Weekly"}. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. When the `BackupPlan` was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. When the `BackupPlan` was last updated. + * @type array<\Google\Cloud\BackupDR\V1\BackupRule>|\Google\Protobuf\Internal\RepeatedField $backup_rules + * Required. The backup rules for this `BackupPlan`. There must be at least + * one `BackupRule` message. + * @type int $state + * Output only. The `State` for the `BackupPlan`. + * @type string $resource_type + * Required. The resource type to which the `BackupPlan` will be applied. + * Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + * @type string $etag + * Optional. `etag` is returned from the service in the response. As a user of + * the service, you may provide an etag value in this field to prevent stale + * resources. + * @type string $backup_vault + * Required. Resource name of backup vault which will be used as storage + * location for backups. Format: + * projects/{project}/locations/{location}/backupVaults/{backupvault} + * @type string $backup_vault_service_account + * Output only. The Google Cloud Platform Service Account to be used by the + * BackupVault for taking backups. Specify the email address of the Backup + * Vault Service Account. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name of the `BackupPlan`. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name of the `BackupPlan`. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The description of the `BackupPlan` resource. + * The description allows for additional details about `BackupPlan` and its + * use cases to be provided. An example description is the following: "This + * is a backup plan that performs a daily backup at 6pm and retains data for 3 + * months". The description must be at most 2048 characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of the `BackupPlan` resource. + * The description allows for additional details about `BackupPlan` and its + * use cases to be provided. An example description is the following: "This + * is a backup plan that performs a daily backup at 6pm and retains data for 3 + * months". The description must be at most 2048 characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. This collection of key/value pairs allows for custom labels to be + * supplied by the user. Example, {"tag": "Weekly"}. + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. This collection of key/value pairs allows for custom labels to be + * supplied by the user. Example, {"tag": "Weekly"}. + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. When the `BackupPlan` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. When the `BackupPlan` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. When the `BackupPlan` was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. When the `BackupPlan` was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Required. The backup rules for this `BackupPlan`. There must be at least + * one `BackupRule` message. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupRule backup_rules = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupRules() + { + return $this->backup_rules; + } + + /** + * Required. The backup rules for this `BackupPlan`. There must be at least + * one `BackupRule` message. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupRule backup_rules = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\BackupDR\V1\BackupRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupRule::class); + $this->backup_rules = $arr; + + return $this; + } + + /** + * Output only. The `State` for the `BackupPlan`. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The `State` for the `BackupPlan`. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupPlan\State::class); + $this->state = $var; + + return $this; + } + + /** + * Required. The resource type to which the `BackupPlan` will be applied. + * Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + * + * Generated from protobuf field string resource_type = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * Required. The resource type to which the `BackupPlan` will be applied. + * Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + * + * Generated from protobuf field string resource_type = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkString($var, True); + $this->resource_type = $var; + + return $this; + } + + /** + * Optional. `etag` is returned from the service in the response. As a user of + * the service, you may provide an etag value in this field to prevent stale + * resources. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. `etag` is returned from the service in the response. As a user of + * the service, you may provide an etag value in this field to prevent stale + * resources. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Required. Resource name of backup vault which will be used as storage + * location for backups. Format: + * projects/{project}/locations/{location}/backupVaults/{backupvault} + * + * Generated from protobuf field string backup_vault = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getBackupVault() + { + return $this->backup_vault; + } + + /** + * Required. Resource name of backup vault which will be used as storage + * location for backups. Format: + * projects/{project}/locations/{location}/backupVaults/{backupvault} + * + * Generated from protobuf field string backup_vault = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupVault($var) + { + GPBUtil::checkString($var, True); + $this->backup_vault = $var; + + return $this; + } + + /** + * Output only. The Google Cloud Platform Service Account to be used by the + * BackupVault for taking backups. Specify the email address of the Backup + * Vault Service Account. + * + * Generated from protobuf field string backup_vault_service_account = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getBackupVaultServiceAccount() + { + return $this->backup_vault_service_account; + } + + /** + * Output only. The Google Cloud Platform Service Account to be used by the + * BackupVault for taking backups. Specify the email address of the Backup + * Vault Service Account. + * + * Generated from protobuf field string backup_vault_service_account = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setBackupVaultServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->backup_vault_service_account = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlan/State.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlan/State.php new file mode 100644 index 000000000000..60dada607170 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlan/State.php @@ -0,0 +1,78 @@ +google.cloud.backupdr.v1.BackupPlan.State + */ +class State +{ + /** + * State not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The resource is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The resource has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The resource is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The resource has been created but is not usable. + * + * Generated from protobuf enum INACTIVE = 4; + */ + const INACTIVE = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::INACTIVE => 'INACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BackupDR\V1\BackupPlan_State::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlanAssociation.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlanAssociation.php new file mode 100644 index 000000000000..2a5804c13ae5 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlanAssociation.php @@ -0,0 +1,396 @@ +google.cloud.backupdr.v1.BackupPlanAssociation + */ +class BackupPlanAssociation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name of BackupPlanAssociation in + * below format Format : + * projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. Resource type of workload on which backupplan is applied + * + * Generated from protobuf field string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $resource_type = ''; + /** + * Required. Immutable. Resource name of workload on which backupplan is + * applied + * + * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * Required. Resource name of backup plan which needs to be applied on + * workload. Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $backup_plan = ''; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The BackupPlanAssociation resource state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The config info related to backup rules. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.RuleConfigInfo rules_config_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $rules_config_info; + /** + * Output only. Output Only. + * Resource name of data source which will be used as storage location for + * backups taken. + * Format : + * projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + * + * Generated from protobuf field string data_source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $data_source = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name of BackupPlanAssociation in + * below format Format : + * projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} + * @type string $resource_type + * Optional. Resource type of workload on which backupplan is applied + * @type string $resource + * Required. Immutable. Resource name of workload on which backupplan is + * applied + * @type string $backup_plan + * Required. Resource name of backup plan which needs to be applied on + * workload. Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type int $state + * Output only. The BackupPlanAssociation resource state. + * @type array<\Google\Cloud\BackupDR\V1\RuleConfigInfo>|\Google\Protobuf\Internal\RepeatedField $rules_config_info + * Output only. The config info related to backup rules. + * @type string $data_source + * Output only. Output Only. + * Resource name of data source which will be used as storage location for + * backups taken. + * Format : + * projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name of BackupPlanAssociation in + * below format Format : + * projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name of BackupPlanAssociation in + * below format Format : + * projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Resource type of workload on which backupplan is applied + * + * Generated from protobuf field string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * Optional. Resource type of workload on which backupplan is applied + * + * Generated from protobuf field string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkString($var, True); + $this->resource_type = $var; + + return $this; + } + + /** + * Required. Immutable. Resource name of workload on which backupplan is + * applied + * + * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Required. Immutable. Resource name of workload on which backupplan is + * applied + * + * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * Required. Resource name of backup plan which needs to be applied on + * workload. Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getBackupPlan() + { + return $this->backup_plan; + } + + /** + * Required. Resource name of backup plan which needs to be applied on + * workload. Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupPlan($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan = $var; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The BackupPlanAssociation resource state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The BackupPlanAssociation resource state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupPlanAssociation\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The config info related to backup rules. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.RuleConfigInfo rules_config_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRulesConfigInfo() + { + return $this->rules_config_info; + } + + /** + * Output only. The config info related to backup rules. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.RuleConfigInfo rules_config_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BackupDR\V1\RuleConfigInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRulesConfigInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\RuleConfigInfo::class); + $this->rules_config_info = $arr; + + return $this; + } + + /** + * Output only. Output Only. + * Resource name of data source which will be used as storage location for + * backups taken. + * Format : + * projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + * + * Generated from protobuf field string data_source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDataSource() + { + return $this->data_source; + } + + /** + * Output only. Output Only. + * Resource name of data source which will be used as storage location for + * backups taken. + * Format : + * projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + * + * Generated from protobuf field string data_source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkString($var, True); + $this->data_source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlanAssociation/State.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlanAssociation/State.php new file mode 100644 index 000000000000..3fd5da4711b5 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupPlanAssociation/State.php @@ -0,0 +1,78 @@ +google.cloud.backupdr.v1.BackupPlanAssociation.State + */ +class State +{ + /** + * State not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The resource is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The resource has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The resource is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The resource has been created but is not usable. + * + * Generated from protobuf enum INACTIVE = 4; + */ + const INACTIVE = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::INACTIVE => 'INACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BackupDR\V1\BackupPlanAssociation_State::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupRule.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupRule.php new file mode 100644 index 000000000000..a66eb5362db0 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupRule.php @@ -0,0 +1,166 @@ +google.cloud.backupdr.v1.BackupRule + */ +class BackupRule extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + * unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + * followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + * /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $rule_id = ''; + /** + * Required. Configures the duration for which backup data will be kept. It is + * defined in “daysâ€. The value should be greater than or equal to minimum + * enforced retention of the backup vault. + * + * Generated from protobuf field int32 backup_retention_days = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_retention_days = 0; + protected $backup_schedule_oneof; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $rule_id + * Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + * unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + * followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + * /[a-z][a-z0-9-]{,62}/. + * @type int $backup_retention_days + * Required. Configures the duration for which backup data will be kept. It is + * defined in “daysâ€. The value should be greater than or equal to minimum + * enforced retention of the backup vault. + * @type \Google\Cloud\BackupDR\V1\StandardSchedule $standard_schedule + * Required. Defines a schedule that runs within the confines of a defined + * window of time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + * unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + * followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + * /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getRuleId() + { + return $this->rule_id; + } + + /** + * Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + * unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + * followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + * /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setRuleId($var) + { + GPBUtil::checkString($var, True); + $this->rule_id = $var; + + return $this; + } + + /** + * Required. Configures the duration for which backup data will be kept. It is + * defined in “daysâ€. The value should be greater than or equal to minimum + * enforced retention of the backup vault. + * + * Generated from protobuf field int32 backup_retention_days = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getBackupRetentionDays() + { + return $this->backup_retention_days; + } + + /** + * Required. Configures the duration for which backup data will be kept. It is + * defined in “daysâ€. The value should be greater than or equal to minimum + * enforced retention of the backup vault. + * + * Generated from protobuf field int32 backup_retention_days = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setBackupRetentionDays($var) + { + GPBUtil::checkInt32($var); + $this->backup_retention_days = $var; + + return $this; + } + + /** + * Required. Defines a schedule that runs within the confines of a defined + * window of time. + * + * Generated from protobuf field .google.cloud.backupdr.v1.StandardSchedule standard_schedule = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\StandardSchedule|null + */ + public function getStandardSchedule() + { + return $this->readOneof(5); + } + + public function hasStandardSchedule() + { + return $this->hasOneof(5); + } + + /** + * Required. Defines a schedule that runs within the confines of a defined + * window of time. + * + * Generated from protobuf field .google.cloud.backupdr.v1.StandardSchedule standard_schedule = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\StandardSchedule $var + * @return $this + */ + public function setStandardSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\StandardSchedule::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getBackupScheduleOneof() + { + return $this->whichOneof("backup_schedule_oneof"); + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVault.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVault.php new file mode 100644 index 000000000000..03d965e14bae --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVault.php @@ -0,0 +1,715 @@ +google.cloud.backupdr.v1.BackupVault + */ +class BackupVault extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. Name of the backup vault to create. It must have + * the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + * `{backupvault}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the project and location. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The description of the BackupVault instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = null; + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Required. The default and minimum enforced retention for each backup within + * the backup vault. The enforced retention for each backup can be extended. + * + * Generated from protobuf field optional .google.protobuf.Duration backup_minimum_enforced_retention_duration = 20 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_minimum_enforced_retention_duration = null; + /** + * Output only. Set to true when there are no backups nested under this + * resource. + * + * Generated from protobuf field optional bool deletable = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $deletable = null; + /** + * Optional. Server specified ETag for the backup vault resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = null; + /** + * Output only. The BackupVault resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. Time after which the BackupVault resource is locked. + * + * Generated from protobuf field optional .google.protobuf.Timestamp effective_time = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $effective_time = null; + /** + * Output only. The number of backups in this backup vault. + * + * Generated from protobuf field int64 backup_count = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_count = 0; + /** + * Output only. Service account used by the BackupVault Service for this + * BackupVault. The user should grant this account permissions in their + * workload project to enable the service to run backups and restores there. + * + * Generated from protobuf field string service_account = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $service_account = ''; + /** + * Output only. Total size of the storage used by all backup resources. + * + * Generated from protobuf field int64 total_stored_bytes = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $total_stored_bytes = 0; + /** + * Output only. Output only + * Immutable after resource creation until resource deletion. + * + * Generated from protobuf field string uid = 21 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + */ + protected $uid = ''; + /** + * Optional. User annotations. See https://google.aip.dev/128#annotations + * Stores small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Optional. Note: This field is added for future use case and will not be + * supported in the current release. + * Optional. + * Access restriction for the backup vault. + * Default value is WITHIN_ORGANIZATION if not provided during creation. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.AccessRestriction access_restriction = 24 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $access_restriction = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. Name of the backup vault to create. It must have + * the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + * `{backupvault}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the project and location. + * @type string $description + * Optional. The description of the BackupVault instance (2048 characters or + * less). + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type \Google\Protobuf\Duration $backup_minimum_enforced_retention_duration + * Required. The default and minimum enforced retention for each backup within + * the backup vault. The enforced retention for each backup can be extended. + * @type bool $deletable + * Output only. Set to true when there are no backups nested under this + * resource. + * @type string $etag + * Optional. Server specified ETag for the backup vault resource to + * prevent simultaneous updates from overwiting each other. + * @type int $state + * Output only. The BackupVault resource instance state. + * @type \Google\Protobuf\Timestamp $effective_time + * Optional. Time after which the BackupVault resource is locked. + * @type int|string $backup_count + * Output only. The number of backups in this backup vault. + * @type string $service_account + * Output only. Service account used by the BackupVault Service for this + * BackupVault. The user should grant this account permissions in their + * workload project to enable the service to run backups and restores there. + * @type int|string $total_stored_bytes + * Output only. Total size of the storage used by all backup resources. + * @type string $uid + * Output only. Output only + * Immutable after resource creation until resource deletion. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. User annotations. See https://google.aip.dev/128#annotations + * Stores small amounts of arbitrary data. + * @type int $access_restriction + * Optional. Note: This field is added for future use case and will not be + * supported in the current release. + * Optional. + * Access restriction for the backup vault. + * Default value is WITHIN_ORGANIZATION if not provided during creation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. Name of the backup vault to create. It must have + * the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + * `{backupvault}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the project and location. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. Name of the backup vault to create. It must have + * the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + * `{backupvault}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the project and location. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The description of the BackupVault instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Optional. The description of the BackupVault instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Required. The default and minimum enforced retention for each backup within + * the backup vault. The enforced retention for each backup can be extended. + * + * Generated from protobuf field optional .google.protobuf.Duration backup_minimum_enforced_retention_duration = 20 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getBackupMinimumEnforcedRetentionDuration() + { + return $this->backup_minimum_enforced_retention_duration; + } + + public function hasBackupMinimumEnforcedRetentionDuration() + { + return isset($this->backup_minimum_enforced_retention_duration); + } + + public function clearBackupMinimumEnforcedRetentionDuration() + { + unset($this->backup_minimum_enforced_retention_duration); + } + + /** + * Required. The default and minimum enforced retention for each backup within + * the backup vault. The enforced retention for each backup can be extended. + * + * Generated from protobuf field optional .google.protobuf.Duration backup_minimum_enforced_retention_duration = 20 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setBackupMinimumEnforcedRetentionDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->backup_minimum_enforced_retention_duration = $var; + + return $this; + } + + /** + * Output only. Set to true when there are no backups nested under this + * resource. + * + * Generated from protobuf field optional bool deletable = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getDeletable() + { + return isset($this->deletable) ? $this->deletable : false; + } + + public function hasDeletable() + { + return isset($this->deletable); + } + + public function clearDeletable() + { + unset($this->deletable); + } + + /** + * Output only. Set to true when there are no backups nested under this + * resource. + * + * Generated from protobuf field optional bool deletable = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setDeletable($var) + { + GPBUtil::checkBool($var); + $this->deletable = $var; + + return $this; + } + + /** + * Optional. Server specified ETag for the backup vault resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Optional. Server specified ETag for the backup vault resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. The BackupVault resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The BackupVault resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupVault\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Time after which the BackupVault resource is locked. + * + * Generated from protobuf field optional .google.protobuf.Timestamp effective_time = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEffectiveTime() + { + return $this->effective_time; + } + + public function hasEffectiveTime() + { + return isset($this->effective_time); + } + + public function clearEffectiveTime() + { + unset($this->effective_time); + } + + /** + * Optional. Time after which the BackupVault resource is locked. + * + * Generated from protobuf field optional .google.protobuf.Timestamp effective_time = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEffectiveTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->effective_time = $var; + + return $this; + } + + /** + * Output only. The number of backups in this backup vault. + * + * Generated from protobuf field int64 backup_count = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getBackupCount() + { + return $this->backup_count; + } + + /** + * Output only. The number of backups in this backup vault. + * + * Generated from protobuf field int64 backup_count = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setBackupCount($var) + { + GPBUtil::checkInt64($var); + $this->backup_count = $var; + + return $this; + } + + /** + * Output only. Service account used by the BackupVault Service for this + * BackupVault. The user should grant this account permissions in their + * workload project to enable the service to run backups and restores there. + * + * Generated from protobuf field string service_account = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Output only. Service account used by the BackupVault Service for this + * BackupVault. The user should grant this account permissions in their + * workload project to enable the service to run backups and restores there. + * + * Generated from protobuf field string service_account = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Output only. Total size of the storage used by all backup resources. + * + * Generated from protobuf field int64 total_stored_bytes = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTotalStoredBytes() + { + return $this->total_stored_bytes; + } + + /** + * Output only. Total size of the storage used by all backup resources. + * + * Generated from protobuf field int64 total_stored_bytes = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTotalStoredBytes($var) + { + GPBUtil::checkInt64($var); + $this->total_stored_bytes = $var; + + return $this; + } + + /** + * Output only. Output only + * Immutable after resource creation until resource deletion. + * + * Generated from protobuf field string uid = 21 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Output only + * Immutable after resource creation until resource deletion. + * + * Generated from protobuf field string uid = 21 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Optional. User annotations. See https://google.aip.dev/128#annotations + * Stores small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. User annotations. See https://google.aip.dev/128#annotations + * Stores small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Optional. Note: This field is added for future use case and will not be + * supported in the current release. + * Optional. + * Access restriction for the backup vault. + * Default value is WITHIN_ORGANIZATION if not provided during creation. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.AccessRestriction access_restriction = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAccessRestriction() + { + return $this->access_restriction; + } + + /** + * Optional. Note: This field is added for future use case and will not be + * supported in the current release. + * Optional. + * Access restriction for the backup vault. + * Default value is WITHIN_ORGANIZATION if not provided during creation. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.AccessRestriction access_restriction = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAccessRestriction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupVault\AccessRestriction::class); + $this->access_restriction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVault/AccessRestriction.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVault/AccessRestriction.php new file mode 100644 index 000000000000..ce86fc5cc6ca --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVault/AccessRestriction.php @@ -0,0 +1,72 @@ +google.cloud.backupdr.v1.BackupVault.AccessRestriction + */ +class AccessRestriction +{ + /** + * Access restriction not set. + * + * Generated from protobuf enum ACCESS_RESTRICTION_UNSPECIFIED = 0; + */ + const ACCESS_RESTRICTION_UNSPECIFIED = 0; + /** + * Access to or from resources outside your current project will be denied. + * + * Generated from protobuf enum WITHIN_PROJECT = 1; + */ + const WITHIN_PROJECT = 1; + /** + * Access to or from resources outside your current organization will be + * denied. + * + * Generated from protobuf enum WITHIN_ORGANIZATION = 2; + */ + const WITHIN_ORGANIZATION = 2; + /** + * No access restriction. + * + * Generated from protobuf enum UNRESTRICTED = 3; + */ + const UNRESTRICTED = 3; + + private static $valueToName = [ + self::ACCESS_RESTRICTION_UNSPECIFIED => 'ACCESS_RESTRICTION_UNSPECIFIED', + self::WITHIN_PROJECT => 'WITHIN_PROJECT', + self::WITHIN_ORGANIZATION => 'WITHIN_ORGANIZATION', + self::UNRESTRICTED => 'UNRESTRICTED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AccessRestriction::class, \Google\Cloud\BackupDR\V1\BackupVault_AccessRestriction::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVault/State.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVault/State.php new file mode 100644 index 000000000000..90d1a152ddc9 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVault/State.php @@ -0,0 +1,78 @@ +google.cloud.backupdr.v1.BackupVault.State + */ +class State +{ + /** + * State not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The backup vault is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The backup vault has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The backup vault is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The backup vault is experiencing an issue and might be unusable. + * + * Generated from protobuf enum ERROR = 4; + */ + const ERROR = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BackupDR\V1\BackupVault_State::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVaultView.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVaultView.php new file mode 100644 index 000000000000..2fb4c1492dc7 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupVaultView.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.BackupVaultView + */ +class BackupVaultView +{ + /** + * If the value is not set, the default 'FULL' view is used. + * + * Generated from protobuf enum BACKUP_VAULT_VIEW_UNSPECIFIED = 0; + */ + const BACKUP_VAULT_VIEW_UNSPECIFIED = 0; + /** + * Includes basic data about the Backup Vault, but not the full contents. + * + * Generated from protobuf enum BACKUP_VAULT_VIEW_BASIC = 1; + */ + const BACKUP_VAULT_VIEW_BASIC = 1; + /** + * Includes all data about the Backup Vault. + * This is the default value (for both ListBackupVaults and GetBackupVault). + * + * Generated from protobuf enum BACKUP_VAULT_VIEW_FULL = 2; + */ + const BACKUP_VAULT_VIEW_FULL = 2; + + private static $valueToName = [ + self::BACKUP_VAULT_VIEW_UNSPECIFIED => 'BACKUP_VAULT_VIEW_UNSPECIFIED', + self::BACKUP_VAULT_VIEW_BASIC => 'BACKUP_VAULT_VIEW_BASIC', + self::BACKUP_VAULT_VIEW_FULL => 'BACKUP_VAULT_VIEW_FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupView.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupView.php new file mode 100644 index 000000000000..27ea4394600a --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupView.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.BackupView + */ +class BackupView +{ + /** + * If the value is not set, the default 'FULL' view is used. + * + * Generated from protobuf enum BACKUP_VIEW_UNSPECIFIED = 0; + */ + const BACKUP_VIEW_UNSPECIFIED = 0; + /** + * Includes basic data about the Backup, but not the full contents. + * + * Generated from protobuf enum BACKUP_VIEW_BASIC = 1; + */ + const BACKUP_VIEW_BASIC = 1; + /** + * Includes all data about the Backup. + * This is the default value (for both ListBackups and GetBackup). + * + * Generated from protobuf enum BACKUP_VIEW_FULL = 2; + */ + const BACKUP_VIEW_FULL = 2; + + private static $valueToName = [ + self::BACKUP_VIEW_UNSPECIFIED => 'BACKUP_VIEW_UNSPECIFIED', + self::BACKUP_VIEW_BASIC => 'BACKUP_VIEW_BASIC', + self::BACKUP_VIEW_FULL => 'BACKUP_VIEW_FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupWindow.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupWindow.php new file mode 100644 index 000000000000..8e4da2ca5064 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/BackupWindow.php @@ -0,0 +1,125 @@ +google.cloud.backupdr.v1.BackupWindow + */ +class BackupWindow extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The hour of day (0-23) when the window starts for e.g. if value + * of start hour of day is 6 that mean backup window start at 6:00. + * + * Generated from protobuf field int32 start_hour_of_day = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start_hour_of_day = 0; + /** + * Required. The hour of day (1-24) when the window end for e.g. if value of + * end hour of day is 10 that mean backup window end time is 10:00. + * End hour of day should be greater than start hour of day. + * 0 <= start_hour_of_day < end_hour_of_day <= 24 + * End hour of day is not include in backup window that mean if + * end_hour_of_day= 10 jobs should start before 10:00. + * + * Generated from protobuf field int32 end_hour_of_day = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $end_hour_of_day = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start_hour_of_day + * Required. The hour of day (0-23) when the window starts for e.g. if value + * of start hour of day is 6 that mean backup window start at 6:00. + * @type int $end_hour_of_day + * Required. The hour of day (1-24) when the window end for e.g. if value of + * end hour of day is 10 that mean backup window end time is 10:00. + * End hour of day should be greater than start hour of day. + * 0 <= start_hour_of_day < end_hour_of_day <= 24 + * End hour of day is not include in backup window that mean if + * end_hour_of_day= 10 jobs should start before 10:00. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. The hour of day (0-23) when the window starts for e.g. if value + * of start hour of day is 6 that mean backup window start at 6:00. + * + * Generated from protobuf field int32 start_hour_of_day = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getStartHourOfDay() + { + return $this->start_hour_of_day; + } + + /** + * Required. The hour of day (0-23) when the window starts for e.g. if value + * of start hour of day is 6 that mean backup window start at 6:00. + * + * Generated from protobuf field int32 start_hour_of_day = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setStartHourOfDay($var) + { + GPBUtil::checkInt32($var); + $this->start_hour_of_day = $var; + + return $this; + } + + /** + * Required. The hour of day (1-24) when the window end for e.g. if value of + * end hour of day is 10 that mean backup window end time is 10:00. + * End hour of day should be greater than start hour of day. + * 0 <= start_hour_of_day < end_hour_of_day <= 24 + * End hour of day is not include in backup window that mean if + * end_hour_of_day= 10 jobs should start before 10:00. + * + * Generated from protobuf field int32 end_hour_of_day = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getEndHourOfDay() + { + return $this->end_hour_of_day; + } + + /** + * Required. The hour of day (1-24) when the window end for e.g. if value of + * end hour of day is 10 that mean backup window end time is 10:00. + * End hour of day should be greater than start hour of day. + * 0 <= start_hour_of_day < end_hour_of_day <= 24 + * End hour of day is not include in backup window that mean if + * end_hour_of_day= 10 jobs should start before 10:00. + * + * Generated from protobuf field int32 end_hour_of_day = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setEndHourOfDay($var) + { + GPBUtil::checkInt32($var); + $this->end_hour_of_day = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceBackupProperties.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceBackupProperties.php new file mode 100644 index 000000000000..8f9a6f915880 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceBackupProperties.php @@ -0,0 +1,716 @@ +google.cloud.backupdr.v1.ComputeInstanceBackupProperties + */ +class ComputeInstanceBackupProperties extends \Google\Protobuf\Internal\Message +{ + /** + * An optional text description for the instances that are created from these + * properties. + * + * Generated from protobuf field optional string description = 1; + */ + protected $description = null; + /** + * A list of tags to apply to the instances that are created from these + * properties. The tags identify valid sources or targets for network + * firewalls. The setTags method can modify this list of tags. Each tag within + * the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 2; + */ + protected $tags = null; + /** + * The machine type to use for instances that are created from these + * properties. + * + * Generated from protobuf field optional string machine_type = 3; + */ + protected $machine_type = null; + /** + * Enables instances created based on these properties to send packets with + * source IP addresses other than their own and receive packets with + * destination IP addresses other than their own. If these instances will be + * used as an IP gateway or it will be set as the next-hop in a Route + * resource, specify `true`. If unsure, leave this set to `false`. See the + * https://cloud.google.com/vpc/docs/using-routes#canipforward + * documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 4; + */ + protected $can_ip_forward = null; + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interface = 5; + */ + private $network_interface; + /** + * An array of disks that are associated with the instances that are created + * from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disk = 6; + */ + private $disk; + /** + * The metadata key/value pairs to assign to instances that are created from + * these properties. These pairs can consist of custom metadata or predefined + * keys. See https://cloud.google.com/compute/docs/metadata/overview for more + * information. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 7; + */ + protected $metadata = null; + /** + * A list of service accounts with specified scopes. Access tokens for these + * service accounts are available to the instances that are created from + * these properties. Use metadata queries to obtain the access tokens for + * these instances. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_account = 8; + */ + private $service_account; + /** + * Specifies the scheduling options for the instances that are created from + * these properties. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 9; + */ + protected $scheduling = null; + /** + * A list of guest accelerator cards' type and count to use for instances + * created from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerator = 10; + */ + private $guest_accelerator; + /** + * Minimum cpu/platform to be used by instances. The instance may be + * scheduled on the specified or newer cpu/platform. Applicable values are the + * friendly names of CPU platforms, such as + * `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + * For more information, read + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * + * Generated from protobuf field optional string min_cpu_platform = 11; + */ + protected $min_cpu_platform = null; + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and + * "NONE". The default value is "NONE" if it is not specified. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12; + */ + protected $key_revocation_action_type = null; + /** + * The source instance used to create this backup. This can be a partial or + * full URL to the resource. For example, the following are valid values: + * -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * -projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 13; + */ + protected $source_instance = null; + /** + * Labels to apply to instances that are created from these properties. + * + * Generated from protobuf field map labels = 14; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * An optional text description for the instances that are created from these + * properties. + * @type \Google\Cloud\BackupDR\V1\Tags $tags + * A list of tags to apply to the instances that are created from these + * properties. The tags identify valid sources or targets for network + * firewalls. The setTags method can modify this list of tags. Each tag within + * the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + * @type string $machine_type + * The machine type to use for instances that are created from these + * properties. + * @type bool $can_ip_forward + * Enables instances created based on these properties to send packets with + * source IP addresses other than their own and receive packets with + * destination IP addresses other than their own. If these instances will be + * used as an IP gateway or it will be set as the next-hop in a Route + * resource, specify `true`. If unsure, leave this set to `false`. See the + * https://cloud.google.com/vpc/docs/using-routes#canipforward + * documentation for more information. + * @type array<\Google\Cloud\BackupDR\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interface + * An array of network access configurations for this interface. + * @type array<\Google\Cloud\BackupDR\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $disk + * An array of disks that are associated with the instances that are created + * from these properties. + * @type \Google\Cloud\BackupDR\V1\Metadata $metadata + * The metadata key/value pairs to assign to instances that are created from + * these properties. These pairs can consist of custom metadata or predefined + * keys. See https://cloud.google.com/compute/docs/metadata/overview for more + * information. + * @type array<\Google\Cloud\BackupDR\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $service_account + * A list of service accounts with specified scopes. Access tokens for these + * service accounts are available to the instances that are created from + * these properties. Use metadata queries to obtain the access tokens for + * these instances. + * @type \Google\Cloud\BackupDR\V1\Scheduling $scheduling + * Specifies the scheduling options for the instances that are created from + * these properties. + * @type array<\Google\Cloud\BackupDR\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $guest_accelerator + * A list of guest accelerator cards' type and count to use for instances + * created from these properties. + * @type string $min_cpu_platform + * Minimum cpu/platform to be used by instances. The instance may be + * scheduled on the specified or newer cpu/platform. Applicable values are the + * friendly names of CPU platforms, such as + * `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + * For more information, read + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * @type int $key_revocation_action_type + * KeyRevocationActionType of the instance. Supported options are "STOP" and + * "NONE". The default value is "NONE" if it is not specified. + * @type string $source_instance + * The source instance used to create this backup. This can be a partial or + * full URL to the resource. For example, the following are valid values: + * -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * -projects/project/zones/zone/instances/instance + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to instances that are created from these properties. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * An optional text description for the instances that are created from these + * properties. + * + * Generated from protobuf field optional string description = 1; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional text description for the instances that are created from these + * properties. + * + * Generated from protobuf field optional string description = 1; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * A list of tags to apply to the instances that are created from these + * properties. The tags identify valid sources or targets for network + * firewalls. The setTags method can modify this list of tags. Each tag within + * the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 2; + * @return \Google\Cloud\BackupDR\V1\Tags|null + */ + public function getTags() + { + return $this->tags; + } + + public function hasTags() + { + return isset($this->tags); + } + + public function clearTags() + { + unset($this->tags); + } + + /** + * A list of tags to apply to the instances that are created from these + * properties. The tags identify valid sources or targets for network + * firewalls. The setTags method can modify this list of tags. Each tag within + * the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 2; + * @param \Google\Cloud\BackupDR\V1\Tags $var + * @return $this + */ + public function setTags($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Tags::class); + $this->tags = $var; + + return $this; + } + + /** + * The machine type to use for instances that are created from these + * properties. + * + * Generated from protobuf field optional string machine_type = 3; + * @return string + */ + public function getMachineType() + { + return isset($this->machine_type) ? $this->machine_type : ''; + } + + public function hasMachineType() + { + return isset($this->machine_type); + } + + public function clearMachineType() + { + unset($this->machine_type); + } + + /** + * The machine type to use for instances that are created from these + * properties. + * + * Generated from protobuf field optional string machine_type = 3; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * Enables instances created based on these properties to send packets with + * source IP addresses other than their own and receive packets with + * destination IP addresses other than their own. If these instances will be + * used as an IP gateway or it will be set as the next-hop in a Route + * resource, specify `true`. If unsure, leave this set to `false`. See the + * https://cloud.google.com/vpc/docs/using-routes#canipforward + * documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 4; + * @return bool + */ + public function getCanIpForward() + { + return isset($this->can_ip_forward) ? $this->can_ip_forward : false; + } + + public function hasCanIpForward() + { + return isset($this->can_ip_forward); + } + + public function clearCanIpForward() + { + unset($this->can_ip_forward); + } + + /** + * Enables instances created based on these properties to send packets with + * source IP addresses other than their own and receive packets with + * destination IP addresses other than their own. If these instances will be + * used as an IP gateway or it will be set as the next-hop in a Route + * resource, specify `true`. If unsure, leave this set to `false`. See the + * https://cloud.google.com/vpc/docs/using-routes#canipforward + * documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 4; + * @param bool $var + * @return $this + */ + public function setCanIpForward($var) + { + GPBUtil::checkBool($var); + $this->can_ip_forward = $var; + + return $this; + } + + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interface = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterface() + { + return $this->network_interface; + } + + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interface = 5; + * @param array<\Google\Cloud\BackupDR\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterface($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\NetworkInterface::class); + $this->network_interface = $arr; + + return $this; + } + + /** + * An array of disks that are associated with the instances that are created + * from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disk = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisk() + { + return $this->disk; + } + + /** + * An array of disks that are associated with the instances that are created + * from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disk = 6; + * @param array<\Google\Cloud\BackupDR\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisk($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AttachedDisk::class); + $this->disk = $arr; + + return $this; + } + + /** + * The metadata key/value pairs to assign to instances that are created from + * these properties. These pairs can consist of custom metadata or predefined + * keys. See https://cloud.google.com/compute/docs/metadata/overview for more + * information. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 7; + * @return \Google\Cloud\BackupDR\V1\Metadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * The metadata key/value pairs to assign to instances that are created from + * these properties. These pairs can consist of custom metadata or predefined + * keys. See https://cloud.google.com/compute/docs/metadata/overview for more + * information. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 7; + * @param \Google\Cloud\BackupDR\V1\Metadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Metadata::class); + $this->metadata = $var; + + return $this; + } + + /** + * A list of service accounts with specified scopes. Access tokens for these + * service accounts are available to the instances that are created from + * these properties. Use metadata queries to obtain the access tokens for + * these instances. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_account = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * A list of service accounts with specified scopes. Access tokens for these + * service accounts are available to the instances that are created from + * these properties. Use metadata queries to obtain the access tokens for + * these instances. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_account = 8; + * @param array<\Google\Cloud\BackupDR\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceAccount($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\ServiceAccount::class); + $this->service_account = $arr; + + return $this; + } + + /** + * Specifies the scheduling options for the instances that are created from + * these properties. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 9; + * @return \Google\Cloud\BackupDR\V1\Scheduling|null + */ + public function getScheduling() + { + return $this->scheduling; + } + + public function hasScheduling() + { + return isset($this->scheduling); + } + + public function clearScheduling() + { + unset($this->scheduling); + } + + /** + * Specifies the scheduling options for the instances that are created from + * these properties. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 9; + * @param \Google\Cloud\BackupDR\V1\Scheduling $var + * @return $this + */ + public function setScheduling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Scheduling::class); + $this->scheduling = $var; + + return $this; + } + + /** + * A list of guest accelerator cards' type and count to use for instances + * created from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerator = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestAccelerator() + { + return $this->guest_accelerator; + } + + /** + * A list of guest accelerator cards' type and count to use for instances + * created from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerator = 10; + * @param array<\Google\Cloud\BackupDR\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestAccelerator($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AcceleratorConfig::class); + $this->guest_accelerator = $arr; + + return $this; + } + + /** + * Minimum cpu/platform to be used by instances. The instance may be + * scheduled on the specified or newer cpu/platform. Applicable values are the + * friendly names of CPU platforms, such as + * `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + * For more information, read + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * + * Generated from protobuf field optional string min_cpu_platform = 11; + * @return string + */ + public function getMinCpuPlatform() + { + return isset($this->min_cpu_platform) ? $this->min_cpu_platform : ''; + } + + public function hasMinCpuPlatform() + { + return isset($this->min_cpu_platform); + } + + public function clearMinCpuPlatform() + { + unset($this->min_cpu_platform); + } + + /** + * Minimum cpu/platform to be used by instances. The instance may be + * scheduled on the specified or newer cpu/platform. Applicable values are the + * friendly names of CPU platforms, such as + * `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + * For more information, read + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * + * Generated from protobuf field optional string min_cpu_platform = 11; + * @param string $var + * @return $this + */ + public function setMinCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->min_cpu_platform = $var; + + return $this; + } + + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and + * "NONE". The default value is "NONE" if it is not specified. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12; + * @return int + */ + public function getKeyRevocationActionType() + { + return isset($this->key_revocation_action_type) ? $this->key_revocation_action_type : 0; + } + + public function hasKeyRevocationActionType() + { + return isset($this->key_revocation_action_type); + } + + public function clearKeyRevocationActionType() + { + unset($this->key_revocation_action_type); + } + + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and + * "NONE". The default value is "NONE" if it is not specified. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12; + * @param int $var + * @return $this + */ + public function setKeyRevocationActionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\KeyRevocationActionType::class); + $this->key_revocation_action_type = $var; + + return $this; + } + + /** + * The source instance used to create this backup. This can be a partial or + * full URL to the resource. For example, the following are valid values: + * -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * -projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 13; + * @return string + */ + public function getSourceInstance() + { + return isset($this->source_instance) ? $this->source_instance : ''; + } + + public function hasSourceInstance() + { + return isset($this->source_instance); + } + + public function clearSourceInstance() + { + unset($this->source_instance); + } + + /** + * The source instance used to create this backup. This can be a partial or + * full URL to the resource. For example, the following are valid values: + * -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * -projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 13; + * @param string $var + * @return $this + */ + public function setSourceInstance($var) + { + GPBUtil::checkString($var, True); + $this->source_instance = $var; + + return $this; + } + + /** + * Labels to apply to instances that are created from these properties. + * + * Generated from protobuf field map labels = 14; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to instances that are created from these properties. + * + * Generated from protobuf field map labels = 14; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceDataSourceProperties.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceDataSourceProperties.php new file mode 100644 index 000000000000..28fa438fe071 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceDataSourceProperties.php @@ -0,0 +1,204 @@ +google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + */ +class ComputeInstanceDataSourceProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the compute instance backed up by the datasource. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The description of the Compute Engine instance. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * The machine type of the instance. + * + * Generated from protobuf field string machine_type = 3; + */ + protected $machine_type = ''; + /** + * The total number of disks attached to the Instance. + * + * Generated from protobuf field int64 total_disk_count = 4; + */ + protected $total_disk_count = 0; + /** + * The sum of all the disk sizes. + * + * Generated from protobuf field int64 total_disk_size_gb = 5; + */ + protected $total_disk_size_gb = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the compute instance backed up by the datasource. + * @type string $description + * The description of the Compute Engine instance. + * @type string $machine_type + * The machine type of the instance. + * @type int|string $total_disk_count + * The total number of disks attached to the Instance. + * @type int|string $total_disk_size_gb + * The sum of all the disk sizes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Name of the compute instance backed up by the datasource. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the compute instance backed up by the datasource. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The description of the Compute Engine instance. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * The description of the Compute Engine instance. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The machine type of the instance. + * + * Generated from protobuf field string machine_type = 3; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * The machine type of the instance. + * + * Generated from protobuf field string machine_type = 3; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * The total number of disks attached to the Instance. + * + * Generated from protobuf field int64 total_disk_count = 4; + * @return int|string + */ + public function getTotalDiskCount() + { + return $this->total_disk_count; + } + + /** + * The total number of disks attached to the Instance. + * + * Generated from protobuf field int64 total_disk_count = 4; + * @param int|string $var + * @return $this + */ + public function setTotalDiskCount($var) + { + GPBUtil::checkInt64($var); + $this->total_disk_count = $var; + + return $this; + } + + /** + * The sum of all the disk sizes. + * + * Generated from protobuf field int64 total_disk_size_gb = 5; + * @return int|string + */ + public function getTotalDiskSizeGb() + { + return $this->total_disk_size_gb; + } + + /** + * The sum of all the disk sizes. + * + * Generated from protobuf field int64 total_disk_size_gb = 5; + * @param int|string $var + * @return $this + */ + public function setTotalDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->total_disk_size_gb = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceRestoreProperties.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceRestoreProperties.php new file mode 100644 index 000000000000..b5ed7b1b9feb --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceRestoreProperties.php @@ -0,0 +1,1150 @@ +google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + */ +class ComputeInstanceRestoreProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the compute instance. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = null; + /** + * Optional. Controls for advanced machine-related behavior features. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AdvancedMachineFeatures advanced_machine_features = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $advanced_machine_features = null; + /** + * Optional. Allows this instance to send and receive packets with + * non-matching destination or source IPs. + * + * Generated from protobuf field optional bool can_ip_forward = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $can_ip_forward = null; + /** + * Optional. Controls Confidential compute options on the instance + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ConfidentialInstanceConfig confidential_instance_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $confidential_instance_config = null; + /** + * Optional. Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $deletion_protection = null; + /** + * Optional. An optional description of this resource. Provide this property + * when you create the resource. + * + * Generated from protobuf field optional string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = null; + /** + * Optional. Array of disks associated with this instance. Persistent disks + * must be created before you can assign them. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disks = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $disks; + /** + * Optional. Enables display device for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.DisplayDevice display_device = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_device = null; + /** + * Optional. A list of the type and count of accelerator cards attached to the + * instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerators = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $guest_accelerators; + /** + * Optional. Specifies the hostname of the instance. The specified hostname + * must be RFC1035 compliant. If hostname is not specified, the default + * hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + * DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + * DNS. + * + * Generated from protobuf field optional string hostname = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $hostname = null; + /** + * Optional. Encrypts suspended data for an instance with a + * customer-managed encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey instance_encryption_key = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $instance_encryption_key = null; + /** + * Optional. KeyRevocationActionType of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key_revocation_action_type = null; + /** + * Optional. Labels to apply to this instance. + * + * Generated from protobuf field map labels = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Full or partial URL of the machine type resource to use for this + * instance. + * + * Generated from protobuf field optional string machine_type = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $machine_type = null; + /** + * Optional. This includes custom metadata and predefined keys. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metadata = null; + /** + * Optional. Minimum CPU platform to use for this instance. + * + * Generated from protobuf field optional string min_cpu_platform = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $min_cpu_platform = null; + /** + * Optional. An array of network configurations for this instance. These + * specify how interfaces are configured to interact with other network + * services, such as connecting to the internet. Multiple interfaces are + * supported per instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interfaces = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $network_interfaces; + /** + * Optional. Configure network performance such as egress bandwidth tier. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig network_performance_config = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_performance_config = null; + /** + * Input only. Additional params passed with the request, but not persisted + * as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.InstanceParams params = 19 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $params = null; + /** + * Optional. The private IPv6 google access type for the VM. + * If not specified, use INHERIT_FROM_SUBNETWORK as default. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess private_ipv6_google_access = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $private_ipv6_google_access = null; + /** + * Optional. Specifies the reservations that this instance can consume from. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity allocation_affinity = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allocation_affinity = null; + /** + * Optional. Resource policies applied to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $resource_policies; + /** + * Optional. Sets the scheduling options for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $scheduling = null; + /** + * Optional. A list of service accounts, with their specified scopes, + * authorized for this instance. Only one service account per VM instance is + * supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_accounts = 24 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $service_accounts; + /** + * Optional. Tags to apply to this instance. Tags are used to identify valid + * sources or targets for network firewalls and are specified by the client + * during instance creation. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 26 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tags = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the compute instance. + * @type \Google\Cloud\BackupDR\V1\AdvancedMachineFeatures $advanced_machine_features + * Optional. Controls for advanced machine-related behavior features. + * @type bool $can_ip_forward + * Optional. Allows this instance to send and receive packets with + * non-matching destination or source IPs. + * @type \Google\Cloud\BackupDR\V1\ConfidentialInstanceConfig $confidential_instance_config + * Optional. Controls Confidential compute options on the instance + * @type bool $deletion_protection + * Optional. Whether the resource should be protected against deletion. + * @type string $description + * Optional. An optional description of this resource. Provide this property + * when you create the resource. + * @type array<\Google\Cloud\BackupDR\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $disks + * Optional. Array of disks associated with this instance. Persistent disks + * must be created before you can assign them. + * @type \Google\Cloud\BackupDR\V1\DisplayDevice $display_device + * Optional. Enables display device for the instance. + * @type array<\Google\Cloud\BackupDR\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $guest_accelerators + * Optional. A list of the type and count of accelerator cards attached to the + * instance. + * @type string $hostname + * Optional. Specifies the hostname of the instance. The specified hostname + * must be RFC1035 compliant. If hostname is not specified, the default + * hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + * DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + * DNS. + * @type \Google\Cloud\BackupDR\V1\CustomerEncryptionKey $instance_encryption_key + * Optional. Encrypts suspended data for an instance with a + * customer-managed encryption key. + * @type int $key_revocation_action_type + * Optional. KeyRevocationActionType of the instance. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels to apply to this instance. + * @type string $machine_type + * Optional. Full or partial URL of the machine type resource to use for this + * instance. + * @type \Google\Cloud\BackupDR\V1\Metadata $metadata + * Optional. This includes custom metadata and predefined keys. + * @type string $min_cpu_platform + * Optional. Minimum CPU platform to use for this instance. + * @type array<\Google\Cloud\BackupDR\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * Optional. An array of network configurations for this instance. These + * specify how interfaces are configured to interact with other network + * services, such as connecting to the internet. Multiple interfaces are + * supported per instance. + * @type \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig $network_performance_config + * Optional. Configure network performance such as egress bandwidth tier. + * @type \Google\Cloud\BackupDR\V1\InstanceParams $params + * Input only. Additional params passed with the request, but not persisted + * as part of resource payload. + * @type int $private_ipv6_google_access + * Optional. The private IPv6 google access type for the VM. + * If not specified, use INHERIT_FROM_SUBNETWORK as default. + * @type \Google\Cloud\BackupDR\V1\AllocationAffinity $allocation_affinity + * Optional. Specifies the reservations that this instance can consume from. + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Optional. Resource policies applied to this instance. + * @type \Google\Cloud\BackupDR\V1\Scheduling $scheduling + * Optional. Sets the scheduling options for this instance. + * @type array<\Google\Cloud\BackupDR\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $service_accounts + * Optional. A list of service accounts, with their specified scopes, + * authorized for this instance. Only one service account per VM instance is + * supported. + * @type \Google\Cloud\BackupDR\V1\Tags $tags + * Optional. Tags to apply to this instance. Tags are used to identify valid + * sources or targets for network firewalls and are specified by the client + * during instance creation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the compute instance. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Required. Name of the compute instance. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Controls for advanced machine-related behavior features. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AdvancedMachineFeatures advanced_machine_features = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\AdvancedMachineFeatures|null + */ + public function getAdvancedMachineFeatures() + { + return $this->advanced_machine_features; + } + + public function hasAdvancedMachineFeatures() + { + return isset($this->advanced_machine_features); + } + + public function clearAdvancedMachineFeatures() + { + unset($this->advanced_machine_features); + } + + /** + * Optional. Controls for advanced machine-related behavior features. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AdvancedMachineFeatures advanced_machine_features = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\AdvancedMachineFeatures $var + * @return $this + */ + public function setAdvancedMachineFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\AdvancedMachineFeatures::class); + $this->advanced_machine_features = $var; + + return $this; + } + + /** + * Optional. Allows this instance to send and receive packets with + * non-matching destination or source IPs. + * + * Generated from protobuf field optional bool can_ip_forward = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getCanIpForward() + { + return isset($this->can_ip_forward) ? $this->can_ip_forward : false; + } + + public function hasCanIpForward() + { + return isset($this->can_ip_forward); + } + + public function clearCanIpForward() + { + unset($this->can_ip_forward); + } + + /** + * Optional. Allows this instance to send and receive packets with + * non-matching destination or source IPs. + * + * Generated from protobuf field optional bool can_ip_forward = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setCanIpForward($var) + { + GPBUtil::checkBool($var); + $this->can_ip_forward = $var; + + return $this; + } + + /** + * Optional. Controls Confidential compute options on the instance + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ConfidentialInstanceConfig confidential_instance_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\ConfidentialInstanceConfig|null + */ + public function getConfidentialInstanceConfig() + { + return $this->confidential_instance_config; + } + + public function hasConfidentialInstanceConfig() + { + return isset($this->confidential_instance_config); + } + + public function clearConfidentialInstanceConfig() + { + unset($this->confidential_instance_config); + } + + /** + * Optional. Controls Confidential compute options on the instance + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ConfidentialInstanceConfig confidential_instance_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\ConfidentialInstanceConfig $var + * @return $this + */ + public function setConfidentialInstanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ConfidentialInstanceConfig::class); + $this->confidential_instance_config = $var; + + return $this; + } + + /** + * Optional. Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDeletionProtection() + { + return isset($this->deletion_protection) ? $this->deletion_protection : false; + } + + public function hasDeletionProtection() + { + return isset($this->deletion_protection); + } + + public function clearDeletionProtection() + { + unset($this->deletion_protection); + } + + /** + * Optional. Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDeletionProtection($var) + { + GPBUtil::checkBool($var); + $this->deletion_protection = $var; + + return $this; + } + + /** + * Optional. An optional description of this resource. Provide this property + * when you create the resource. + * + * Generated from protobuf field optional string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Optional. An optional description of this resource. Provide this property + * when you create the resource. + * + * Generated from protobuf field optional string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Array of disks associated with this instance. Persistent disks + * must be created before you can assign them. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disks = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Optional. Array of disks associated with this instance. Persistent disks + * must be created before you can assign them. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disks = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AttachedDisk::class); + $this->disks = $arr; + + return $this; + } + + /** + * Optional. Enables display device for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.DisplayDevice display_device = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\DisplayDevice|null + */ + public function getDisplayDevice() + { + return $this->display_device; + } + + public function hasDisplayDevice() + { + return isset($this->display_device); + } + + public function clearDisplayDevice() + { + unset($this->display_device); + } + + /** + * Optional. Enables display device for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.DisplayDevice display_device = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\DisplayDevice $var + * @return $this + */ + public function setDisplayDevice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\DisplayDevice::class); + $this->display_device = $var; + + return $this; + } + + /** + * Optional. A list of the type and count of accelerator cards attached to the + * instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerators = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestAccelerators() + { + return $this->guest_accelerators; + } + + /** + * Optional. A list of the type and count of accelerator cards attached to the + * instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerators = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AcceleratorConfig::class); + $this->guest_accelerators = $arr; + + return $this; + } + + /** + * Optional. Specifies the hostname of the instance. The specified hostname + * must be RFC1035 compliant. If hostname is not specified, the default + * hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + * DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + * DNS. + * + * Generated from protobuf field optional string hostname = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getHostname() + { + return isset($this->hostname) ? $this->hostname : ''; + } + + public function hasHostname() + { + return isset($this->hostname); + } + + public function clearHostname() + { + unset($this->hostname); + } + + /** + * Optional. Specifies the hostname of the instance. The specified hostname + * must be RFC1035 compliant. If hostname is not specified, the default + * hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + * DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + * DNS. + * + * Generated from protobuf field optional string hostname = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setHostname($var) + { + GPBUtil::checkString($var, True); + $this->hostname = $var; + + return $this; + } + + /** + * Optional. Encrypts suspended data for an instance with a + * customer-managed encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey instance_encryption_key = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\CustomerEncryptionKey|null + */ + public function getInstanceEncryptionKey() + { + return $this->instance_encryption_key; + } + + public function hasInstanceEncryptionKey() + { + return isset($this->instance_encryption_key); + } + + public function clearInstanceEncryptionKey() + { + unset($this->instance_encryption_key); + } + + /** + * Optional. Encrypts suspended data for an instance with a + * customer-managed encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey instance_encryption_key = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setInstanceEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\CustomerEncryptionKey::class); + $this->instance_encryption_key = $var; + + return $this; + } + + /** + * Optional. KeyRevocationActionType of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getKeyRevocationActionType() + { + return isset($this->key_revocation_action_type) ? $this->key_revocation_action_type : 0; + } + + public function hasKeyRevocationActionType() + { + return isset($this->key_revocation_action_type); + } + + public function clearKeyRevocationActionType() + { + unset($this->key_revocation_action_type); + } + + /** + * Optional. KeyRevocationActionType of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setKeyRevocationActionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\KeyRevocationActionType::class); + $this->key_revocation_action_type = $var; + + return $this; + } + + /** + * Optional. Labels to apply to this instance. + * + * Generated from protobuf field map labels = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels to apply to this instance. + * + * Generated from protobuf field map labels = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. Full or partial URL of the machine type resource to use for this + * instance. + * + * Generated from protobuf field optional string machine_type = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMachineType() + { + return isset($this->machine_type) ? $this->machine_type : ''; + } + + public function hasMachineType() + { + return isset($this->machine_type); + } + + public function clearMachineType() + { + unset($this->machine_type); + } + + /** + * Optional. Full or partial URL of the machine type resource to use for this + * instance. + * + * Generated from protobuf field optional string machine_type = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * Optional. This includes custom metadata and predefined keys. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\Metadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Optional. This includes custom metadata and predefined keys. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\Metadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Metadata::class); + $this->metadata = $var; + + return $this; + } + + /** + * Optional. Minimum CPU platform to use for this instance. + * + * Generated from protobuf field optional string min_cpu_platform = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMinCpuPlatform() + { + return isset($this->min_cpu_platform) ? $this->min_cpu_platform : ''; + } + + public function hasMinCpuPlatform() + { + return isset($this->min_cpu_platform); + } + + public function clearMinCpuPlatform() + { + unset($this->min_cpu_platform); + } + + /** + * Optional. Minimum CPU platform to use for this instance. + * + * Generated from protobuf field optional string min_cpu_platform = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMinCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->min_cpu_platform = $var; + + return $this; + } + + /** + * Optional. An array of network configurations for this instance. These + * specify how interfaces are configured to interact with other network + * services, such as connecting to the internet. Multiple interfaces are + * supported per instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interfaces = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * Optional. An array of network configurations for this instance. These + * specify how interfaces are configured to interact with other network + * services, such as connecting to the internet. Multiple interfaces are + * supported per instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interfaces = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\NetworkInterface::class); + $this->network_interfaces = $arr; + + return $this; + } + + /** + * Optional. Configure network performance such as egress bandwidth tier. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig network_performance_config = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig|null + */ + public function getNetworkPerformanceConfig() + { + return $this->network_performance_config; + } + + public function hasNetworkPerformanceConfig() + { + return isset($this->network_performance_config); + } + + public function clearNetworkPerformanceConfig() + { + unset($this->network_performance_config); + } + + /** + * Optional. Configure network performance such as egress bandwidth tier. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig network_performance_config = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig $var + * @return $this + */ + public function setNetworkPerformanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig::class); + $this->network_performance_config = $var; + + return $this; + } + + /** + * Input only. Additional params passed with the request, but not persisted + * as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.InstanceParams params = 19 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\InstanceParams|null + */ + public function getParams() + { + return $this->params; + } + + public function hasParams() + { + return isset($this->params); + } + + public function clearParams() + { + unset($this->params); + } + + /** + * Input only. Additional params passed with the request, but not persisted + * as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.InstanceParams params = 19 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\InstanceParams $var + * @return $this + */ + public function setParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\InstanceParams::class); + $this->params = $var; + + return $this; + } + + /** + * Optional. The private IPv6 google access type for the VM. + * If not specified, use INHERIT_FROM_SUBNETWORK as default. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess private_ipv6_google_access = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPrivateIpv6GoogleAccess() + { + return isset($this->private_ipv6_google_access) ? $this->private_ipv6_google_access : 0; + } + + public function hasPrivateIpv6GoogleAccess() + { + return isset($this->private_ipv6_google_access); + } + + public function clearPrivateIpv6GoogleAccess() + { + unset($this->private_ipv6_google_access); + } + + /** + * Optional. The private IPv6 google access type for the VM. + * If not specified, use INHERIT_FROM_SUBNETWORK as default. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess private_ipv6_google_access = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPrivateIpv6GoogleAccess($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties\InstancePrivateIpv6GoogleAccess::class); + $this->private_ipv6_google_access = $var; + + return $this; + } + + /** + * Optional. Specifies the reservations that this instance can consume from. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity allocation_affinity = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\AllocationAffinity|null + */ + public function getAllocationAffinity() + { + return $this->allocation_affinity; + } + + public function hasAllocationAffinity() + { + return isset($this->allocation_affinity); + } + + public function clearAllocationAffinity() + { + unset($this->allocation_affinity); + } + + /** + * Optional. Specifies the reservations that this instance can consume from. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity allocation_affinity = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\AllocationAffinity $var + * @return $this + */ + public function setAllocationAffinity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\AllocationAffinity::class); + $this->allocation_affinity = $var; + + return $this; + } + + /** + * Optional. Resource policies applied to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Optional. Resource policies applied to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + + /** + * Optional. Sets the scheduling options for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\Scheduling|null + */ + public function getScheduling() + { + return $this->scheduling; + } + + public function hasScheduling() + { + return isset($this->scheduling); + } + + public function clearScheduling() + { + unset($this->scheduling); + } + + /** + * Optional. Sets the scheduling options for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\Scheduling $var + * @return $this + */ + public function setScheduling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Scheduling::class); + $this->scheduling = $var; + + return $this; + } + + /** + * Optional. A list of service accounts, with their specified scopes, + * authorized for this instance. Only one service account per VM instance is + * supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_accounts = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceAccounts() + { + return $this->service_accounts; + } + + /** + * Optional. A list of service accounts, with their specified scopes, + * authorized for this instance. Only one service account per VM instance is + * supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_accounts = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceAccounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\ServiceAccount::class); + $this->service_accounts = $arr; + + return $this; + } + + /** + * Optional. Tags to apply to this instance. Tags are used to identify valid + * sources or targets for network firewalls and are specified by the client + * during instance creation. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\Tags|null + */ + public function getTags() + { + return $this->tags; + } + + public function hasTags() + { + return isset($this->tags); + } + + public function clearTags() + { + unset($this->tags); + } + + /** + * Optional. Tags to apply to this instance. Tags are used to identify valid + * sources or targets for network firewalls and are specified by the client + * during instance creation. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\Tags $var + * @return $this + */ + public function setTags($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Tags::class); + $this->tags = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php new file mode 100644 index 000000000000..8c0f3a4e5c74 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php @@ -0,0 +1,78 @@ +google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess + */ +class InstancePrivateIpv6GoogleAccess +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + */ + const INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + /** + * Each network interface inherits PrivateIpv6GoogleAccess from its + * subnetwork. + * + * Generated from protobuf enum INHERIT_FROM_SUBNETWORK = 1; + */ + const INHERIT_FROM_SUBNETWORK = 1; + /** + * Outbound private IPv6 access from VMs in this subnet to Google services. + * If specified, the subnetwork who is attached to the instance's default + * network interface will be assigned an internal IPv6 prefix if it doesn't + * have before. + * + * Generated from protobuf enum ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2; + */ + const ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2; + /** + * Bidirectional private IPv6 access to/from Google services. If + * specified, the subnetwork who is attached to the instance's default + * network interface will be assigned an internal IPv6 prefix if it doesn't + * have before. + * + * Generated from protobuf enum ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3; + */ + const ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3; + + private static $valueToName = [ + self::INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED => 'INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED', + self::INHERIT_FROM_SUBNETWORK => 'INHERIT_FROM_SUBNETWORK', + self::ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE => 'ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE', + self::ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE => 'ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstancePrivateIpv6GoogleAccess::class, \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties_InstancePrivateIpv6GoogleAccess::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceTargetEnvironment.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceTargetEnvironment.php new file mode 100644 index 000000000000..6251eea36937 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceTargetEnvironment.php @@ -0,0 +1,102 @@ +google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + */ +class ComputeInstanceTargetEnvironment extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Target project for the Compute Engine instance. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Required. The zone of the Compute Engine instance. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Required. Target project for the Compute Engine instance. + * @type string $zone + * Required. The zone of the Compute Engine instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Required. Target project for the Compute Engine instance. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Required. Target project for the Compute Engine instance. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * Required. The zone of the Compute Engine instance. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Required. The zone of the Compute Engine instance. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ConfidentialInstanceConfig.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ConfidentialInstanceConfig.php new file mode 100644 index 000000000000..276f5b0eaf46 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ConfidentialInstanceConfig.php @@ -0,0 +1,81 @@ +google.cloud.backupdr.v1.ConfidentialInstanceConfig + */ +class ConfidentialInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Defines whether the instance should have confidential compute + * enabled. + * + * Generated from protobuf field optional bool enable_confidential_compute = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_confidential_compute = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_confidential_compute + * Optional. Defines whether the instance should have confidential compute + * enabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Defines whether the instance should have confidential compute + * enabled. + * + * Generated from protobuf field optional bool enable_confidential_compute = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute) ? $this->enable_confidential_compute : false; + } + + public function hasEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute); + } + + public function clearEnableConfidentialCompute() + { + unset($this->enable_confidential_compute); + } + + /** + * Optional. Defines whether the instance should have confidential compute + * enabled. + * + * Generated from protobuf field optional bool enable_confidential_compute = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableConfidentialCompute($var) + { + GPBUtil::checkBool($var); + $this->enable_confidential_compute = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupPlanAssociationRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupPlanAssociationRequest.php new file mode 100644 index 000000000000..9462d6101471 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupPlanAssociationRequest.php @@ -0,0 +1,252 @@ +google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + */ +class CreateBackupPlanAssociationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * + * Generated from protobuf field string backup_plan_association_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_plan_association_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_association = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_plan_association = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BackupDR\V1\BackupPlanAssociation $backupPlanAssociation Required. The resource being created + * @param string $backupPlanAssociationId Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * + * @return \Google\Cloud\BackupDR\V1\CreateBackupPlanAssociationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BackupDR\V1\BackupPlanAssociation $backupPlanAssociation, string $backupPlanAssociationId): self + { + return (new self()) + ->setParent($parent) + ->setBackupPlanAssociation($backupPlanAssociation) + ->setBackupPlanAssociationId($backupPlanAssociationId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * @type string $backup_plan_association_id + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * @type \Google\Cloud\BackupDR\V1\BackupPlanAssociation $backup_plan_association + * Required. The resource being created + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * + * Generated from protobuf field string backup_plan_association_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupPlanAssociationId() + { + return $this->backup_plan_association_id; + } + + /** + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * + * Generated from protobuf field string backup_plan_association_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupPlanAssociationId($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan_association_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_association = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\BackupPlanAssociation|null + */ + public function getBackupPlanAssociation() + { + return $this->backup_plan_association; + } + + public function hasBackupPlanAssociation() + { + return isset($this->backup_plan_association); + } + + public function clearBackupPlanAssociation() + { + unset($this->backup_plan_association); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_association = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\BackupPlanAssociation $var + * @return $this + */ + public function setBackupPlanAssociation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupPlanAssociation::class); + $this->backup_plan_association = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupPlanRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupPlanRequest.php new file mode 100644 index 000000000000..f4eeb674fb1f --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupPlanRequest.php @@ -0,0 +1,262 @@ +google.cloud.backupdr.v1.CreateBackupPlanRequest + */ +class CreateBackupPlanRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string backup_plan_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_plan_id = ''; + /** + * Required. The `BackupPlan` resource object to create. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan backup_plan = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_plan = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BackupDR\V1\BackupPlan $backupPlan Required. The `BackupPlan` resource object to create. + * @param string $backupPlanId Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + * + * @return \Google\Cloud\BackupDR\V1\CreateBackupPlanRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BackupDR\V1\BackupPlan $backupPlan, string $backupPlanId): self + { + return (new self()) + ->setParent($parent) + ->setBackupPlan($backupPlan) + ->setBackupPlanId($backupPlanId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * @type string $backup_plan_id + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + * @type \Google\Cloud\BackupDR\V1\BackupPlan $backup_plan + * Required. The `BackupPlan` resource object to create. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string backup_plan_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupPlanId() + { + return $this->backup_plan_id; + } + + /** + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string backup_plan_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupPlanId($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan_id = $var; + + return $this; + } + + /** + * Required. The `BackupPlan` resource object to create. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan backup_plan = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\BackupPlan|null + */ + public function getBackupPlan() + { + return $this->backup_plan; + } + + public function hasBackupPlan() + { + return isset($this->backup_plan); + } + + public function clearBackupPlan() + { + unset($this->backup_plan); + } + + /** + * Required. The `BackupPlan` resource object to create. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan backup_plan = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\BackupPlan $var + * @return $this + */ + public function setBackupPlan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupPlan::class); + $this->backup_plan = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupVaultRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupVaultRequest.php new file mode 100644 index 000000000000..39269b8ee810 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupVaultRequest.php @@ -0,0 +1,285 @@ +google.cloud.backupdr.v1.CreateBackupVaultRequest + */ +class CreateBackupVaultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * + * Generated from protobuf field string backup_vault_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_vault_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_vault = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BackupDR\V1\BackupVault $backupVault Required. The resource being created + * @param string $backupVaultId Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * + * @return \Google\Cloud\BackupDR\V1\CreateBackupVaultRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BackupDR\V1\BackupVault $backupVault, string $backupVaultId): self + { + return (new self()) + ->setParent($parent) + ->setBackupVault($backupVault) + ->setBackupVaultId($backupVaultId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $backup_vault_id + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * @type \Google\Cloud\BackupDR\V1\BackupVault $backup_vault + * Required. The resource being created + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * + * Generated from protobuf field string backup_vault_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupVaultId() + { + return $this->backup_vault_id; + } + + /** + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * + * Generated from protobuf field string backup_vault_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupVaultId($var) + { + GPBUtil::checkString($var, True); + $this->backup_vault_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\BackupVault|null + */ + public function getBackupVault() + { + return $this->backup_vault; + } + + public function hasBackupVault() + { + return isset($this->backup_vault); + } + + public function clearBackupVault() + { + unset($this->backup_vault); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\BackupVault $var + * @return $this + */ + public function setBackupVault($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupVault::class); + $this->backup_vault = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateManagementServerRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateManagementServerRequest.php new file mode 100644 index 000000000000..a1eb23931ba0 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateManagementServerRequest.php @@ -0,0 +1,257 @@ +google.cloud.backupdr.v1.CreateManagementServerRequest + */ +class CreateManagementServerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The management server project and location in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * + * Generated from protobuf field string management_server_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $management_server_id = ''; + /** + * Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer management_server = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $management_server = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The management server project and location in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BackupDR\V1\ManagementServer $managementServer Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * @param string $managementServerId Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * + * @return \Google\Cloud\BackupDR\V1\CreateManagementServerRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BackupDR\V1\ManagementServer $managementServer, string $managementServerId): self + { + return (new self()) + ->setParent($parent) + ->setManagementServer($managementServer) + ->setManagementServerId($managementServerId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The management server project and location in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. + * @type string $management_server_id + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * @type \Google\Cloud\BackupDR\V1\ManagementServer $management_server + * Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Required. The management server project and location in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The management server project and location in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * + * Generated from protobuf field string management_server_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getManagementServerId() + { + return $this->management_server_id; + } + + /** + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * + * Generated from protobuf field string management_server_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setManagementServerId($var) + { + GPBUtil::checkString($var, True); + $this->management_server_id = $var; + + return $this; + } + + /** + * Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer management_server = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\ManagementServer|null + */ + public function getManagementServer() + { + return $this->management_server; + } + + public function hasManagementServer() + { + return isset($this->management_server); + } + + public function clearManagementServer() + { + unset($this->management_server); + } + + /** + * Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer management_server = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\ManagementServer $var + * @return $this + */ + public function setManagementServer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ManagementServer::class); + $this->management_server = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CustomerEncryptionKey.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CustomerEncryptionKey.php new file mode 100644 index 000000000000..da28ac0861a8 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CustomerEncryptionKey.php @@ -0,0 +1,205 @@ +google.cloud.backupdr.v1.CustomerEncryptionKey + */ +class CustomerEncryptionKey extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The service account being used for the encryption request for the + * given KMS key. If absent, the Compute Engine default service account is + * used. + * + * Generated from protobuf field optional string kms_key_service_account = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $kms_key_service_account = null; + protected $key; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $raw_key + * Optional. Specifies a 256-bit customer-supplied + * encryption key. + * @type string $rsa_encrypted_key + * Optional. RSA-wrapped 2048-bit + * customer-supplied encryption key to either encrypt or decrypt this + * resource. + * @type string $kms_key_name + * Optional. The name of the encryption key that is stored in Google Cloud + * KMS. + * @type string $kms_key_service_account + * Optional. The service account being used for the encryption request for the + * given KMS key. If absent, the Compute Engine default service account is + * used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies a 256-bit customer-supplied + * encryption key. + * + * Generated from protobuf field string raw_key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRawKey() + { + return $this->readOneof(1); + } + + public function hasRawKey() + { + return $this->hasOneof(1); + } + + /** + * Optional. Specifies a 256-bit customer-supplied + * encryption key. + * + * Generated from protobuf field string raw_key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRawKey($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. RSA-wrapped 2048-bit + * customer-supplied encryption key to either encrypt or decrypt this + * resource. + * + * Generated from protobuf field string rsa_encrypted_key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRsaEncryptedKey() + { + return $this->readOneof(2); + } + + public function hasRsaEncryptedKey() + { + return $this->hasOneof(2); + } + + /** + * Optional. RSA-wrapped 2048-bit + * customer-supplied encryption key to either encrypt or decrypt this + * resource. + * + * Generated from protobuf field string rsa_encrypted_key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRsaEncryptedKey($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. The name of the encryption key that is stored in Google Cloud + * KMS. + * + * Generated from protobuf field string kms_key_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKmsKeyName() + { + return $this->readOneof(3); + } + + public function hasKmsKeyName() + { + return $this->hasOneof(3); + } + + /** + * Optional. The name of the encryption key that is stored in Google Cloud + * KMS. + * + * Generated from protobuf field string kms_key_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. The service account being used for the encryption request for the + * given KMS key. If absent, the Compute Engine default service account is + * used. + * + * Generated from protobuf field optional string kms_key_service_account = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKmsKeyServiceAccount() + { + return isset($this->kms_key_service_account) ? $this->kms_key_service_account : ''; + } + + public function hasKmsKeyServiceAccount() + { + return isset($this->kms_key_service_account); + } + + public function clearKmsKeyServiceAccount() + { + unset($this->kms_key_service_account); + } + + /** + * Optional. The service account being used for the encryption request for the + * given KMS key. If absent, the Compute Engine default service account is + * used. + * + * Generated from protobuf field optional string kms_key_service_account = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKmsKeyServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_service_account = $var; + + return $this; + } + + /** + * @return string + */ + public function getKey() + { + return $this->whichOneof("key"); + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSource.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSource.php new file mode 100644 index 000000000000..5522ae4f3952 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSource.php @@ -0,0 +1,543 @@ +google.cloud.backupdr.v1.DataSource + */ +class DataSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. Name of the datasource to create. + * It must have the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + * `{datasource}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the backup vault. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The DataSource resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource.State state = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Number of backups in the data source. + * + * Generated from protobuf field optional int64 backup_count = 7; + */ + protected $backup_count = null; + /** + * Server specified ETag for the ManagementServer resource to prevent + * simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 14; + */ + protected $etag = null; + /** + * The number of bytes (metadata and data) stored in this datasource. + * + * Generated from protobuf field optional int64 total_stored_bytes = 23; + */ + protected $total_stored_bytes = null; + /** + * Output only. The backup configuration state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigState config_state = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $config_state = 0; + /** + * Output only. Details of how the resource is configured for backup. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo backup_config_info = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_config_info = null; + protected $source_resource; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. Name of the datasource to create. + * It must have the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + * `{datasource}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the backup vault. + * @type int $state + * Output only. The DataSource resource instance state. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type int|string $backup_count + * Number of backups in the data source. + * @type string $etag + * Server specified ETag for the ManagementServer resource to prevent + * simultaneous updates from overwiting each other. + * @type int|string $total_stored_bytes + * The number of bytes (metadata and data) stored in this datasource. + * @type int $config_state + * Output only. The backup configuration state. + * @type \Google\Cloud\BackupDR\V1\BackupConfigInfo $backup_config_info + * Output only. Details of how the resource is configured for backup. + * @type \Google\Cloud\BackupDR\V1\DataSourceGcpResource $data_source_gcp_resource + * The backed up resource is a Google Cloud resource. + * The word 'DataSource' was included in the names to indicate that this is + * the representation of the Google Cloud resource used within the + * DataSource object. + * @type \Google\Cloud\BackupDR\V1\DataSourceBackupApplianceApplication $data_source_backup_appliance_application + * The backed up resource is a backup appliance application. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. Name of the datasource to create. + * It must have the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + * `{datasource}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the backup vault. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. Name of the datasource to create. + * It must have the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + * `{datasource}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the backup vault. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The DataSource resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource.State state = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The DataSource resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource.State state = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\DataSource\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Number of backups in the data source. + * + * Generated from protobuf field optional int64 backup_count = 7; + * @return int|string + */ + public function getBackupCount() + { + return isset($this->backup_count) ? $this->backup_count : 0; + } + + public function hasBackupCount() + { + return isset($this->backup_count); + } + + public function clearBackupCount() + { + unset($this->backup_count); + } + + /** + * Number of backups in the data source. + * + * Generated from protobuf field optional int64 backup_count = 7; + * @param int|string $var + * @return $this + */ + public function setBackupCount($var) + { + GPBUtil::checkInt64($var); + $this->backup_count = $var; + + return $this; + } + + /** + * Server specified ETag for the ManagementServer resource to prevent + * simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 14; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Server specified ETag for the ManagementServer resource to prevent + * simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 14; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * The number of bytes (metadata and data) stored in this datasource. + * + * Generated from protobuf field optional int64 total_stored_bytes = 23; + * @return int|string + */ + public function getTotalStoredBytes() + { + return isset($this->total_stored_bytes) ? $this->total_stored_bytes : 0; + } + + public function hasTotalStoredBytes() + { + return isset($this->total_stored_bytes); + } + + public function clearTotalStoredBytes() + { + unset($this->total_stored_bytes); + } + + /** + * The number of bytes (metadata and data) stored in this datasource. + * + * Generated from protobuf field optional int64 total_stored_bytes = 23; + * @param int|string $var + * @return $this + */ + public function setTotalStoredBytes($var) + { + GPBUtil::checkInt64($var); + $this->total_stored_bytes = $var; + + return $this; + } + + /** + * Output only. The backup configuration state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigState config_state = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getConfigState() + { + return $this->config_state; + } + + /** + * Output only. The backup configuration state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigState config_state = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setConfigState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupConfigState::class); + $this->config_state = $var; + + return $this; + } + + /** + * Output only. Details of how the resource is configured for backup. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo backup_config_info = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\BackupConfigInfo|null + */ + public function getBackupConfigInfo() + { + return $this->backup_config_info; + } + + public function hasBackupConfigInfo() + { + return isset($this->backup_config_info); + } + + public function clearBackupConfigInfo() + { + unset($this->backup_config_info); + } + + /** + * Output only. Details of how the resource is configured for backup. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo backup_config_info = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\BackupConfigInfo $var + * @return $this + */ + public function setBackupConfigInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupConfigInfo::class); + $this->backup_config_info = $var; + + return $this; + } + + /** + * The backed up resource is a Google Cloud resource. + * The word 'DataSource' was included in the names to indicate that this is + * the representation of the Google Cloud resource used within the + * DataSource object. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSourceGcpResource data_source_gcp_resource = 26; + * @return \Google\Cloud\BackupDR\V1\DataSourceGcpResource|null + */ + public function getDataSourceGcpResource() + { + return $this->readOneof(26); + } + + public function hasDataSourceGcpResource() + { + return $this->hasOneof(26); + } + + /** + * The backed up resource is a Google Cloud resource. + * The word 'DataSource' was included in the names to indicate that this is + * the representation of the Google Cloud resource used within the + * DataSource object. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSourceGcpResource data_source_gcp_resource = 26; + * @param \Google\Cloud\BackupDR\V1\DataSourceGcpResource $var + * @return $this + */ + public function setDataSourceGcpResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\DataSourceGcpResource::class); + $this->writeOneof(26, $var); + + return $this; + } + + /** + * The backed up resource is a backup appliance application. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSourceBackupApplianceApplication data_source_backup_appliance_application = 27; + * @return \Google\Cloud\BackupDR\V1\DataSourceBackupApplianceApplication|null + */ + public function getDataSourceBackupApplianceApplication() + { + return $this->readOneof(27); + } + + public function hasDataSourceBackupApplianceApplication() + { + return $this->hasOneof(27); + } + + /** + * The backed up resource is a backup appliance application. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSourceBackupApplianceApplication data_source_backup_appliance_application = 27; + * @param \Google\Cloud\BackupDR\V1\DataSourceBackupApplianceApplication $var + * @return $this + */ + public function setDataSourceBackupApplianceApplication($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\DataSourceBackupApplianceApplication::class); + $this->writeOneof(27, $var); + + return $this; + } + + /** + * @return string + */ + public function getSourceResource() + { + return $this->whichOneof("source_resource"); + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSource/State.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSource/State.php new file mode 100644 index 000000000000..3cec4aa57249 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSource/State.php @@ -0,0 +1,78 @@ +google.cloud.backupdr.v1.DataSource.State + */ +class State +{ + /** + * State not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The data source is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The data source has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The data source is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The data source is experiencing an issue and might be unusable. + * + * Generated from protobuf enum ERROR = 4; + */ + const ERROR = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BackupDR\V1\DataSource_State::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSourceBackupApplianceApplication.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSourceBackupApplianceApplication.php new file mode 100644 index 000000000000..07e5a34b90f2 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSourceBackupApplianceApplication.php @@ -0,0 +1,272 @@ +google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + */ +class DataSourceBackupApplianceApplication extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the Application as known to the Backup Appliance. + * + * Generated from protobuf field string application_name = 1; + */ + protected $application_name = ''; + /** + * Appliance name. + * + * Generated from protobuf field string backup_appliance = 2; + */ + protected $backup_appliance = ''; + /** + * Appliance Id of the Backup Appliance. + * + * Generated from protobuf field int64 appliance_id = 3; + */ + protected $appliance_id = 0; + /** + * The type of the application. e.g. VMBackup + * + * Generated from protobuf field string type = 4; + */ + protected $type = ''; + /** + * The appid field of the application within the Backup Appliance. + * + * Generated from protobuf field int64 application_id = 8; + */ + protected $application_id = 0; + /** + * Hostname of the host where the application is running. + * + * Generated from protobuf field string hostname = 6; + */ + protected $hostname = ''; + /** + * Hostid of the application host. + * + * Generated from protobuf field int64 host_id = 7; + */ + protected $host_id = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $application_name + * The name of the Application as known to the Backup Appliance. + * @type string $backup_appliance + * Appliance name. + * @type int|string $appliance_id + * Appliance Id of the Backup Appliance. + * @type string $type + * The type of the application. e.g. VMBackup + * @type int|string $application_id + * The appid field of the application within the Backup Appliance. + * @type string $hostname + * Hostname of the host where the application is running. + * @type int|string $host_id + * Hostid of the application host. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The name of the Application as known to the Backup Appliance. + * + * Generated from protobuf field string application_name = 1; + * @return string + */ + public function getApplicationName() + { + return $this->application_name; + } + + /** + * The name of the Application as known to the Backup Appliance. + * + * Generated from protobuf field string application_name = 1; + * @param string $var + * @return $this + */ + public function setApplicationName($var) + { + GPBUtil::checkString($var, True); + $this->application_name = $var; + + return $this; + } + + /** + * Appliance name. + * + * Generated from protobuf field string backup_appliance = 2; + * @return string + */ + public function getBackupAppliance() + { + return $this->backup_appliance; + } + + /** + * Appliance name. + * + * Generated from protobuf field string backup_appliance = 2; + * @param string $var + * @return $this + */ + public function setBackupAppliance($var) + { + GPBUtil::checkString($var, True); + $this->backup_appliance = $var; + + return $this; + } + + /** + * Appliance Id of the Backup Appliance. + * + * Generated from protobuf field int64 appliance_id = 3; + * @return int|string + */ + public function getApplianceId() + { + return $this->appliance_id; + } + + /** + * Appliance Id of the Backup Appliance. + * + * Generated from protobuf field int64 appliance_id = 3; + * @param int|string $var + * @return $this + */ + public function setApplianceId($var) + { + GPBUtil::checkInt64($var); + $this->appliance_id = $var; + + return $this; + } + + /** + * The type of the application. e.g. VMBackup + * + * Generated from protobuf field string type = 4; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the application. e.g. VMBackup + * + * Generated from protobuf field string type = 4; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The appid field of the application within the Backup Appliance. + * + * Generated from protobuf field int64 application_id = 8; + * @return int|string + */ + public function getApplicationId() + { + return $this->application_id; + } + + /** + * The appid field of the application within the Backup Appliance. + * + * Generated from protobuf field int64 application_id = 8; + * @param int|string $var + * @return $this + */ + public function setApplicationId($var) + { + GPBUtil::checkInt64($var); + $this->application_id = $var; + + return $this; + } + + /** + * Hostname of the host where the application is running. + * + * Generated from protobuf field string hostname = 6; + * @return string + */ + public function getHostname() + { + return $this->hostname; + } + + /** + * Hostname of the host where the application is running. + * + * Generated from protobuf field string hostname = 6; + * @param string $var + * @return $this + */ + public function setHostname($var) + { + GPBUtil::checkString($var, True); + $this->hostname = $var; + + return $this; + } + + /** + * Hostid of the application host. + * + * Generated from protobuf field int64 host_id = 7; + * @return int|string + */ + public function getHostId() + { + return $this->host_id; + } + + /** + * Hostid of the application host. + * + * Generated from protobuf field int64 host_id = 7; + * @param int|string $var + * @return $this + */ + public function setHostId($var) + { + GPBUtil::checkInt64($var); + $this->host_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSourceGcpResource.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSourceGcpResource.php new file mode 100644 index 000000000000..dfd4a646d3ee --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSourceGcpResource.php @@ -0,0 +1,190 @@ +google.cloud.backupdr.v1.DataSourceGcpResource + */ +class DataSourceGcpResource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Full resource pathname URL of the source Google Cloud + * resource. + * + * Generated from protobuf field string gcp_resourcename = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $gcp_resourcename = ''; + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + */ + protected $location = ''; + /** + * The type of the Google Cloud resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + protected $gcp_resource_properties; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcp_resourcename + * Output only. Full resource pathname URL of the source Google Cloud + * resource. + * @type string $location + * Location of the resource: //"global"/"unspecified". + * @type string $type + * The type of the Google Cloud resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * @type \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties $compute_instance_datasource_properties + * ComputeInstanceDataSourceProperties has a subset of Compute Instance + * properties that are useful at the Datasource level. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Full resource pathname URL of the source Google Cloud + * resource. + * + * Generated from protobuf field string gcp_resourcename = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getGcpResourcename() + { + return $this->gcp_resourcename; + } + + /** + * Output only. Full resource pathname URL of the source Google Cloud + * resource. + * + * Generated from protobuf field string gcp_resourcename = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setGcpResourcename($var) + { + GPBUtil::checkString($var, True); + $this->gcp_resourcename = $var; + + return $this; + } + + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * The type of the Google Cloud resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the Google Cloud resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * ComputeInstanceDataSourceProperties has a subset of Compute Instance + * properties that are useful at the Datasource level. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties compute_instance_datasource_properties = 4; + * @return \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties|null + */ + public function getComputeInstanceDatasourceProperties() + { + return $this->readOneof(4); + } + + public function hasComputeInstanceDatasourceProperties() + { + return $this->hasOneof(4); + } + + /** + * ComputeInstanceDataSourceProperties has a subset of Compute Instance + * properties that are useful at the Datasource level. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties compute_instance_datasource_properties = 4; + * @param \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties $var + * @return $this + */ + public function setComputeInstanceDatasourceProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getGcpResourceProperties() + { + return $this->whichOneof("gcp_resource_properties"); + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupPlanAssociationRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupPlanAssociationRequest.php new file mode 100644 index 000000000000..d89d4149bfa5 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupPlanAssociationRequest.php @@ -0,0 +1,160 @@ +google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + */ +class DeleteBackupPlanAssociationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * Please see {@see BackupDRClient::backupPlanAssociationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\DeleteBackupPlanAssociationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupPlanRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupPlanRequest.php new file mode 100644 index 000000000000..33d0f577a1de --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupPlanRequest.php @@ -0,0 +1,161 @@ +google.cloud.backupdr.v1.DeleteBackupPlanRequest + */ +class DeleteBackupPlanRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the `BackupPlan` to delete. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. The resource name of the `BackupPlan` to delete. + * + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * Please see {@see BackupDRClient::backupPlanName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\DeleteBackupPlanRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the `BackupPlan` to delete. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the `BackupPlan` to delete. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the `BackupPlan` to delete. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupRequest.php new file mode 100644 index 000000000000..d3b5a8223f9c --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupRequest.php @@ -0,0 +1,155 @@ +google.cloud.backupdr.v1.DeleteBackupRequest + */ +class DeleteBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BackupDRClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\DeleteBackupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupVaultRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupVaultRequest.php new file mode 100644 index 000000000000..2408f02e4d27 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupVaultRequest.php @@ -0,0 +1,311 @@ +google.cloud.backupdr.v1.DeleteBackupVaultRequest + */ +class DeleteBackupVaultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + /** + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + * + * Generated from protobuf field string etag = 4; + */ + protected $etag = ''; + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + * + * Generated from protobuf field bool allow_missing = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BackupDRClient::backupVaultName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\DeleteBackupVaultRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $force + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + * @type string $etag + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + * @type bool $validate_only + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @type bool $allow_missing + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + + /** + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + * + * Generated from protobuf field string etag = 4; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + * + * Generated from protobuf field string etag = 4; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + * + * Generated from protobuf field bool allow_missing = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + * + * Generated from protobuf field bool allow_missing = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteManagementServerRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteManagementServerRequest.php new file mode 100644 index 000000000000..c8bc344f88f3 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteManagementServerRequest.php @@ -0,0 +1,155 @@ +google.cloud.backupdr.v1.DeleteManagementServerRequest + */ +class DeleteManagementServerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see BackupDRClient::managementServerName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\DeleteManagementServerRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DisplayDevice.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DisplayDevice.php new file mode 100644 index 000000000000..fd3d2d33844d --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DisplayDevice.php @@ -0,0 +1,77 @@ +google.cloud.backupdr.v1.DisplayDevice + */ +class DisplayDevice extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Enables display for the Compute Engine VM + * + * Generated from protobuf field optional bool enable_display = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_display = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_display + * Optional. Enables display for the Compute Engine VM + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Enables display for the Compute Engine VM + * + * Generated from protobuf field optional bool enable_display = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableDisplay() + { + return isset($this->enable_display) ? $this->enable_display : false; + } + + public function hasEnableDisplay() + { + return isset($this->enable_display); + } + + public function clearEnableDisplay() + { + unset($this->enable_display); + } + + /** + * Optional. Enables display for the Compute Engine VM + * + * Generated from protobuf field optional bool enable_display = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableDisplay($var) + { + GPBUtil::checkBool($var); + $this->enable_display = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Entry.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Entry.php new file mode 100644 index 000000000000..43f3558be810 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Entry.php @@ -0,0 +1,133 @@ +google.cloud.backupdr.v1.Entry + */ +class Entry extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Key for the metadata entry. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key = null; + /** + * Optional. Value for the metadata entry. These are free-form strings, and + * only have meaning as interpreted by the image running in the instance. The + * only restriction placed on values is that their size must be less than + * or equal to 262144 bytes (256 KiB). + * + * Generated from protobuf field optional string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Optional. Key for the metadata entry. + * @type string $value + * Optional. Value for the metadata entry. These are free-form strings, and + * only have meaning as interpreted by the image running in the instance. The + * only restriction placed on values is that their size must be less than + * or equal to 262144 bytes (256 KiB). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Key for the metadata entry. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Optional. Key for the metadata entry. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. Value for the metadata entry. These are free-form strings, and + * only have meaning as interpreted by the image running in the instance. The + * only restriction placed on values is that their size must be less than + * or equal to 262144 bytes (256 KiB). + * + * Generated from protobuf field optional string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValue() + { + return isset($this->value) ? $this->value : ''; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Optional. Value for the metadata entry. These are free-form strings, and + * only have meaning as interpreted by the image running in the instance. The + * only restriction placed on values is that their size must be less than + * or equal to 262144 bytes (256 KiB). + * + * Generated from protobuf field optional string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/FetchUsableBackupVaultsRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/FetchUsableBackupVaultsRequest.php new file mode 100644 index 000000000000..142606583a7a --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/FetchUsableBackupVaultsRequest.php @@ -0,0 +1,246 @@ +google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + */ +class FetchUsableBackupVaultsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\FetchUsableBackupVaultsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/FetchUsableBackupVaultsResponse.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/FetchUsableBackupVaultsResponse.php new file mode 100644 index 000000000000..058334542e91 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/FetchUsableBackupVaultsResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + */ +class FetchUsableBackupVaultsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + */ + private $backup_vaults; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\BackupVault>|\Google\Protobuf\Internal\RepeatedField $backup_vaults + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupVaults() + { + return $this->backup_vaults; + } + + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + * @param array<\Google\Cloud\BackupDR\V1\BackupVault>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupVaults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupVault::class); + $this->backup_vaults = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GcpBackupConfig.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GcpBackupConfig.php new file mode 100644 index 000000000000..5e8d78bb7496 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GcpBackupConfig.php @@ -0,0 +1,171 @@ +google.cloud.backupdr.v1.GcpBackupConfig + */ +class GcpBackupConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the backup plan. + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + */ + protected $backup_plan = ''; + /** + * The description of the backup plan. + * + * Generated from protobuf field string backup_plan_description = 2; + */ + protected $backup_plan_description = ''; + /** + * The name of the backup plan association. + * + * Generated from protobuf field string backup_plan_association = 3 [(.google.api.resource_reference) = { + */ + protected $backup_plan_association = ''; + /** + * The names of the backup plan rules which point to this backupvault + * + * Generated from protobuf field repeated string backup_plan_rules = 4; + */ + private $backup_plan_rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backup_plan + * The name of the backup plan. + * @type string $backup_plan_description + * The description of the backup plan. + * @type string $backup_plan_association + * The name of the backup plan association. + * @type array|\Google\Protobuf\Internal\RepeatedField $backup_plan_rules + * The names of the backup plan rules which point to this backupvault + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The name of the backup plan. + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getBackupPlan() + { + return $this->backup_plan; + } + + /** + * The name of the backup plan. + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupPlan($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan = $var; + + return $this; + } + + /** + * The description of the backup plan. + * + * Generated from protobuf field string backup_plan_description = 2; + * @return string + */ + public function getBackupPlanDescription() + { + return $this->backup_plan_description; + } + + /** + * The description of the backup plan. + * + * Generated from protobuf field string backup_plan_description = 2; + * @param string $var + * @return $this + */ + public function setBackupPlanDescription($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan_description = $var; + + return $this; + } + + /** + * The name of the backup plan association. + * + * Generated from protobuf field string backup_plan_association = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getBackupPlanAssociation() + { + return $this->backup_plan_association; + } + + /** + * The name of the backup plan association. + * + * Generated from protobuf field string backup_plan_association = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupPlanAssociation($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan_association = $var; + + return $this; + } + + /** + * The names of the backup plan rules which point to this backupvault + * + * Generated from protobuf field repeated string backup_plan_rules = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupPlanRules() + { + return $this->backup_plan_rules; + } + + /** + * The names of the backup plan rules which point to this backupvault + * + * Generated from protobuf field repeated string backup_plan_rules = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupPlanRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->backup_plan_rules = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GcpResource.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GcpResource.php new file mode 100644 index 000000000000..dd1322beaae1 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GcpResource.php @@ -0,0 +1,139 @@ +google.cloud.backupdr.v1.GcpResource + */ +class GcpResource extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Google Cloud resource. + * + * Generated from protobuf field string gcp_resourcename = 1; + */ + protected $gcp_resourcename = ''; + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + */ + protected $location = ''; + /** + * Type of the resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcp_resourcename + * Name of the Google Cloud resource. + * @type string $location + * Location of the resource: //"global"/"unspecified". + * @type string $type + * Type of the resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Google Cloud resource. + * + * Generated from protobuf field string gcp_resourcename = 1; + * @return string + */ + public function getGcpResourcename() + { + return $this->gcp_resourcename; + } + + /** + * Name of the Google Cloud resource. + * + * Generated from protobuf field string gcp_resourcename = 1; + * @param string $var + * @return $this + */ + public function setGcpResourcename($var) + { + GPBUtil::checkString($var, True); + $this->gcp_resourcename = $var; + + return $this; + } + + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Type of the resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupPlanAssociationRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupPlanAssociationRequest.php new file mode 100644 index 000000000000..e17c8ba0816d --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupPlanAssociationRequest.php @@ -0,0 +1,86 @@ +google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + */ +class GetBackupPlanAssociationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * Please see {@see BackupDRClient::backupPlanAssociationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetBackupPlanAssociationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupPlanRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupPlanRequest.php new file mode 100644 index 000000000000..5af2986cc0d1 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupPlanRequest.php @@ -0,0 +1,87 @@ +google.cloud.backupdr.v1.GetBackupPlanRequest + */ +class GetBackupPlanRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the `BackupPlan` to retrieve. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the `BackupPlan` to retrieve. + * + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * Please see {@see BackupDRClient::backupPlanName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetBackupPlanRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the `BackupPlan` to retrieve. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the `BackupPlan` to retrieve. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the `BackupPlan` to retrieve. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupRequest.php new file mode 100644 index 000000000000..cef977871e55 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupRequest.php @@ -0,0 +1,124 @@ +google.cloud.backupdr.v1.GetBackupRequest + */ +class GetBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $name Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * Please see {@see BackupDRClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetBackupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * @type int $view + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupVaultRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupVaultRequest.php new file mode 100644 index 000000000000..de3959298ba2 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupVaultRequest.php @@ -0,0 +1,124 @@ +google.cloud.backupdr.v1.GetBackupVaultRequest + */ +class GetBackupVaultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $name Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * Please see {@see BackupDRClient::backupVaultName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetBackupVaultRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * @type int $view + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupVaultView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetDataSourceRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetDataSourceRequest.php new file mode 100644 index 000000000000..27f9c86ff9b1 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetDataSourceRequest.php @@ -0,0 +1,86 @@ +google.cloud.backupdr.v1.GetDataSourceRequest + */ +class GetDataSourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + * Please see {@see BackupDRClient::dataSourceName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetDataSourceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetManagementServerRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetManagementServerRequest.php new file mode 100644 index 000000000000..7c83be3986fc --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetManagementServerRequest.php @@ -0,0 +1,86 @@ +google.cloud.backupdr.v1.GetManagementServerRequest + */ +class GetManagementServerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the management server resource name, in the format + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the management server resource name, in the format + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' + * Please see {@see BackupDRClient::managementServerName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetManagementServerRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the management server resource name, in the format + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the management server resource name, in the format + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the management server resource name, in the format + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GuestOsFeature.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GuestOsFeature.php new file mode 100644 index 000000000000..93d51da05752 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GuestOsFeature.php @@ -0,0 +1,77 @@ +google.cloud.backupdr.v1.GuestOsFeature + */ +class GuestOsFeature extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of a supported feature. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.GuestOsFeature.FeatureType type = 1; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The ID of a supported feature. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * The ID of a supported feature. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.GuestOsFeature.FeatureType type = 1; + * @return int + */ + public function getType() + { + return isset($this->type) ? $this->type : 0; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The ID of a supported feature. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.GuestOsFeature.FeatureType type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\GuestOsFeature\FeatureType::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GuestOsFeature/FeatureType.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GuestOsFeature/FeatureType.php new file mode 100644 index 000000000000..1eaa457b98e2 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GuestOsFeature/FeatureType.php @@ -0,0 +1,148 @@ +google.cloud.backupdr.v1.GuestOsFeature.FeatureType + */ +class FeatureType +{ + /** + * Default value, which is unused. + * + * Generated from protobuf enum FEATURE_TYPE_UNSPECIFIED = 0; + */ + const FEATURE_TYPE_UNSPECIFIED = 0; + /** + * VIRTIO_SCSI_MULTIQUEUE feature type. + * + * Generated from protobuf enum VIRTIO_SCSI_MULTIQUEUE = 1; + */ + const VIRTIO_SCSI_MULTIQUEUE = 1; + /** + * WINDOWS feature type. + * + * Generated from protobuf enum WINDOWS = 2; + */ + const WINDOWS = 2; + /** + * MULTI_IP_SUBNET feature type. + * + * Generated from protobuf enum MULTI_IP_SUBNET = 3; + */ + const MULTI_IP_SUBNET = 3; + /** + * UEFI_COMPATIBLE feature type. + * + * Generated from protobuf enum UEFI_COMPATIBLE = 4; + */ + const UEFI_COMPATIBLE = 4; + /** + * SECURE_BOOT feature type. + * + * Generated from protobuf enum SECURE_BOOT = 5; + */ + const SECURE_BOOT = 5; + /** + * GVNIC feature type. + * + * Generated from protobuf enum GVNIC = 6; + */ + const GVNIC = 6; + /** + * SEV_CAPABLE feature type. + * + * Generated from protobuf enum SEV_CAPABLE = 7; + */ + const SEV_CAPABLE = 7; + /** + * BARE_METAL_LINUX_COMPATIBLE feature type. + * + * Generated from protobuf enum BARE_METAL_LINUX_COMPATIBLE = 8; + */ + const BARE_METAL_LINUX_COMPATIBLE = 8; + /** + * SUSPEND_RESUME_COMPATIBLE feature type. + * + * Generated from protobuf enum SUSPEND_RESUME_COMPATIBLE = 9; + */ + const SUSPEND_RESUME_COMPATIBLE = 9; + /** + * SEV_LIVE_MIGRATABLE feature type. + * + * Generated from protobuf enum SEV_LIVE_MIGRATABLE = 10; + */ + const SEV_LIVE_MIGRATABLE = 10; + /** + * SEV_SNP_CAPABLE feature type. + * + * Generated from protobuf enum SEV_SNP_CAPABLE = 11; + */ + const SEV_SNP_CAPABLE = 11; + /** + * TDX_CAPABLE feature type. + * + * Generated from protobuf enum TDX_CAPABLE = 12; + */ + const TDX_CAPABLE = 12; + /** + * IDPF feature type. + * + * Generated from protobuf enum IDPF = 13; + */ + const IDPF = 13; + /** + * SEV_LIVE_MIGRATABLE_V2 feature type. + * + * Generated from protobuf enum SEV_LIVE_MIGRATABLE_V2 = 14; + */ + const SEV_LIVE_MIGRATABLE_V2 = 14; + + private static $valueToName = [ + self::FEATURE_TYPE_UNSPECIFIED => 'FEATURE_TYPE_UNSPECIFIED', + self::VIRTIO_SCSI_MULTIQUEUE => 'VIRTIO_SCSI_MULTIQUEUE', + self::WINDOWS => 'WINDOWS', + self::MULTI_IP_SUBNET => 'MULTI_IP_SUBNET', + self::UEFI_COMPATIBLE => 'UEFI_COMPATIBLE', + self::SECURE_BOOT => 'SECURE_BOOT', + self::GVNIC => 'GVNIC', + self::SEV_CAPABLE => 'SEV_CAPABLE', + self::BARE_METAL_LINUX_COMPATIBLE => 'BARE_METAL_LINUX_COMPATIBLE', + self::SUSPEND_RESUME_COMPATIBLE => 'SUSPEND_RESUME_COMPATIBLE', + self::SEV_LIVE_MIGRATABLE => 'SEV_LIVE_MIGRATABLE', + self::SEV_SNP_CAPABLE => 'SEV_SNP_CAPABLE', + self::TDX_CAPABLE => 'TDX_CAPABLE', + self::IDPF => 'IDPF', + self::SEV_LIVE_MIGRATABLE_V2 => 'SEV_LIVE_MIGRATABLE_V2', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FeatureType::class, \Google\Cloud\BackupDR\V1\GuestOsFeature_FeatureType::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/InstanceParams.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/InstanceParams.php new file mode 100644 index 000000000000..525d36ec6f3d --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/InstanceParams.php @@ -0,0 +1,67 @@ +google.cloud.backupdr.v1.InstanceParams + */ +class InstanceParams extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Resource manager tags to be bound to the instance. + * + * Generated from protobuf field map resource_manager_tags = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $resource_manager_tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $resource_manager_tags + * Optional. Resource manager tags to be bound to the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Resource manager tags to be bound to the instance. + * + * Generated from protobuf field map resource_manager_tags = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getResourceManagerTags() + { + return $this->resource_manager_tags; + } + + /** + * Optional. Resource manager tags to be bound to the instance. + * + * Generated from protobuf field map resource_manager_tags = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setResourceManagerTags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_manager_tags = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/KeyRevocationActionType.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/KeyRevocationActionType.php new file mode 100644 index 000000000000..9922c9b37b07 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/KeyRevocationActionType.php @@ -0,0 +1,63 @@ +google.cloud.backupdr.v1.KeyRevocationActionType + */ +class KeyRevocationActionType +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0; + */ + const KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0; + /** + * Indicates user chose no operation. + * + * Generated from protobuf enum NONE = 1; + */ + const NONE = 1; + /** + * Indicates user chose to opt for VM shutdown on key revocation. + * + * Generated from protobuf enum STOP = 2; + */ + const STOP = 2; + + private static $valueToName = [ + self::KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED => 'KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED', + self::NONE => 'NONE', + self::STOP => 'STOP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlanAssociationsRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlanAssociationsRequest.php new file mode 100644 index 000000000000..1cd640705bf5 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlanAssociationsRequest.php @@ -0,0 +1,212 @@ +google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + */ +class ListBackupPlanAssociationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListBackupPlanAssociationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlanAssociationsResponse.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlanAssociationsResponse.php new file mode 100644 index 000000000000..a92169b9c6c0 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlanAssociationsResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + */ +class ListBackupPlanAssociationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Backup Plan Associations in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup plan associations in reachable + * locations and the 'unreachable' field will be populated with a list of + * unreachable locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_associations = 1; + */ + private $backup_plan_associations; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\BackupPlanAssociation>|\Google\Protobuf\Internal\RepeatedField $backup_plan_associations + * The list of Backup Plan Associations in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup plan associations in reachable + * locations and the 'unreachable' field will be populated with a list of + * unreachable locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * The list of Backup Plan Associations in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup plan associations in reachable + * locations and the 'unreachable' field will be populated with a list of + * unreachable locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_associations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupPlanAssociations() + { + return $this->backup_plan_associations; + } + + /** + * The list of Backup Plan Associations in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup plan associations in reachable + * locations and the 'unreachable' field will be populated with a list of + * unreachable locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_associations = 1; + * @param array<\Google\Cloud\BackupDR\V1\BackupPlanAssociation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupPlanAssociations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupPlanAssociation::class); + $this->backup_plan_associations = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlansRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlansRequest.php new file mode 100644 index 000000000000..59cf4b63f0d6 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlansRequest.php @@ -0,0 +1,277 @@ +google.cloud.backupdr.v1.ListBackupPlansRequest + */ +class ListBackupPlansRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value of + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Field match expression used to filter the results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Field by which to sort the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListBackupPlansRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * @type int $page_size + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * to determine if there are more instances left to be queried. + * @type string $page_token + * Optional. The value of + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * @type string $filter + * Optional. Field match expression used to filter the results. + * @type string $order_by + * Optional. Field by which to sort the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The value of + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value of + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Field match expression used to filter the results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Field match expression used to filter the results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Field by which to sort the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Field by which to sort the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlansResponse.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlansResponse.php new file mode 100644 index 000000000000..ff5e2d64a27c --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlansResponse.php @@ -0,0 +1,179 @@ +google.cloud.backupdr.v1.ListBackupPlansResponse + */ +class ListBackupPlansResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of `BackupPlans` in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of resources from all locations. In case any location is unreachable, + * the response will only return backup plans in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * BackupPlan + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlan backup_plans = 1; + */ + private $backup_plans; + /** + * A token which may be sent as + * [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in + * a subsequent `ListBackupPlans` call to retrieve the next page of results. + * If this field is omitted or empty, then there are no more results to + * return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\BackupPlan>|\Google\Protobuf\Internal\RepeatedField $backup_plans + * The list of `BackupPlans` in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of resources from all locations. In case any location is unreachable, + * the response will only return backup plans in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * BackupPlan + * @type string $next_page_token + * A token which may be sent as + * [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in + * a subsequent `ListBackupPlans` call to retrieve the next page of results. + * If this field is omitted or empty, then there are no more results to + * return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * The list of `BackupPlans` in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of resources from all locations. In case any location is unreachable, + * the response will only return backup plans in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * BackupPlan + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlan backup_plans = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupPlans() + { + return $this->backup_plans; + } + + /** + * The list of `BackupPlans` in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of resources from all locations. In case any location is unreachable, + * the response will only return backup plans in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * BackupPlan + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlan backup_plans = 1; + * @param array<\Google\Cloud\BackupDR\V1\BackupPlan>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupPlans($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupPlan::class); + $this->backup_plans = $arr; + + return $this; + } + + /** + * A token which may be sent as + * [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in + * a subsequent `ListBackupPlans` call to retrieve the next page of results. + * If this field is omitted or empty, then there are no more results to + * return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token which may be sent as + * [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in + * a subsequent `ListBackupPlans` call to retrieve the next page of results. + * If this field is omitted or empty, then there are no more results to + * return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupVaultsRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupVaultsRequest.php new file mode 100644 index 000000000000..3f8755430f7e --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupVaultsRequest.php @@ -0,0 +1,284 @@ +google.cloud.backupdr.v1.ListBackupVaultsRequest + */ +class ListBackupVaultsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $parent Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListBackupVaultsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * @type int $view + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupVaultView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupVaultsResponse.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupVaultsResponse.php new file mode 100644 index 000000000000..34988c886256 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupVaultsResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.ListBackupVaultsResponse + */ +class ListBackupVaultsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + */ + private $backup_vaults; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\BackupVault>|\Google\Protobuf\Internal\RepeatedField $backup_vaults + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupVaults() + { + return $this->backup_vaults; + } + + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + * @param array<\Google\Cloud\BackupDR\V1\BackupVault>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupVaults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupVault::class); + $this->backup_vaults = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupsRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupsRequest.php new file mode 100644 index 000000000000..92b535e1b4f0 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupsRequest.php @@ -0,0 +1,284 @@ +google.cloud.backupdr.v1.ListBackupsRequest + */ +class ListBackupsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $parent Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. Please see + * {@see BackupDRClient::dataSourceName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListBackupsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * @type int $view + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupsResponse.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupsResponse.php new file mode 100644 index 000000000000..04479201f61b --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupsResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.ListBackupsResponse + */ +class ListBackupsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Backup instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Backup backups = 1; + */ + private $backups; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\Backup>|\Google\Protobuf\Internal\RepeatedField $backups + * The list of Backup instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The list of Backup instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Backup backups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackups() + { + return $this->backups; + } + + /** + * The list of Backup instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Backup backups = 1; + * @param array<\Google\Cloud\BackupDR\V1\Backup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\Backup::class); + $this->backups = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListDataSourcesRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListDataSourcesRequest.php new file mode 100644 index 000000000000..ef8584fa5ce2 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListDataSourcesRequest.php @@ -0,0 +1,246 @@ +google.cloud.backupdr.v1.ListDataSourcesRequest + */ +class ListDataSourcesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. Please see + * {@see BackupDRClient::backupVaultName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListDataSourcesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListDataSourcesResponse.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListDataSourcesResponse.php new file mode 100644 index 000000000000..ef509a105897 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListDataSourcesResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.ListDataSourcesResponse + */ +class ListDataSourcesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of DataSource instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.DataSource data_sources = 1; + */ + private $data_sources; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\DataSource>|\Google\Protobuf\Internal\RepeatedField $data_sources + * The list of DataSource instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The list of DataSource instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.DataSource data_sources = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataSources() + { + return $this->data_sources; + } + + /** + * The list of DataSource instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.DataSource data_sources = 1; + * @param array<\Google\Cloud\BackupDR\V1\DataSource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\DataSource::class); + $this->data_sources = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersRequest.php new file mode 100644 index 000000000000..963e2af63f5e --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersRequest.php @@ -0,0 +1,266 @@ +google.cloud.backupdr.v1.ListManagementServersRequest + */ +class ListManagementServersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field optional string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = null; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field optional string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = null; + + /** + * @param string $parent Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListManagementServersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field optional string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return isset($this->filter) ? $this->filter : ''; + } + + public function hasFilter() + { + return isset($this->filter); + } + + public function clearFilter() + { + unset($this->filter); + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field optional string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field optional string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return isset($this->order_by) ? $this->order_by : ''; + } + + public function hasOrderBy() + { + return isset($this->order_by); + } + + public function clearOrderBy() + { + unset($this->order_by); + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field optional string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersResponse.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersResponse.php new file mode 100644 index 000000000000..84bd573686db --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.ListManagementServersResponse + */ +class ListManagementServersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of ManagementServer instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return management servers in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ManagementServer management_servers = 1; + */ + private $management_servers; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\ManagementServer>|\Google\Protobuf\Internal\RepeatedField $management_servers + * The list of ManagementServer instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return management servers in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * The list of ManagementServer instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return management servers in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ManagementServer management_servers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getManagementServers() + { + return $this->management_servers; + } + + /** + * The list of ManagementServer instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return management servers in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ManagementServer management_servers = 1; + * @param array<\Google\Cloud\BackupDR\V1\ManagementServer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setManagementServers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\ManagementServer::class); + $this->management_servers = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer.php new file mode 100644 index 000000000000..70295addc1c0 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer.php @@ -0,0 +1,716 @@ +google.cloud.backupdr.v1.ManagementServer + */ +class ManagementServer extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The description of the ManagementServer instance (2048 characters + * or less). + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Resource labels to represent user provided metadata. + * Labels currently defined: + * 1. migrate_from_go= + * If set to true, the MS is created in migration ready mode. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. The type of the ManagementServer resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceType type = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = 0; + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by clients to connect to AGM/RD graphical user interface and APIs. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementURI management_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $management_uri = null; + /** + * Output only. The hostnames of the exposed AGM endpoints for both types of + * user i.e. 1p and 3p, used to connect AGM/RM UI. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $workforce_identity_based_management_uri = null; + /** + * Output only. The ManagementServer state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. VPC networks to which the ManagementServer instance is connected. + * For this version, only a single network is supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkConfig networks = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + private $networks; + /** + * Optional. Server specified ETag for the ManagementServer resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field string etag = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Output only. The OAuth 2.0 client id is required to make API calls to the + * BackupDR instance API of this ManagementServer. This is the value that + * should be provided in the 'aud' field of the OIDC ID Token (see openid + * specification + * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). + * + * Generated from protobuf field string oauth2_client_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $oauth2_client_id = ''; + /** + * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID workforce_identity_based_oauth2_client_id = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $workforce_identity_based_oauth2_client_id = null; + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by BAs to connect to BA proxy. + * + * Generated from protobuf field repeated string ba_proxy_uri = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $ba_proxy_uri; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field .google.protobuf.BoolValue satisfies_pzs = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name. + * @type string $description + * Optional. The description of the ManagementServer instance (2048 characters + * or less). + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels to represent user provided metadata. + * Labels currently defined: + * 1. migrate_from_go= + * If set to true, the MS is created in migration ready mode. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type int $type + * Optional. The type of the ManagementServer resource. + * @type \Google\Cloud\BackupDR\V1\ManagementURI $management_uri + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by clients to connect to AGM/RD graphical user interface and APIs. + * @type \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI $workforce_identity_based_management_uri + * Output only. The hostnames of the exposed AGM endpoints for both types of + * user i.e. 1p and 3p, used to connect AGM/RM UI. + * @type int $state + * Output only. The ManagementServer state. + * @type array<\Google\Cloud\BackupDR\V1\NetworkConfig>|\Google\Protobuf\Internal\RepeatedField $networks + * Required. VPC networks to which the ManagementServer instance is connected. + * For this version, only a single network is supported. + * @type string $etag + * Optional. Server specified ETag for the ManagementServer resource to + * prevent simultaneous updates from overwiting each other. + * @type string $oauth2_client_id + * Output only. The OAuth 2.0 client id is required to make API calls to the + * BackupDR instance API of this ManagementServer. This is the value that + * should be provided in the 'aud' field of the OIDC ID Token (see openid + * specification + * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). + * @type \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID $workforce_identity_based_oauth2_client_id + * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. + * @type array|\Google\Protobuf\Internal\RepeatedField $ba_proxy_uri + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by BAs to connect to BA proxy. + * @type \Google\Protobuf\BoolValue $satisfies_pzs + * Output only. Reserved for future use. + * @type bool $satisfies_pzi + * Output only. Reserved for future use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The description of the ManagementServer instance (2048 characters + * or less). + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of the ManagementServer instance (2048 characters + * or less). + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * Labels currently defined: + * 1. migrate_from_go= + * If set to true, the MS is created in migration ready mode. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * Labels currently defined: + * 1. migrate_from_go= + * If set to true, the MS is created in migration ready mode. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. The type of the ManagementServer resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceType type = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Optional. The type of the ManagementServer resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceType type = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\ManagementServer\InstanceType::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by clients to connect to AGM/RD graphical user interface and APIs. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementURI management_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\ManagementURI|null + */ + public function getManagementUri() + { + return $this->management_uri; + } + + public function hasManagementUri() + { + return isset($this->management_uri); + } + + public function clearManagementUri() + { + unset($this->management_uri); + } + + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by clients to connect to AGM/RD graphical user interface and APIs. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementURI management_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\ManagementURI $var + * @return $this + */ + public function setManagementUri($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ManagementURI::class); + $this->management_uri = $var; + + return $this; + } + + /** + * Output only. The hostnames of the exposed AGM endpoints for both types of + * user i.e. 1p and 3p, used to connect AGM/RM UI. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI|null + */ + public function getWorkforceIdentityBasedManagementUri() + { + return $this->workforce_identity_based_management_uri; + } + + public function hasWorkforceIdentityBasedManagementUri() + { + return isset($this->workforce_identity_based_management_uri); + } + + public function clearWorkforceIdentityBasedManagementUri() + { + unset($this->workforce_identity_based_management_uri); + } + + /** + * Output only. The hostnames of the exposed AGM endpoints for both types of + * user i.e. 1p and 3p, used to connect AGM/RM UI. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI $var + * @return $this + */ + public function setWorkforceIdentityBasedManagementUri($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI::class); + $this->workforce_identity_based_management_uri = $var; + + return $this; + } + + /** + * Output only. The ManagementServer state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The ManagementServer state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\ManagementServer\InstanceState::class); + $this->state = $var; + + return $this; + } + + /** + * Required. VPC networks to which the ManagementServer instance is connected. + * For this version, only a single network is supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkConfig networks = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworks() + { + return $this->networks; + } + + /** + * Required. VPC networks to which the ManagementServer instance is connected. + * For this version, only a single network is supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkConfig networks = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\BackupDR\V1\NetworkConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\NetworkConfig::class); + $this->networks = $arr; + + return $this; + } + + /** + * Optional. Server specified ETag for the ManagementServer resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field string etag = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. Server specified ETag for the ManagementServer resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field string etag = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. The OAuth 2.0 client id is required to make API calls to the + * BackupDR instance API of this ManagementServer. This is the value that + * should be provided in the 'aud' field of the OIDC ID Token (see openid + * specification + * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). + * + * Generated from protobuf field string oauth2_client_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getOauth2ClientId() + { + return $this->oauth2_client_id; + } + + /** + * Output only. The OAuth 2.0 client id is required to make API calls to the + * BackupDR instance API of this ManagementServer. This is the value that + * should be provided in the 'aud' field of the OIDC ID Token (see openid + * specification + * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). + * + * Generated from protobuf field string oauth2_client_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setOauth2ClientId($var) + { + GPBUtil::checkString($var, True); + $this->oauth2_client_id = $var; + + return $this; + } + + /** + * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID workforce_identity_based_oauth2_client_id = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID|null + */ + public function getWorkforceIdentityBasedOauth2ClientId() + { + return $this->workforce_identity_based_oauth2_client_id; + } + + public function hasWorkforceIdentityBasedOauth2ClientId() + { + return isset($this->workforce_identity_based_oauth2_client_id); + } + + public function clearWorkforceIdentityBasedOauth2ClientId() + { + unset($this->workforce_identity_based_oauth2_client_id); + } + + /** + * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID workforce_identity_based_oauth2_client_id = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID $var + * @return $this + */ + public function setWorkforceIdentityBasedOauth2ClientId($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID::class); + $this->workforce_identity_based_oauth2_client_id = $var; + + return $this; + } + + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by BAs to connect to BA proxy. + * + * Generated from protobuf field repeated string ba_proxy_uri = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBaProxyUri() + { + return $this->ba_proxy_uri; + } + + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by BAs to connect to BA proxy. + * + * Generated from protobuf field repeated string ba_proxy_uri = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBaProxyUri($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ba_proxy_uri = $arr; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field .google.protobuf.BoolValue satisfies_pzs = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Returns the unboxed value from getSatisfiesPzs() + + * Output only. Reserved for future use. + * + * Generated from protobuf field .google.protobuf.BoolValue satisfies_pzs = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool|null + */ + public function getSatisfiesPzsUnwrapped() + { + return $this->readWrapperValue("satisfies_pzs"); + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field .google.protobuf.BoolValue satisfies_pzs = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Output only. Reserved for future use. + * + * Generated from protobuf field .google.protobuf.BoolValue satisfies_pzs = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool|null $var + * @return $this + */ + public function setSatisfiesPzsUnwrapped($var) + { + $this->writeWrapperValue("satisfies_pzs", $var); + return $this;} + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return $this->satisfies_pzi; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceState.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceState.php new file mode 100644 index 000000000000..1973178f3721 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceState.php @@ -0,0 +1,102 @@ +google.cloud.backupdr.v1.ManagementServer.InstanceState + */ +class InstanceState +{ + /** + * State not set. + * + * Generated from protobuf enum INSTANCE_STATE_UNSPECIFIED = 0; + */ + const INSTANCE_STATE_UNSPECIFIED = 0; + /** + * The instance is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The instance has been created and is fully usable. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The instance configuration is being updated. Certain kinds of updates + * may cause the instance to become unusable while the update is in + * progress. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * The instance is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * The instance is being repaired and may be unstable. + * + * Generated from protobuf enum REPAIRING = 5; + */ + const REPAIRING = 5; + /** + * Maintenance is being performed on this instance. + * + * Generated from protobuf enum MAINTENANCE = 6; + */ + const MAINTENANCE = 6; + /** + * The instance is experiencing an issue and might be unusable. You can get + * further details from the statusMessage field of Instance resource. + * + * Generated from protobuf enum ERROR = 7; + */ + const ERROR = 7; + + private static $valueToName = [ + self::INSTANCE_STATE_UNSPECIFIED => 'INSTANCE_STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::UPDATING => 'UPDATING', + self::DELETING => 'DELETING', + self::REPAIRING => 'REPAIRING', + self::MAINTENANCE => 'MAINTENANCE', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstanceState::class, \Google\Cloud\BackupDR\V1\ManagementServer_InstanceState::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceType.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceType.php new file mode 100644 index 000000000000..edb8d1ad4dcf --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceType.php @@ -0,0 +1,57 @@ +google.cloud.backupdr.v1.ManagementServer.InstanceType + */ +class InstanceType +{ + /** + * Instance type is not mentioned. + * + * Generated from protobuf enum INSTANCE_TYPE_UNSPECIFIED = 0; + */ + const INSTANCE_TYPE_UNSPECIFIED = 0; + /** + * Instance for backup and restore management (i.e., AGM). + * + * Generated from protobuf enum BACKUP_RESTORE = 1; + */ + const BACKUP_RESTORE = 1; + + private static $valueToName = [ + self::INSTANCE_TYPE_UNSPECIFIED => 'INSTANCE_TYPE_UNSPECIFIED', + self::BACKUP_RESTORE => 'BACKUP_RESTORE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstanceType::class, \Google\Cloud\BackupDR\V1\ManagementServer_InstanceType::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementURI.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementURI.php new file mode 100644 index 000000000000..5f9224ac9402 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementURI.php @@ -0,0 +1,101 @@ +google.cloud.backupdr.v1.ManagementURI + */ +class ManagementURI extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The ManagementServer AGM/RD WebUI URL. + * + * Generated from protobuf field string web_ui = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $web_ui = ''; + /** + * Output only. The ManagementServer AGM/RD API URL. + * + * Generated from protobuf field string api = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $web_ui + * Output only. The ManagementServer AGM/RD WebUI URL. + * @type string $api + * Output only. The ManagementServer AGM/RD API URL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The ManagementServer AGM/RD WebUI URL. + * + * Generated from protobuf field string web_ui = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getWebUi() + { + return $this->web_ui; + } + + /** + * Output only. The ManagementServer AGM/RD WebUI URL. + * + * Generated from protobuf field string web_ui = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setWebUi($var) + { + GPBUtil::checkString($var, True); + $this->web_ui = $var; + + return $this; + } + + /** + * Output only. The ManagementServer AGM/RD API URL. + * + * Generated from protobuf field string api = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApi() + { + return $this->api; + } + + /** + * Output only. The ManagementServer AGM/RD API URL. + * + * Generated from protobuf field string api = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApi($var) + { + GPBUtil::checkString($var, True); + $this->api = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Metadata.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Metadata.php new file mode 100644 index 000000000000..a47c48d30479 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Metadata.php @@ -0,0 +1,71 @@ +google.cloud.backupdr.v1.Metadata + */ +class Metadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Array of key/value pairs. The total size of all keys and values + * must be less than 512 KB. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Entry items = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\Entry>|\Google\Protobuf\Internal\RepeatedField $items + * Optional. Array of key/value pairs. The total size of all keys and values + * must be less than 512 KB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Array of key/value pairs. The total size of all keys and values + * must be less than 512 KB. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Entry items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * Optional. Array of key/value pairs. The total size of all keys and values + * must be less than 512 KB. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Entry items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\Entry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\Entry::class); + $this->items = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig.php new file mode 100644 index 000000000000..93a42fa20272 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig.php @@ -0,0 +1,109 @@ +google.cloud.backupdr.v1.NetworkConfig + */ +class NetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The resource name of the Google Compute Engine VPC network to + * which the ManagementServer instance is connected. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network = ''; + /** + * Optional. The network connect mode of the ManagementServer instance. For + * this version, only PRIVATE_SERVICE_ACCESS is supported. + * + * Generated from protobuf field .google.cloud.backupdr.v1.NetworkConfig.PeeringMode peering_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $peering_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Optional. The resource name of the Google Compute Engine VPC network to + * which the ManagementServer instance is connected. + * @type int $peering_mode + * Optional. The network connect mode of the ManagementServer instance. For + * this version, only PRIVATE_SERVICE_ACCESS is supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The resource name of the Google Compute Engine VPC network to + * which the ManagementServer instance is connected. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Optional. The resource name of the Google Compute Engine VPC network to + * which the ManagementServer instance is connected. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. The network connect mode of the ManagementServer instance. For + * this version, only PRIVATE_SERVICE_ACCESS is supported. + * + * Generated from protobuf field .google.cloud.backupdr.v1.NetworkConfig.PeeringMode peering_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPeeringMode() + { + return $this->peering_mode; + } + + /** + * Optional. The network connect mode of the ManagementServer instance. For + * this version, only PRIVATE_SERVICE_ACCESS is supported. + * + * Generated from protobuf field .google.cloud.backupdr.v1.NetworkConfig.PeeringMode peering_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPeeringMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\NetworkConfig\PeeringMode::class); + $this->peering_mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig/PeeringMode.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig/PeeringMode.php new file mode 100644 index 000000000000..6c153e8bd600 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig/PeeringMode.php @@ -0,0 +1,59 @@ +google.cloud.backupdr.v1.NetworkConfig.PeeringMode + */ +class PeeringMode +{ + /** + * Peering mode not set. + * + * Generated from protobuf enum PEERING_MODE_UNSPECIFIED = 0; + */ + const PEERING_MODE_UNSPECIFIED = 0; + /** + * Connect using Private Service Access to the Management Server. Private + * services access provides an IP address range for multiple Google Cloud + * services, including Cloud BackupDR. + * + * Generated from protobuf enum PRIVATE_SERVICE_ACCESS = 1; + */ + const PRIVATE_SERVICE_ACCESS = 1; + + private static $valueToName = [ + self::PEERING_MODE_UNSPECIFIED => 'PEERING_MODE_UNSPECIFIED', + self::PRIVATE_SERVICE_ACCESS => 'PRIVATE_SERVICE_ACCESS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PeeringMode::class, \Google\Cloud\BackupDR\V1\NetworkConfig_PeeringMode::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface.php new file mode 100644 index 000000000000..f814b5bc7885 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface.php @@ -0,0 +1,700 @@ +google.cloud.backupdr.v1.NetworkInterface + */ +class NetworkInterface extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. URL of the VPC network resource for this instance. + * + * Generated from protobuf field optional string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network = null; + /** + * Optional. The URL of the Subnetwork resource for this instance. + * + * Generated from protobuf field optional string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subnetwork = null; + /** + * Optional. An IPv4 internal IP address to assign to the instance for this + * network interface. If not specified by the user, an unused internal IP is + * assigned by the system. + * + * Generated from protobuf field optional string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $ip_address = null; + /** + * Optional. An IPv6 internal network address for this network interface. To + * use a static internal IP address, it must be unused and in the same region + * as the instance's zone. If not specified, Google Cloud will automatically + * assign an internal IPv6 address from the instance's subnetwork. + * + * Generated from protobuf field optional string ipv6_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $ipv6_address = null; + /** + * Optional. The prefix length of the primary internal IPv6 range. + * + * Generated from protobuf field optional int32 internal_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $internal_ipv6_prefix_length = null; + /** + * Output only. [Output Only] The name of the network interface, which is + * generated by the server. + * + * Generated from protobuf field optional string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = null; + /** + * Optional. An array of configurations for this interface. Currently, only + * one access config,ONE_TO_ONE_NAT is supported. If there are no + * accessConfigs specified, then this instance will have + * no external internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig access_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $access_configs; + /** + * Optional. An array of IPv6 access configurations for this interface. + * Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + * is no ipv6AccessConfig specified, then this instance will + * have no external IPv6 Internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig ipv6_access_configs = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ipv6_access_configs; + /** + * Optional. An array of alias IP ranges for this network interface. + * You can only specify this field for network interfaces in VPC networks. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AliasIpRange alias_ip_ranges = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $alias_ip_ranges; + /** + * The stack type for this network interface. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.StackType stack_type = 10; + */ + protected $stack_type = null; + /** + * Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + * IP can be accessed from the Internet. This field is always inherited from + * its subnetwork. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType ipv6_access_type = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ipv6_access_type = null; + /** + * Optional. The networking queue count that's specified by users for the + * network interface. Both Rx and Tx queues will be set to this number. It'll + * be empty if not specified by the users. + * + * Generated from protobuf field optional int32 queue_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $queue_count = null; + /** + * Optional. The type of vNIC to be used on this interface. This may be gVNIC + * or VirtioNet. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.NicType nic_type = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $nic_type = null; + /** + * Optional. The URL of the network attachment that this interface should + * connect to in the following format: + * projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * + * Generated from protobuf field optional string network_attachment = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_attachment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Optional. URL of the VPC network resource for this instance. + * @type string $subnetwork + * Optional. The URL of the Subnetwork resource for this instance. + * @type string $ip_address + * Optional. An IPv4 internal IP address to assign to the instance for this + * network interface. If not specified by the user, an unused internal IP is + * assigned by the system. + * @type string $ipv6_address + * Optional. An IPv6 internal network address for this network interface. To + * use a static internal IP address, it must be unused and in the same region + * as the instance's zone. If not specified, Google Cloud will automatically + * assign an internal IPv6 address from the instance's subnetwork. + * @type int $internal_ipv6_prefix_length + * Optional. The prefix length of the primary internal IPv6 range. + * @type string $name + * Output only. [Output Only] The name of the network interface, which is + * generated by the server. + * @type array<\Google\Cloud\BackupDR\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $access_configs + * Optional. An array of configurations for this interface. Currently, only + * one access config,ONE_TO_ONE_NAT is supported. If there are no + * accessConfigs specified, then this instance will have + * no external internet access. + * @type array<\Google\Cloud\BackupDR\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $ipv6_access_configs + * Optional. An array of IPv6 access configurations for this interface. + * Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + * is no ipv6AccessConfig specified, then this instance will + * have no external IPv6 Internet access. + * @type array<\Google\Cloud\BackupDR\V1\AliasIpRange>|\Google\Protobuf\Internal\RepeatedField $alias_ip_ranges + * Optional. An array of alias IP ranges for this network interface. + * You can only specify this field for network interfaces in VPC networks. + * @type int $stack_type + * The stack type for this network interface. + * @type int $ipv6_access_type + * Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + * IP can be accessed from the Internet. This field is always inherited from + * its subnetwork. + * @type int $queue_count + * Optional. The networking queue count that's specified by users for the + * network interface. Both Rx and Tx queues will be set to this number. It'll + * be empty if not specified by the users. + * @type int $nic_type + * Optional. The type of vNIC to be used on this interface. This may be gVNIC + * or VirtioNet. + * @type string $network_attachment + * Optional. The URL of the network attachment that this interface should + * connect to in the following format: + * projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. URL of the VPC network resource for this instance. + * + * Generated from protobuf field optional string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * Optional. URL of the VPC network resource for this instance. + * + * Generated from protobuf field optional string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. The URL of the Subnetwork resource for this instance. + * + * Generated from protobuf field optional string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubnetwork() + { + return isset($this->subnetwork) ? $this->subnetwork : ''; + } + + public function hasSubnetwork() + { + return isset($this->subnetwork); + } + + public function clearSubnetwork() + { + unset($this->subnetwork); + } + + /** + * Optional. The URL of the Subnetwork resource for this instance. + * + * Generated from protobuf field optional string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * Optional. An IPv4 internal IP address to assign to the instance for this + * network interface. If not specified by the user, an unused internal IP is + * assigned by the system. + * + * Generated from protobuf field optional string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getIpAddress() + { + return isset($this->ip_address) ? $this->ip_address : ''; + } + + public function hasIpAddress() + { + return isset($this->ip_address); + } + + public function clearIpAddress() + { + unset($this->ip_address); + } + + /** + * Optional. An IPv4 internal IP address to assign to the instance for this + * network interface. If not specified by the user, an unused internal IP is + * assigned by the system. + * + * Generated from protobuf field optional string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * Optional. An IPv6 internal network address for this network interface. To + * use a static internal IP address, it must be unused and in the same region + * as the instance's zone. If not specified, Google Cloud will automatically + * assign an internal IPv6 address from the instance's subnetwork. + * + * Generated from protobuf field optional string ipv6_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getIpv6Address() + { + return isset($this->ipv6_address) ? $this->ipv6_address : ''; + } + + public function hasIpv6Address() + { + return isset($this->ipv6_address); + } + + public function clearIpv6Address() + { + unset($this->ipv6_address); + } + + /** + * Optional. An IPv6 internal network address for this network interface. To + * use a static internal IP address, it must be unused and in the same region + * as the instance's zone. If not specified, Google Cloud will automatically + * assign an internal IPv6 address from the instance's subnetwork. + * + * Generated from protobuf field optional string ipv6_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setIpv6Address($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_address = $var; + + return $this; + } + + /** + * Optional. The prefix length of the primary internal IPv6 range. + * + * Generated from protobuf field optional int32 internal_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getInternalIpv6PrefixLength() + { + return isset($this->internal_ipv6_prefix_length) ? $this->internal_ipv6_prefix_length : 0; + } + + public function hasInternalIpv6PrefixLength() + { + return isset($this->internal_ipv6_prefix_length); + } + + public function clearInternalIpv6PrefixLength() + { + unset($this->internal_ipv6_prefix_length); + } + + /** + * Optional. The prefix length of the primary internal IPv6 range. + * + * Generated from protobuf field optional int32 internal_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setInternalIpv6PrefixLength($var) + { + GPBUtil::checkInt32($var); + $this->internal_ipv6_prefix_length = $var; + + return $this; + } + + /** + * Output only. [Output Only] The name of the network interface, which is + * generated by the server. + * + * Generated from protobuf field optional string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Output only. [Output Only] The name of the network interface, which is + * generated by the server. + * + * Generated from protobuf field optional string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An array of configurations for this interface. Currently, only + * one access config,ONE_TO_ONE_NAT is supported. If there are no + * accessConfigs specified, then this instance will have + * no external internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig access_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccessConfigs() + { + return $this->access_configs; + } + + /** + * Optional. An array of configurations for this interface. Currently, only + * one access config,ONE_TO_ONE_NAT is supported. If there are no + * accessConfigs specified, then this instance will have + * no external internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig access_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccessConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AccessConfig::class); + $this->access_configs = $arr; + + return $this; + } + + /** + * Optional. An array of IPv6 access configurations for this interface. + * Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + * is no ipv6AccessConfig specified, then this instance will + * have no external IPv6 Internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig ipv6_access_configs = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIpv6AccessConfigs() + { + return $this->ipv6_access_configs; + } + + /** + * Optional. An array of IPv6 access configurations for this interface. + * Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + * is no ipv6AccessConfig specified, then this instance will + * have no external IPv6 Internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig ipv6_access_configs = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIpv6AccessConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AccessConfig::class); + $this->ipv6_access_configs = $arr; + + return $this; + } + + /** + * Optional. An array of alias IP ranges for this network interface. + * You can only specify this field for network interfaces in VPC networks. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AliasIpRange alias_ip_ranges = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAliasIpRanges() + { + return $this->alias_ip_ranges; + } + + /** + * Optional. An array of alias IP ranges for this network interface. + * You can only specify this field for network interfaces in VPC networks. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AliasIpRange alias_ip_ranges = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\AliasIpRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAliasIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AliasIpRange::class); + $this->alias_ip_ranges = $arr; + + return $this; + } + + /** + * The stack type for this network interface. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.StackType stack_type = 10; + * @return int + */ + public function getStackType() + { + return isset($this->stack_type) ? $this->stack_type : 0; + } + + public function hasStackType() + { + return isset($this->stack_type); + } + + public function clearStackType() + { + unset($this->stack_type); + } + + /** + * The stack type for this network interface. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.StackType stack_type = 10; + * @param int $var + * @return $this + */ + public function setStackType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\NetworkInterface\StackType::class); + $this->stack_type = $var; + + return $this; + } + + /** + * Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + * IP can be accessed from the Internet. This field is always inherited from + * its subnetwork. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType ipv6_access_type = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIpv6AccessType() + { + return isset($this->ipv6_access_type) ? $this->ipv6_access_type : 0; + } + + public function hasIpv6AccessType() + { + return isset($this->ipv6_access_type); + } + + public function clearIpv6AccessType() + { + unset($this->ipv6_access_type); + } + + /** + * Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + * IP can be accessed from the Internet. This field is always inherited from + * its subnetwork. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType ipv6_access_type = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIpv6AccessType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\NetworkInterface\Ipv6AccessType::class); + $this->ipv6_access_type = $var; + + return $this; + } + + /** + * Optional. The networking queue count that's specified by users for the + * network interface. Both Rx and Tx queues will be set to this number. It'll + * be empty if not specified by the users. + * + * Generated from protobuf field optional int32 queue_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getQueueCount() + { + return isset($this->queue_count) ? $this->queue_count : 0; + } + + public function hasQueueCount() + { + return isset($this->queue_count); + } + + public function clearQueueCount() + { + unset($this->queue_count); + } + + /** + * Optional. The networking queue count that's specified by users for the + * network interface. Both Rx and Tx queues will be set to this number. It'll + * be empty if not specified by the users. + * + * Generated from protobuf field optional int32 queue_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setQueueCount($var) + { + GPBUtil::checkInt32($var); + $this->queue_count = $var; + + return $this; + } + + /** + * Optional. The type of vNIC to be used on this interface. This may be gVNIC + * or VirtioNet. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.NicType nic_type = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getNicType() + { + return isset($this->nic_type) ? $this->nic_type : 0; + } + + public function hasNicType() + { + return isset($this->nic_type); + } + + public function clearNicType() + { + unset($this->nic_type); + } + + /** + * Optional. The type of vNIC to be used on this interface. This may be gVNIC + * or VirtioNet. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.NicType nic_type = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setNicType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\NetworkInterface\NicType::class); + $this->nic_type = $var; + + return $this; + } + + /** + * Optional. The URL of the network attachment that this interface should + * connect to in the following format: + * projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * + * Generated from protobuf field optional string network_attachment = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNetworkAttachment() + { + return isset($this->network_attachment) ? $this->network_attachment : ''; + } + + public function hasNetworkAttachment() + { + return isset($this->network_attachment); + } + + public function clearNetworkAttachment() + { + unset($this->network_attachment); + } + + /** + * Optional. The URL of the network attachment that this interface should + * connect to in the following format: + * projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * + * Generated from protobuf field optional string network_attachment = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNetworkAttachment($var) + { + GPBUtil::checkString($var, True); + $this->network_attachment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/Ipv6AccessType.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/Ipv6AccessType.php new file mode 100644 index 000000000000..3fd3019ef1d9 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/Ipv6AccessType.php @@ -0,0 +1,65 @@ +google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType + */ +class Ipv6AccessType +{ + /** + * IPv6 access type not set. Means this network interface hasn't been + * turned on IPv6 yet. + * + * Generated from protobuf enum UNSPECIFIED_IPV6_ACCESS_TYPE = 0; + */ + const UNSPECIFIED_IPV6_ACCESS_TYPE = 0; + /** + * This network interface can have internal IPv6. + * + * Generated from protobuf enum INTERNAL = 1; + */ + const INTERNAL = 1; + /** + * This network interface can have external IPv6. + * + * Generated from protobuf enum EXTERNAL = 2; + */ + const EXTERNAL = 2; + + private static $valueToName = [ + self::UNSPECIFIED_IPV6_ACCESS_TYPE => 'UNSPECIFIED_IPV6_ACCESS_TYPE', + self::INTERNAL => 'INTERNAL', + self::EXTERNAL => 'EXTERNAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Ipv6AccessType::class, \Google\Cloud\BackupDR\V1\NetworkInterface_Ipv6AccessType::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/NicType.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/NicType.php new file mode 100644 index 000000000000..692fba7a610b --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/NicType.php @@ -0,0 +1,64 @@ +google.cloud.backupdr.v1.NetworkInterface.NicType + */ +class NicType +{ + /** + * Default should be NIC_TYPE_UNSPECIFIED. + * + * Generated from protobuf enum NIC_TYPE_UNSPECIFIED = 0; + */ + const NIC_TYPE_UNSPECIFIED = 0; + /** + * VIRTIO + * + * Generated from protobuf enum VIRTIO_NET = 1; + */ + const VIRTIO_NET = 1; + /** + * GVNIC + * + * Generated from protobuf enum GVNIC = 2; + */ + const GVNIC = 2; + + private static $valueToName = [ + self::NIC_TYPE_UNSPECIFIED => 'NIC_TYPE_UNSPECIFIED', + self::VIRTIO_NET => 'VIRTIO_NET', + self::GVNIC => 'GVNIC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NicType::class, \Google\Cloud\BackupDR\V1\NetworkInterface_NicType::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/StackType.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/StackType.php new file mode 100644 index 000000000000..9a2933d8f880 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/StackType.php @@ -0,0 +1,64 @@ +google.cloud.backupdr.v1.NetworkInterface.StackType + */ +class StackType +{ + /** + * Default should be STACK_TYPE_UNSPECIFIED. + * + * Generated from protobuf enum STACK_TYPE_UNSPECIFIED = 0; + */ + const STACK_TYPE_UNSPECIFIED = 0; + /** + * The network interface will be assigned IPv4 address. + * + * Generated from protobuf enum IPV4_ONLY = 1; + */ + const IPV4_ONLY = 1; + /** + * The network interface can have both IPv4 and IPv6 addresses. + * + * Generated from protobuf enum IPV4_IPV6 = 2; + */ + const IPV4_IPV6 = 2; + + private static $valueToName = [ + self::STACK_TYPE_UNSPECIFIED => 'STACK_TYPE_UNSPECIFIED', + self::IPV4_ONLY => 'IPV4_ONLY', + self::IPV4_IPV6 => 'IPV4_IPV6', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StackType::class, \Google\Cloud\BackupDR\V1\NetworkInterface_StackType::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkPerformanceConfig.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkPerformanceConfig.php new file mode 100644 index 000000000000..9104b7f0e842 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkPerformanceConfig.php @@ -0,0 +1,77 @@ +google.cloud.backupdr.v1.NetworkPerformanceConfig + */ +class NetworkPerformanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The tier of the total egress bandwidth. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier total_egress_bandwidth_tier = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $total_egress_bandwidth_tier = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $total_egress_bandwidth_tier + * Optional. The tier of the total egress bandwidth. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The tier of the total egress bandwidth. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier total_egress_bandwidth_tier = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTotalEgressBandwidthTier() + { + return isset($this->total_egress_bandwidth_tier) ? $this->total_egress_bandwidth_tier : 0; + } + + public function hasTotalEgressBandwidthTier() + { + return isset($this->total_egress_bandwidth_tier); + } + + public function clearTotalEgressBandwidthTier() + { + unset($this->total_egress_bandwidth_tier); + } + + /** + * Optional. The tier of the total egress bandwidth. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier total_egress_bandwidth_tier = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTotalEgressBandwidthTier($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig\Tier::class); + $this->total_egress_bandwidth_tier = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkPerformanceConfig/Tier.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkPerformanceConfig/Tier.php new file mode 100644 index 000000000000..4ed540cb417e --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkPerformanceConfig/Tier.php @@ -0,0 +1,68 @@ +google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier + */ +class Tier +{ + /** + * This value is unused. + * + * Generated from protobuf enum TIER_UNSPECIFIED = 0; + */ + const TIER_UNSPECIFIED = 0; + /** + * Default network performance config. + * + * Generated from protobuf enum DEFAULT = 1; + */ + const PBDEFAULT = 1; + /** + * Tier 1 network performance config. + * + * Generated from protobuf enum TIER_1 = 2; + */ + const TIER_1 = 2; + + private static $valueToName = [ + self::TIER_UNSPECIFIED => 'TIER_UNSPECIFIED', + self::PBDEFAULT => 'DEFAULT', + self::TIER_1 => 'TIER_1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Tier::class, \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig_Tier::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/OperationMetadata.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/OperationMetadata.php new file mode 100644 index 000000000000..e880bbc7986d --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/OperationMetadata.php @@ -0,0 +1,345 @@ +google.cloud.backupdr.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + /** + * Output only. AdditionalInfo contains additional Info related to backup plan + * association resource. + * + * Generated from protobuf field map additional_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $additional_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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. + * @type array|\Google\Protobuf\Internal\MapField $additional_info + * Output only. AdditionalInfo contains additional Info related to backup plan + * association resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + + /** + * Output only. AdditionalInfo contains additional Info related to backup plan + * association resource. + * + * Generated from protobuf field map additional_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAdditionalInfo() + { + return $this->additional_info; + } + + /** + * Output only. AdditionalInfo contains additional Info related to backup plan + * association resource. + * + * Generated from protobuf field map additional_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAdditionalInfo($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->additional_info = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RestoreBackupRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RestoreBackupRequest.php new file mode 100644 index 000000000000..57cda39c282c --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RestoreBackupRequest.php @@ -0,0 +1,244 @@ +google.cloud.backupdr.v1.RestoreBackupRequest + */ +class RestoreBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Backup instance, in the format + * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + protected $target_environment; + protected $instance_properties; + + /** + * @param string $name Required. The resource name of the Backup instance, in the format + * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. Please see + * {@see BackupDRClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\RestoreBackupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Backup instance, in the format + * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type \Google\Cloud\BackupDR\V1\ComputeInstanceTargetEnvironment $compute_instance_target_environment + * Compute Engine target environment to be used during restore. + * @type \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties $compute_instance_restore_properties + * Compute Engine instance properties to be overridden during restore. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Backup instance, in the format + * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Backup instance, in the format + * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Compute Engine target environment to be used during restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment compute_instance_target_environment = 3; + * @return \Google\Cloud\BackupDR\V1\ComputeInstanceTargetEnvironment|null + */ + public function getComputeInstanceTargetEnvironment() + { + return $this->readOneof(3); + } + + public function hasComputeInstanceTargetEnvironment() + { + return $this->hasOneof(3); + } + + /** + * Compute Engine target environment to be used during restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment compute_instance_target_environment = 3; + * @param \Google\Cloud\BackupDR\V1\ComputeInstanceTargetEnvironment $var + * @return $this + */ + public function setComputeInstanceTargetEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ComputeInstanceTargetEnvironment::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Compute Engine instance properties to be overridden during restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceRestoreProperties compute_instance_restore_properties = 4; + * @return \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties|null + */ + public function getComputeInstanceRestoreProperties() + { + return $this->readOneof(4); + } + + public function hasComputeInstanceRestoreProperties() + { + return $this->hasOneof(4); + } + + /** + * Compute Engine instance properties to be overridden during restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceRestoreProperties compute_instance_restore_properties = 4; + * @param \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties $var + * @return $this + */ + public function setComputeInstanceRestoreProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getTargetEnvironment() + { + return $this->whichOneof("target_environment"); + } + + /** + * @return string + */ + public function getInstanceProperties() + { + return $this->whichOneof("instance_properties"); + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RestoreBackupResponse.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RestoreBackupResponse.php new file mode 100644 index 000000000000..27614255363f --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RestoreBackupResponse.php @@ -0,0 +1,77 @@ +google.cloud.backupdr.v1.RestoreBackupResponse + */ +class RestoreBackupResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Details of the target resource created/modified as part of restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.TargetResource target_resource = 1; + */ + protected $target_resource = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BackupDR\V1\TargetResource $target_resource + * Details of the target resource created/modified as part of restore. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Details of the target resource created/modified as part of restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.TargetResource target_resource = 1; + * @return \Google\Cloud\BackupDR\V1\TargetResource|null + */ + public function getTargetResource() + { + return $this->target_resource; + } + + public function hasTargetResource() + { + return isset($this->target_resource); + } + + public function clearTargetResource() + { + unset($this->target_resource); + } + + /** + * Details of the target resource created/modified as part of restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.TargetResource target_resource = 1; + * @param \Google\Cloud\BackupDR\V1\TargetResource $var + * @return $this + */ + public function setTargetResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\TargetResource::class); + $this->target_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RuleConfigInfo.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RuleConfigInfo.php new file mode 100644 index 000000000000..710f042a26d9 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RuleConfigInfo.php @@ -0,0 +1,201 @@ +google.cloud.backupdr.v1.RuleConfigInfo + */ +class RuleConfigInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Output Only. + * Backup Rule id fetched from backup plan. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $rule_id = ''; + /** + * Output only. The last backup state for rule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState last_backup_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_backup_state = 0; + /** + * Output only. Output Only. + * google.rpc.Status object to store the last backup error. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_backup_error = null; + /** + * Output only. The point in time when the last successful backup was captured + * from the source. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_successful_backup_consistency_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $rule_id + * Output only. Output Only. + * Backup Rule id fetched from backup plan. + * @type int $last_backup_state + * Output only. The last backup state for rule. + * @type \Google\Rpc\Status $last_backup_error + * Output only. Output Only. + * google.rpc.Status object to store the last backup error. + * @type \Google\Protobuf\Timestamp $last_successful_backup_consistency_time + * Output only. The point in time when the last successful backup was captured + * from the source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Output Only. + * Backup Rule id fetched from backup plan. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRuleId() + { + return $this->rule_id; + } + + /** + * Output only. Output Only. + * Backup Rule id fetched from backup plan. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRuleId($var) + { + GPBUtil::checkString($var, True); + $this->rule_id = $var; + + return $this; + } + + /** + * Output only. The last backup state for rule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState last_backup_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getLastBackupState() + { + return $this->last_backup_state; + } + + /** + * Output only. The last backup state for rule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState last_backup_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setLastBackupState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\RuleConfigInfo\LastBackupState::class); + $this->last_backup_state = $var; + + return $this; + } + + /** + * Output only. Output Only. + * google.rpc.Status object to store the last backup error. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getLastBackupError() + { + return $this->last_backup_error; + } + + public function hasLastBackupError() + { + return isset($this->last_backup_error); + } + + public function clearLastBackupError() + { + unset($this->last_backup_error); + } + + /** + * Output only. Output Only. + * google.rpc.Status object to store the last backup error. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setLastBackupError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->last_backup_error = $var; + + return $this; + } + + /** + * Output only. The point in time when the last successful backup was captured + * from the source. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastSuccessfulBackupConsistencyTime() + { + return $this->last_successful_backup_consistency_time; + } + + public function hasLastSuccessfulBackupConsistencyTime() + { + return isset($this->last_successful_backup_consistency_time); + } + + public function clearLastSuccessfulBackupConsistencyTime() + { + unset($this->last_successful_backup_consistency_time); + } + + /** + * Output only. The point in time when the last successful backup was captured + * from the source. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastSuccessfulBackupConsistencyTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_successful_backup_consistency_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RuleConfigInfo/LastBackupState.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RuleConfigInfo/LastBackupState.php new file mode 100644 index 000000000000..2d60713fc717 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RuleConfigInfo/LastBackupState.php @@ -0,0 +1,79 @@ +google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState + */ +class LastBackupState +{ + /** + * State not set. + * + * Generated from protobuf enum LAST_BACKUP_STATE_UNSPECIFIED = 0; + */ + const LAST_BACKUP_STATE_UNSPECIFIED = 0; + /** + * The first backup is pending. + * + * Generated from protobuf enum FIRST_BACKUP_PENDING = 1; + */ + const FIRST_BACKUP_PENDING = 1; + /** + * The most recent backup could not be run/failed because of the lack of + * permissions. + * + * Generated from protobuf enum PERMISSION_DENIED = 2; + */ + const PERMISSION_DENIED = 2; + /** + * The last backup operation succeeded. + * + * Generated from protobuf enum SUCCEEDED = 3; + */ + const SUCCEEDED = 3; + /** + * The last backup operation failed. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + + private static $valueToName = [ + self::LAST_BACKUP_STATE_UNSPECIFIED => 'LAST_BACKUP_STATE_UNSPECIFIED', + self::FIRST_BACKUP_PENDING => 'FIRST_BACKUP_PENDING', + self::PERMISSION_DENIED => 'PERMISSION_DENIED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LastBackupState::class, \Google\Cloud\BackupDR\V1\RuleConfigInfo_LastBackupState::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling.php new file mode 100644 index 000000000000..fceb736acfde --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling.php @@ -0,0 +1,399 @@ +google.cloud.backupdr.v1.Scheduling + */ +class Scheduling extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Defines the maintenance behavior for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.OnHostMaintenance on_host_maintenance = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $on_host_maintenance = null; + /** + * Optional. Specifies whether the instance should be automatically restarted + * if it is terminated by Compute Engine (not terminated by a user). + * + * Generated from protobuf field optional bool automatic_restart = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $automatic_restart = null; + /** + * Optional. Defines whether the instance is preemptible. + * + * Generated from protobuf field optional bool preemptible = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $preemptible = null; + /** + * Optional. A set of node affinity and anti-affinity configurations. + * Overrides reservationAffinity. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Scheduling.NodeAffinity node_affinities = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $node_affinities; + /** + * Optional. The minimum number of virtual CPUs this instance will consume + * when running on a sole-tenant node. + * + * Generated from protobuf field optional int32 min_node_cpus = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $min_node_cpus = null; + /** + * Optional. Specifies the provisioning model of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.ProvisioningModel provisioning_model = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $provisioning_model = null; + /** + * Optional. Specifies the termination action for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction instance_termination_action = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $instance_termination_action = null; + /** + * Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + * while recovery of the Local Ssd state is attempted. Its value should be in + * between 0 and 168 hours with hour granularity and the default value being 1 + * hour. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.SchedulingDuration local_ssd_recovery_timeout = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $local_ssd_recovery_timeout = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $on_host_maintenance + * Optional. Defines the maintenance behavior for this instance. + * @type bool $automatic_restart + * Optional. Specifies whether the instance should be automatically restarted + * if it is terminated by Compute Engine (not terminated by a user). + * @type bool $preemptible + * Optional. Defines whether the instance is preemptible. + * @type array<\Google\Cloud\BackupDR\V1\Scheduling\NodeAffinity>|\Google\Protobuf\Internal\RepeatedField $node_affinities + * Optional. A set of node affinity and anti-affinity configurations. + * Overrides reservationAffinity. + * @type int $min_node_cpus + * Optional. The minimum number of virtual CPUs this instance will consume + * when running on a sole-tenant node. + * @type int $provisioning_model + * Optional. Specifies the provisioning model of the instance. + * @type int $instance_termination_action + * Optional. Specifies the termination action for the instance. + * @type \Google\Cloud\BackupDR\V1\SchedulingDuration $local_ssd_recovery_timeout + * Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + * while recovery of the Local Ssd state is attempted. Its value should be in + * between 0 and 168 hours with hour granularity and the default value being 1 + * hour. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Defines the maintenance behavior for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.OnHostMaintenance on_host_maintenance = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getOnHostMaintenance() + { + return isset($this->on_host_maintenance) ? $this->on_host_maintenance : 0; + } + + public function hasOnHostMaintenance() + { + return isset($this->on_host_maintenance); + } + + public function clearOnHostMaintenance() + { + unset($this->on_host_maintenance); + } + + /** + * Optional. Defines the maintenance behavior for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.OnHostMaintenance on_host_maintenance = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setOnHostMaintenance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Scheduling\OnHostMaintenance::class); + $this->on_host_maintenance = $var; + + return $this; + } + + /** + * Optional. Specifies whether the instance should be automatically restarted + * if it is terminated by Compute Engine (not terminated by a user). + * + * Generated from protobuf field optional bool automatic_restart = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAutomaticRestart() + { + return isset($this->automatic_restart) ? $this->automatic_restart : false; + } + + public function hasAutomaticRestart() + { + return isset($this->automatic_restart); + } + + public function clearAutomaticRestart() + { + unset($this->automatic_restart); + } + + /** + * Optional. Specifies whether the instance should be automatically restarted + * if it is terminated by Compute Engine (not terminated by a user). + * + * Generated from protobuf field optional bool automatic_restart = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAutomaticRestart($var) + { + GPBUtil::checkBool($var); + $this->automatic_restart = $var; + + return $this; + } + + /** + * Optional. Defines whether the instance is preemptible. + * + * Generated from protobuf field optional bool preemptible = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getPreemptible() + { + return isset($this->preemptible) ? $this->preemptible : false; + } + + public function hasPreemptible() + { + return isset($this->preemptible); + } + + public function clearPreemptible() + { + unset($this->preemptible); + } + + /** + * Optional. Defines whether the instance is preemptible. + * + * Generated from protobuf field optional bool preemptible = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setPreemptible($var) + { + GPBUtil::checkBool($var); + $this->preemptible = $var; + + return $this; + } + + /** + * Optional. A set of node affinity and anti-affinity configurations. + * Overrides reservationAffinity. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Scheduling.NodeAffinity node_affinities = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodeAffinities() + { + return $this->node_affinities; + } + + /** + * Optional. A set of node affinity and anti-affinity configurations. + * Overrides reservationAffinity. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Scheduling.NodeAffinity node_affinities = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\Scheduling\NodeAffinity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodeAffinities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\Scheduling\NodeAffinity::class); + $this->node_affinities = $arr; + + return $this; + } + + /** + * Optional. The minimum number of virtual CPUs this instance will consume + * when running on a sole-tenant node. + * + * Generated from protobuf field optional int32 min_node_cpus = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMinNodeCpus() + { + return isset($this->min_node_cpus) ? $this->min_node_cpus : 0; + } + + public function hasMinNodeCpus() + { + return isset($this->min_node_cpus); + } + + public function clearMinNodeCpus() + { + unset($this->min_node_cpus); + } + + /** + * Optional. The minimum number of virtual CPUs this instance will consume + * when running on a sole-tenant node. + * + * Generated from protobuf field optional int32 min_node_cpus = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMinNodeCpus($var) + { + GPBUtil::checkInt32($var); + $this->min_node_cpus = $var; + + return $this; + } + + /** + * Optional. Specifies the provisioning model of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.ProvisioningModel provisioning_model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getProvisioningModel() + { + return isset($this->provisioning_model) ? $this->provisioning_model : 0; + } + + public function hasProvisioningModel() + { + return isset($this->provisioning_model); + } + + public function clearProvisioningModel() + { + unset($this->provisioning_model); + } + + /** + * Optional. Specifies the provisioning model of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.ProvisioningModel provisioning_model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setProvisioningModel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Scheduling\ProvisioningModel::class); + $this->provisioning_model = $var; + + return $this; + } + + /** + * Optional. Specifies the termination action for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction instance_termination_action = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getInstanceTerminationAction() + { + return isset($this->instance_termination_action) ? $this->instance_termination_action : 0; + } + + public function hasInstanceTerminationAction() + { + return isset($this->instance_termination_action); + } + + public function clearInstanceTerminationAction() + { + unset($this->instance_termination_action); + } + + /** + * Optional. Specifies the termination action for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction instance_termination_action = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setInstanceTerminationAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Scheduling\InstanceTerminationAction::class); + $this->instance_termination_action = $var; + + return $this; + } + + /** + * Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + * while recovery of the Local Ssd state is attempted. Its value should be in + * between 0 and 168 hours with hour granularity and the default value being 1 + * hour. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.SchedulingDuration local_ssd_recovery_timeout = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\SchedulingDuration|null + */ + public function getLocalSsdRecoveryTimeout() + { + return $this->local_ssd_recovery_timeout; + } + + public function hasLocalSsdRecoveryTimeout() + { + return isset($this->local_ssd_recovery_timeout); + } + + public function clearLocalSsdRecoveryTimeout() + { + unset($this->local_ssd_recovery_timeout); + } + + /** + * Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + * while recovery of the Local Ssd state is attempted. Its value should be in + * between 0 and 168 hours with hour granularity and the default value being 1 + * hour. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.SchedulingDuration local_ssd_recovery_timeout = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\SchedulingDuration $var + * @return $this + */ + public function setLocalSsdRecoveryTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\SchedulingDuration::class); + $this->local_ssd_recovery_timeout = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/InstanceTerminationAction.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/InstanceTerminationAction.php new file mode 100644 index 000000000000..b2ec47683f00 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/InstanceTerminationAction.php @@ -0,0 +1,64 @@ +google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction + */ +class InstanceTerminationAction +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0; + */ + const INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0; + /** + * Delete the VM. + * + * Generated from protobuf enum DELETE = 1; + */ + const DELETE = 1; + /** + * Stop the VM without storing in-memory content. default action. + * + * Generated from protobuf enum STOP = 2; + */ + const STOP = 2; + + private static $valueToName = [ + self::INSTANCE_TERMINATION_ACTION_UNSPECIFIED => 'INSTANCE_TERMINATION_ACTION_UNSPECIFIED', + self::DELETE => 'DELETE', + self::STOP => 'STOP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstanceTerminationAction::class, \Google\Cloud\BackupDR\V1\Scheduling_InstanceTerminationAction::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity.php new file mode 100644 index 000000000000..766243220a05 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.Scheduling.NodeAffinity + */ +class NodeAffinity extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Corresponds to the label key of Node resource. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key = null; + /** + * Optional. Defines the operation of node selection. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator operator = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $operator = null; + /** + * Optional. Corresponds to the label values of Node resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Optional. Corresponds to the label key of Node resource. + * @type int $operator + * Optional. Defines the operation of node selection. + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * Optional. Corresponds to the label values of Node resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Corresponds to the label key of Node resource. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Optional. Corresponds to the label key of Node resource. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. Defines the operation of node selection. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator operator = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getOperator() + { + return isset($this->operator) ? $this->operator : 0; + } + + public function hasOperator() + { + return isset($this->operator); + } + + public function clearOperator() + { + unset($this->operator); + } + + /** + * Optional. Defines the operation of node selection. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator operator = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setOperator($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Scheduling\NodeAffinity\Operator::class); + $this->operator = $var; + + return $this; + } + + /** + * Optional. Corresponds to the label values of Node resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Optional. Corresponds to the label values of Node resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NodeAffinity::class, \Google\Cloud\BackupDR\V1\Scheduling_NodeAffinity::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity/Operator.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity/Operator.php new file mode 100644 index 000000000000..97cd529b7742 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity/Operator.php @@ -0,0 +1,64 @@ +google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator + */ +class Operator +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; + */ + const OPERATOR_UNSPECIFIED = 0; + /** + * Requires Compute Engine to seek for matched nodes. + * + * Generated from protobuf enum IN = 1; + */ + const IN = 1; + /** + * Requires Compute Engine to avoid certain nodes. + * + * Generated from protobuf enum NOT_IN = 2; + */ + const NOT_IN = 2; + + private static $valueToName = [ + self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', + self::IN => 'IN', + self::NOT_IN => 'NOT_IN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Operator::class, \Google\Cloud\BackupDR\V1\Scheduling_NodeAffinity_Operator::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/OnHostMaintenance.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/OnHostMaintenance.php new file mode 100644 index 000000000000..32a98fdc8fc0 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/OnHostMaintenance.php @@ -0,0 +1,66 @@ +google.cloud.backupdr.v1.Scheduling.OnHostMaintenance + */ +class OnHostMaintenance +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ON_HOST_MAINTENANCE_UNSPECIFIED = 0; + */ + const ON_HOST_MAINTENANCE_UNSPECIFIED = 0; + /** + * Tells Compute Engine to terminate and (optionally) restart the instance + * away from the maintenance activity. + * + * Generated from protobuf enum TERMINATE = 1; + */ + const TERMINATE = 1; + /** + * Default, Allows Compute Engine to automatically migrate instances + * out of the way of maintenance events. + * + * Generated from protobuf enum MIGRATE = 1000; + */ + const MIGRATE = 1000; + + private static $valueToName = [ + self::ON_HOST_MAINTENANCE_UNSPECIFIED => 'ON_HOST_MAINTENANCE_UNSPECIFIED', + self::TERMINATE => 'TERMINATE', + self::MIGRATE => 'MIGRATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OnHostMaintenance::class, \Google\Cloud\BackupDR\V1\Scheduling_OnHostMaintenance::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/ProvisioningModel.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/ProvisioningModel.php new file mode 100644 index 000000000000..24e887699528 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/ProvisioningModel.php @@ -0,0 +1,64 @@ +google.cloud.backupdr.v1.Scheduling.ProvisioningModel + */ +class ProvisioningModel +{ + /** + * Default value. This value is not used. + * + * Generated from protobuf enum PROVISIONING_MODEL_UNSPECIFIED = 0; + */ + const PROVISIONING_MODEL_UNSPECIFIED = 0; + /** + * Standard provisioning with user controlled runtime, no discounts. + * + * Generated from protobuf enum STANDARD = 1; + */ + const STANDARD = 1; + /** + * Heavily discounted, no guaranteed runtime. + * + * Generated from protobuf enum SPOT = 2; + */ + const SPOT = 2; + + private static $valueToName = [ + self::PROVISIONING_MODEL_UNSPECIFIED => 'PROVISIONING_MODEL_UNSPECIFIED', + self::STANDARD => 'STANDARD', + self::SPOT => 'SPOT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProvisioningModel::class, \Google\Cloud\BackupDR\V1\Scheduling_ProvisioningModel::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/SchedulingDuration.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/SchedulingDuration.php new file mode 100644 index 000000000000..cc3c3abf8a1a --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/SchedulingDuration.php @@ -0,0 +1,128 @@ +google.cloud.backupdr.v1.SchedulingDuration + */ +class SchedulingDuration extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Span of time at a resolution of a second. + * + * Generated from protobuf field optional int64 seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $seconds = null; + /** + * Optional. Span of time that's a fraction of a second at nanosecond + * resolution. + * + * Generated from protobuf field optional int32 nanos = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $nanos = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $seconds + * Optional. Span of time at a resolution of a second. + * @type int $nanos + * Optional. Span of time that's a fraction of a second at nanosecond + * resolution. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Span of time at a resolution of a second. + * + * Generated from protobuf field optional int64 seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getSeconds() + { + return isset($this->seconds) ? $this->seconds : 0; + } + + public function hasSeconds() + { + return isset($this->seconds); + } + + public function clearSeconds() + { + unset($this->seconds); + } + + /** + * Optional. Span of time at a resolution of a second. + * + * Generated from protobuf field optional int64 seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setSeconds($var) + { + GPBUtil::checkInt64($var); + $this->seconds = $var; + + return $this; + } + + /** + * Optional. Span of time that's a fraction of a second at nanosecond + * resolution. + * + * Generated from protobuf field optional int32 nanos = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getNanos() + { + return isset($this->nanos) ? $this->nanos : 0; + } + + public function hasNanos() + { + return isset($this->nanos); + } + + public function clearNanos() + { + unset($this->nanos); + } + + /** + * Optional. Span of time that's a fraction of a second at nanosecond + * resolution. + * + * Generated from protobuf field optional int32 nanos = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setNanos($var) + { + GPBUtil::checkInt32($var); + $this->nanos = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ServiceAccount.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ServiceAccount.php new file mode 100644 index 000000000000..2555e69a2e1d --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ServiceAccount.php @@ -0,0 +1,111 @@ +google.cloud.backupdr.v1.ServiceAccount + */ +class ServiceAccount extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Email address of the service account. + * + * Generated from protobuf field optional string email = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $email = null; + /** + * Optional. The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $scopes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $email + * Optional. Email address of the service account. + * @type array|\Google\Protobuf\Internal\RepeatedField $scopes + * Optional. The list of scopes to be made available for this service account. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Email address of the service account. + * + * Generated from protobuf field optional string email = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEmail() + { + return isset($this->email) ? $this->email : ''; + } + + public function hasEmail() + { + return isset($this->email); + } + + public function clearEmail() + { + unset($this->email); + } + + /** + * Optional. Email address of the service account. + * + * Generated from protobuf field optional string email = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * Optional. The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * Optional. The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->scopes = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ServiceLockInfo.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ServiceLockInfo.php new file mode 100644 index 000000000000..1191b4e15201 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ServiceLockInfo.php @@ -0,0 +1,72 @@ +google.cloud.backupdr.v1.ServiceLockInfo + */ +class ServiceLockInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the operation that created this lock. + * The lock will automatically be released when the operation completes. + * + * Generated from protobuf field string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $operation = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Output only. The name of the operation that created this lock. + * The lock will automatically be released when the operation completes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the operation that created this lock. + * The lock will automatically be released when the operation completes. + * + * Generated from protobuf field string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Output only. The name of the operation that created this lock. + * The lock will automatically be released when the operation completes. + * + * Generated from protobuf field string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/StandardSchedule.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/StandardSchedule.php new file mode 100644 index 000000000000..a6936ec9b05d --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/StandardSchedule.php @@ -0,0 +1,447 @@ +google.cloud.backupdr.v1.StandardSchedule + */ +class StandardSchedule extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Specifies the `RecurrenceType` for the schedule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.StandardSchedule.RecurrenceType recurrence_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $recurrence_type = 0; + /** + * Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + * means jobs will run every 2 hours from start time till end time defined. + * This is required for `recurrence_type`, `HOURLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `HOURLY`. + * Value of hourly frequency should be between 6 and 23. + * Reason for limit : We found that there is bandwidth limitation of 3GB/S for + * GMI while taking a backup and 5GB/S while doing a restore. Given the amount + * of parallel backups and restore we are targeting, this will potentially + * take the backup time to mins and hours (in worst case scenario). + * + * Generated from protobuf field int32 hourly_frequency = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $hourly_frequency = 0; + /** + * Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + * will run. + * This is required for `recurrence_type`, `WEEKLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `WEEKLY`. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $days_of_week; + /** + * Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + * Values for `days_of_month` are only applicable for `recurrence_type`, + * `MONTHLY` and `YEARLY`. A validation error will occur if other values are + * supplied. + * + * Generated from protobuf field repeated int32 days_of_month = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $days_of_month; + /** + * Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + * MONDAY, on which jobs will run. This will be specified by two fields in + * `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + * e.g. `LAST`. + * This field is only applicable for `recurrence_type`, `MONTHLY` and + * `YEARLY`. A validation error will occur if other values are supplied. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth week_day_of_month = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $week_day_of_month = null; + /** + * Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + * which jobs will run. + * This field is only applicable when `recurrence_type` is `YEARLY`. A + * validation error will occur if other values are supplied. + * + * Generated from protobuf field repeated .google.type.Month months = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $months; + /** + * Required. A BackupWindow defines the window of day during which backup jobs + * will run. Jobs are queued at the beginning of the window and will be marked + * as `NOT_RUN` if they do not start by the end of the window. + * Note: running jobs will not be cancelled at the end of the window. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupWindow backup_window = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_window = null; + /** + * Required. The time zone to be used when interpreting the schedule. + * The value of this field must be a time zone name from the IANA tz database. + * See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + * list of valid timezone names. For e.g., Europe/Paris. + * + * Generated from protobuf field string time_zone = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $time_zone = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $recurrence_type + * Required. Specifies the `RecurrenceType` for the schedule. + * @type int $hourly_frequency + * Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + * means jobs will run every 2 hours from start time till end time defined. + * This is required for `recurrence_type`, `HOURLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `HOURLY`. + * Value of hourly frequency should be between 6 and 23. + * Reason for limit : We found that there is bandwidth limitation of 3GB/S for + * GMI while taking a backup and 5GB/S while doing a restore. Given the amount + * of parallel backups and restore we are targeting, this will potentially + * take the backup time to mins and hours (in worst case scenario). + * @type array|\Google\Protobuf\Internal\RepeatedField $days_of_week + * Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + * will run. + * This is required for `recurrence_type`, `WEEKLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `WEEKLY`. + * @type array|\Google\Protobuf\Internal\RepeatedField $days_of_month + * Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + * Values for `days_of_month` are only applicable for `recurrence_type`, + * `MONTHLY` and `YEARLY`. A validation error will occur if other values are + * supplied. + * @type \Google\Cloud\BackupDR\V1\WeekDayOfMonth $week_day_of_month + * Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + * MONDAY, on which jobs will run. This will be specified by two fields in + * `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + * e.g. `LAST`. + * This field is only applicable for `recurrence_type`, `MONTHLY` and + * `YEARLY`. A validation error will occur if other values are supplied. + * @type array|\Google\Protobuf\Internal\RepeatedField $months + * Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + * which jobs will run. + * This field is only applicable when `recurrence_type` is `YEARLY`. A + * validation error will occur if other values are supplied. + * @type \Google\Cloud\BackupDR\V1\BackupWindow $backup_window + * Required. A BackupWindow defines the window of day during which backup jobs + * will run. Jobs are queued at the beginning of the window and will be marked + * as `NOT_RUN` if they do not start by the end of the window. + * Note: running jobs will not be cancelled at the end of the window. + * @type string $time_zone + * Required. The time zone to be used when interpreting the schedule. + * The value of this field must be a time zone name from the IANA tz database. + * See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + * list of valid timezone names. For e.g., Europe/Paris. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. Specifies the `RecurrenceType` for the schedule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.StandardSchedule.RecurrenceType recurrence_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getRecurrenceType() + { + return $this->recurrence_type; + } + + /** + * Required. Specifies the `RecurrenceType` for the schedule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.StandardSchedule.RecurrenceType recurrence_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setRecurrenceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\StandardSchedule\RecurrenceType::class); + $this->recurrence_type = $var; + + return $this; + } + + /** + * Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + * means jobs will run every 2 hours from start time till end time defined. + * This is required for `recurrence_type`, `HOURLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `HOURLY`. + * Value of hourly frequency should be between 6 and 23. + * Reason for limit : We found that there is bandwidth limitation of 3GB/S for + * GMI while taking a backup and 5GB/S while doing a restore. Given the amount + * of parallel backups and restore we are targeting, this will potentially + * take the backup time to mins and hours (in worst case scenario). + * + * Generated from protobuf field int32 hourly_frequency = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getHourlyFrequency() + { + return $this->hourly_frequency; + } + + /** + * Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + * means jobs will run every 2 hours from start time till end time defined. + * This is required for `recurrence_type`, `HOURLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `HOURLY`. + * Value of hourly frequency should be between 6 and 23. + * Reason for limit : We found that there is bandwidth limitation of 3GB/S for + * GMI while taking a backup and 5GB/S while doing a restore. Given the amount + * of parallel backups and restore we are targeting, this will potentially + * take the backup time to mins and hours (in worst case scenario). + * + * Generated from protobuf field int32 hourly_frequency = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setHourlyFrequency($var) + { + GPBUtil::checkInt32($var); + $this->hourly_frequency = $var; + + return $this; + } + + /** + * Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + * will run. + * This is required for `recurrence_type`, `WEEKLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `WEEKLY`. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDaysOfWeek() + { + return $this->days_of_week; + } + + /** + * Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + * will run. + * This is required for `recurrence_type`, `WEEKLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `WEEKLY`. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDaysOfWeek($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); + $this->days_of_week = $arr; + + return $this; + } + + /** + * Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + * Values for `days_of_month` are only applicable for `recurrence_type`, + * `MONTHLY` and `YEARLY`. A validation error will occur if other values are + * supplied. + * + * Generated from protobuf field repeated int32 days_of_month = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDaysOfMonth() + { + return $this->days_of_month; + } + + /** + * Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + * Values for `days_of_month` are only applicable for `recurrence_type`, + * `MONTHLY` and `YEARLY`. A validation error will occur if other values are + * supplied. + * + * Generated from protobuf field repeated int32 days_of_month = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDaysOfMonth($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->days_of_month = $arr; + + return $this; + } + + /** + * Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + * MONDAY, on which jobs will run. This will be specified by two fields in + * `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + * e.g. `LAST`. + * This field is only applicable for `recurrence_type`, `MONTHLY` and + * `YEARLY`. A validation error will occur if other values are supplied. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth week_day_of_month = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\WeekDayOfMonth|null + */ + public function getWeekDayOfMonth() + { + return $this->week_day_of_month; + } + + public function hasWeekDayOfMonth() + { + return isset($this->week_day_of_month); + } + + public function clearWeekDayOfMonth() + { + unset($this->week_day_of_month); + } + + /** + * Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + * MONDAY, on which jobs will run. This will be specified by two fields in + * `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + * e.g. `LAST`. + * This field is only applicable for `recurrence_type`, `MONTHLY` and + * `YEARLY`. A validation error will occur if other values are supplied. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth week_day_of_month = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\WeekDayOfMonth $var + * @return $this + */ + public function setWeekDayOfMonth($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\WeekDayOfMonth::class); + $this->week_day_of_month = $var; + + return $this; + } + + /** + * Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + * which jobs will run. + * This field is only applicable when `recurrence_type` is `YEARLY`. A + * validation error will occur if other values are supplied. + * + * Generated from protobuf field repeated .google.type.Month months = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMonths() + { + return $this->months; + } + + /** + * Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + * which jobs will run. + * This field is only applicable when `recurrence_type` is `YEARLY`. A + * validation error will occur if other values are supplied. + * + * Generated from protobuf field repeated .google.type.Month months = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMonths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\Month::class); + $this->months = $arr; + + return $this; + } + + /** + * Required. A BackupWindow defines the window of day during which backup jobs + * will run. Jobs are queued at the beginning of the window and will be marked + * as `NOT_RUN` if they do not start by the end of the window. + * Note: running jobs will not be cancelled at the end of the window. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupWindow backup_window = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\BackupWindow|null + */ + public function getBackupWindow() + { + return $this->backup_window; + } + + public function hasBackupWindow() + { + return isset($this->backup_window); + } + + public function clearBackupWindow() + { + unset($this->backup_window); + } + + /** + * Required. A BackupWindow defines the window of day during which backup jobs + * will run. Jobs are queued at the beginning of the window and will be marked + * as `NOT_RUN` if they do not start by the end of the window. + * Note: running jobs will not be cancelled at the end of the window. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupWindow backup_window = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\BackupWindow $var + * @return $this + */ + public function setBackupWindow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupWindow::class); + $this->backup_window = $var; + + return $this; + } + + /** + * Required. The time zone to be used when interpreting the schedule. + * The value of this field must be a time zone name from the IANA tz database. + * See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + * list of valid timezone names. For e.g., Europe/Paris. + * + * Generated from protobuf field string time_zone = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * Required. The time zone to be used when interpreting the schedule. + * The value of this field must be a time zone name from the IANA tz database. + * See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + * list of valid timezone names. For e.g., Europe/Paris. + * + * Generated from protobuf field string time_zone = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/StandardSchedule/RecurrenceType.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/StandardSchedule/RecurrenceType.php new file mode 100644 index 000000000000..2c80f3b55a38 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/StandardSchedule/RecurrenceType.php @@ -0,0 +1,85 @@ +google.cloud.backupdr.v1.StandardSchedule.RecurrenceType + */ +class RecurrenceType +{ + /** + * recurrence type not set + * + * Generated from protobuf enum RECURRENCE_TYPE_UNSPECIFIED = 0; + */ + const RECURRENCE_TYPE_UNSPECIFIED = 0; + /** + * The `BackupRule` is to be applied hourly. + * + * Generated from protobuf enum HOURLY = 1; + */ + const HOURLY = 1; + /** + * The `BackupRule` is to be applied daily. + * + * Generated from protobuf enum DAILY = 2; + */ + const DAILY = 2; + /** + * The `BackupRule` is to be applied weekly. + * + * Generated from protobuf enum WEEKLY = 3; + */ + const WEEKLY = 3; + /** + * The `BackupRule` is to be applied monthly. + * + * Generated from protobuf enum MONTHLY = 4; + */ + const MONTHLY = 4; + /** + * The `BackupRule` is to be applied yearly. + * + * Generated from protobuf enum YEARLY = 5; + */ + const YEARLY = 5; + + private static $valueToName = [ + self::RECURRENCE_TYPE_UNSPECIFIED => 'RECURRENCE_TYPE_UNSPECIFIED', + self::HOURLY => 'HOURLY', + self::DAILY => 'DAILY', + self::WEEKLY => 'WEEKLY', + self::MONTHLY => 'MONTHLY', + self::YEARLY => 'YEARLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RecurrenceType::class, \Google\Cloud\BackupDR\V1\StandardSchedule_RecurrenceType::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Tags.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Tags.php new file mode 100644 index 000000000000..5c7e2cc19aff --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Tags.php @@ -0,0 +1,71 @@ +google.cloud.backupdr.v1.Tags + */ +class Tags extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. An array of tags. Each tag must be 1-63 characters long, and + * comply with RFC1035. + * + * Generated from protobuf field repeated string items = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $items + * Optional. An array of tags. Each tag must be 1-63 characters long, and + * comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. An array of tags. Each tag must be 1-63 characters long, and + * comply with RFC1035. + * + * Generated from protobuf field repeated string items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * Optional. An array of tags. Each tag must be 1-63 characters long, and + * comply with RFC1035. + * + * Generated from protobuf field repeated string items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->items = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/TargetResource.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/TargetResource.php new file mode 100644 index 000000000000..2b664c8ac0b2 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/TargetResource.php @@ -0,0 +1,75 @@ +google.cloud.backupdr.v1.TargetResource + */ +class TargetResource extends \Google\Protobuf\Internal\Message +{ + protected $target_resource_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BackupDR\V1\GcpResource $gcp_resource + * Details of the native Google Cloud resource created as part of restore. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Details of the native Google Cloud resource created as part of restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.GcpResource gcp_resource = 1; + * @return \Google\Cloud\BackupDR\V1\GcpResource|null + */ + public function getGcpResource() + { + return $this->readOneof(1); + } + + public function hasGcpResource() + { + return $this->hasOneof(1); + } + + /** + * Details of the native Google Cloud resource created as part of restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.GcpResource gcp_resource = 1; + * @param \Google\Cloud\BackupDR\V1\GcpResource $var + * @return $this + */ + public function setGcpResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\GcpResource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getTargetResourceInfo() + { + return $this->whichOneof("target_resource_info"); + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/TriggerBackupRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/TriggerBackupRequest.php new file mode 100644 index 000000000000..c83aa7eafd80 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/TriggerBackupRequest.php @@ -0,0 +1,196 @@ +google.cloud.backupdr.v1.TriggerBackupRequest + */ +class TriggerBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. backup rule_id for which a backup needs to be triggered. + * + * Generated from protobuf field string rule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rule_id = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * Please see {@see BackupDRClient::backupPlanAssociationName()} for help formatting this field. + * @param string $ruleId Required. backup rule_id for which a backup needs to be triggered. + * + * @return \Google\Cloud\BackupDR\V1\TriggerBackupRequest + * + * @experimental + */ + public static function build(string $name, string $ruleId): self + { + return (new self()) + ->setName($name) + ->setRuleId($ruleId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @type string $rule_id + * Required. backup rule_id for which a backup needs to be triggered. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. backup rule_id for which a backup needs to be triggered. + * + * Generated from protobuf field string rule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRuleId() + { + return $this->rule_id; + } + + /** + * Required. backup rule_id for which a backup needs to be triggered. + * + * Generated from protobuf field string rule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRuleId($var) + { + GPBUtil::checkString($var, True); + $this->rule_id = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateBackupRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateBackupRequest.php new file mode 100644 index 000000000000..45590b90791f --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateBackupRequest.php @@ -0,0 +1,230 @@ +google.cloud.backupdr.v1.UpdateBackupRequest + */ +class UpdateBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\BackupDR\V1\Backup $backup Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * @return \Google\Cloud\BackupDR\V1\UpdateBackupRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BackupDR\V1\Backup $backup, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setBackup($backup) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @type \Google\Cloud\BackupDR\V1\Backup $backup + * Required. The resource being updated + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\Backup|null + */ + public function getBackup() + { + return $this->backup; + } + + public function hasBackup() + { + return isset($this->backup); + } + + public function clearBackup() + { + unset($this->backup); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\Backup $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Backup::class); + $this->backup = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateBackupVaultRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateBackupVaultRequest.php new file mode 100644 index 000000000000..4a985422b43f --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateBackupVaultRequest.php @@ -0,0 +1,306 @@ +google.cloud.backupdr.v1.UpdateBackupVaultRequest + */ +class UpdateBackupVaultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_vault = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * @param \Google\Cloud\BackupDR\V1\BackupVault $backupVault Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * @return \Google\Cloud\BackupDR\V1\UpdateBackupVaultRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BackupDR\V1\BackupVault $backupVault, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setBackupVault($backupVault) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @type \Google\Cloud\BackupDR\V1\BackupVault $backup_vault + * Required. The resource being updated + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @type bool $force + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\BackupVault|null + */ + public function getBackupVault() + { + return $this->backup_vault; + } + + public function hasBackupVault() + { + return isset($this->backup_vault); + } + + public function clearBackupVault() + { + unset($this->backup_vault); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\BackupVault $var + * @return $this + */ + public function setBackupVault($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupVault::class); + $this->backup_vault = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateDataSourceRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateDataSourceRequest.php new file mode 100644 index 000000000000..86e234620cef --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateDataSourceRequest.php @@ -0,0 +1,264 @@ +google.cloud.backupdr.v1.UpdateDataSourceRequest + */ +class UpdateDataSourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_source = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. Enable upsert. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\BackupDR\V1\DataSource $dataSource Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * @return \Google\Cloud\BackupDR\V1\UpdateDataSourceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BackupDR\V1\DataSource $dataSource, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDataSource($dataSource) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @type \Google\Cloud\BackupDR\V1\DataSource $data_source + * Required. The resource being updated + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allow_missing + * Optional. Enable upsert. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\DataSource|null + */ + public function getDataSource() + { + return $this->data_source; + } + + public function hasDataSource() + { + return isset($this->data_source); + } + + public function clearDataSource() + { + unset($this->data_source); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\DataSource $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\DataSource::class); + $this->data_source = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. Enable upsert. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. Enable upsert. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WeekDayOfMonth.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WeekDayOfMonth.php new file mode 100644 index 000000000000..31a37263235e --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WeekDayOfMonth.php @@ -0,0 +1,103 @@ +google.cloud.backupdr.v1.WeekDayOfMonth + */ +class WeekDayOfMonth extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Specifies the week of the month. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth week_of_month = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $week_of_month = 0; + /** + * Required. Specifies the day of the week. + * + * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $day_of_week = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $week_of_month + * Required. Specifies the week of the month. + * @type int $day_of_week + * Required. Specifies the day of the week. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. Specifies the week of the month. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth week_of_month = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getWeekOfMonth() + { + return $this->week_of_month; + } + + /** + * Required. Specifies the week of the month. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth week_of_month = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setWeekOfMonth($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\WeekDayOfMonth\WeekOfMonth::class); + $this->week_of_month = $var; + + return $this; + } + + /** + * Required. Specifies the day of the week. + * + * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDayOfWeek() + { + return $this->day_of_week; + } + + /** + * Required. Specifies the day of the week. + * + * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDayOfWeek($var) + { + GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); + $this->day_of_week = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WeekDayOfMonth/WeekOfMonth.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WeekDayOfMonth/WeekOfMonth.php new file mode 100644 index 000000000000..e0affc57f6a4 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WeekDayOfMonth/WeekOfMonth.php @@ -0,0 +1,86 @@ +google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth + */ +class WeekOfMonth +{ + /** + * The zero value. Do not use. + * + * Generated from protobuf enum WEEK_OF_MONTH_UNSPECIFIED = 0; + */ + const WEEK_OF_MONTH_UNSPECIFIED = 0; + /** + * The first week of the month. + * + * Generated from protobuf enum FIRST = 1; + */ + const FIRST = 1; + /** + * The second week of the month. + * + * Generated from protobuf enum SECOND = 2; + */ + const SECOND = 2; + /** + * The third week of the month. + * + * Generated from protobuf enum THIRD = 3; + */ + const THIRD = 3; + /** + * The fourth week of the month. + * + * Generated from protobuf enum FOURTH = 4; + */ + const FOURTH = 4; + /** + * The last week of the month. + * + * Generated from protobuf enum LAST = 5; + */ + const LAST = 5; + + private static $valueToName = [ + self::WEEK_OF_MONTH_UNSPECIFIED => 'WEEK_OF_MONTH_UNSPECIFIED', + self::FIRST => 'FIRST', + self::SECOND => 'SECOND', + self::THIRD => 'THIRD', + self::FOURTH => 'FOURTH', + self::LAST => 'LAST', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(WeekOfMonth::class, \Google\Cloud\BackupDR\V1\WeekDayOfMonth_WeekOfMonth::class); + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedManagementURI.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedManagementURI.php new file mode 100644 index 000000000000..d12b8eb71a64 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedManagementURI.php @@ -0,0 +1,101 @@ +google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + */ +class WorkforceIdentityBasedManagementURI extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. First party Management URI for Google Identities. + * + * Generated from protobuf field string first_party_management_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $first_party_management_uri = ''; + /** + * Output only. Third party Management URI for External Identity Providers. + * + * Generated from protobuf field string third_party_management_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $third_party_management_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $first_party_management_uri + * Output only. First party Management URI for Google Identities. + * @type string $third_party_management_uri + * Output only. Third party Management URI for External Identity Providers. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Output only. First party Management URI for Google Identities. + * + * Generated from protobuf field string first_party_management_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getFirstPartyManagementUri() + { + return $this->first_party_management_uri; + } + + /** + * Output only. First party Management URI for Google Identities. + * + * Generated from protobuf field string first_party_management_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setFirstPartyManagementUri($var) + { + GPBUtil::checkString($var, True); + $this->first_party_management_uri = $var; + + return $this; + } + + /** + * Output only. Third party Management URI for External Identity Providers. + * + * Generated from protobuf field string third_party_management_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getThirdPartyManagementUri() + { + return $this->third_party_management_uri; + } + + /** + * Output only. Third party Management URI for External Identity Providers. + * + * Generated from protobuf field string third_party_management_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setThirdPartyManagementUri($var) + { + GPBUtil::checkString($var, True); + $this->third_party_management_uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedOAuth2ClientID.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedOAuth2ClientID.php new file mode 100644 index 000000000000..dd38518e5411 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedOAuth2ClientID.php @@ -0,0 +1,101 @@ +google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + */ +class WorkforceIdentityBasedOAuth2ClientID extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. First party OAuth Client ID for Google Identities. + * + * Generated from protobuf field string first_party_oauth2_client_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $first_party_oauth2_client_id = ''; + /** + * Output only. Third party OAuth Client ID for External Identity Providers. + * + * Generated from protobuf field string third_party_oauth2_client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $third_party_oauth2_client_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $first_party_oauth2_client_id + * Output only. First party OAuth Client ID for Google Identities. + * @type string $third_party_oauth2_client_id + * Output only. Third party OAuth Client ID for External Identity Providers. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Output only. First party OAuth Client ID for Google Identities. + * + * Generated from protobuf field string first_party_oauth2_client_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getFirstPartyOauth2ClientId() + { + return $this->first_party_oauth2_client_id; + } + + /** + * Output only. First party OAuth Client ID for Google Identities. + * + * Generated from protobuf field string first_party_oauth2_client_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setFirstPartyOauth2ClientId($var) + { + GPBUtil::checkString($var, True); + $this->first_party_oauth2_client_id = $var; + + return $this; + } + + /** + * Output only. Third party OAuth Client ID for External Identity Providers. + * + * Generated from protobuf field string third_party_oauth2_client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getThirdPartyOauth2ClientId() + { + return $this->third_party_oauth2_client_id; + } + + /** + * Output only. Third party OAuth Client ID for External Identity Providers. + * + * Generated from protobuf field string third_party_oauth2_client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setThirdPartyOauth2ClientId($var) + { + GPBUtil::checkString($var, True); + $this->third_party_oauth2_client_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_backup_plan.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_backup_plan.php new file mode 100644 index 000000000000..ee29ae4ff1c5 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_backup_plan.php @@ -0,0 +1,174 @@ +setStartHourOfDay($backupPlanBackupRulesStandardScheduleBackupWindowStartHourOfDay) + ->setEndHourOfDay($backupPlanBackupRulesStandardScheduleBackupWindowEndHourOfDay); + $backupPlanBackupRulesStandardSchedule = (new StandardSchedule()) + ->setRecurrenceType($backupPlanBackupRulesStandardScheduleRecurrenceType) + ->setBackupWindow($backupPlanBackupRulesStandardScheduleBackupWindow) + ->setTimeZone($backupPlanBackupRulesStandardScheduleTimeZone); + $backupRule = (new BackupRule()) + ->setRuleId($backupPlanBackupRulesRuleId) + ->setBackupRetentionDays($backupPlanBackupRulesBackupRetentionDays) + ->setStandardSchedule($backupPlanBackupRulesStandardSchedule); + $backupPlanBackupRules = [$backupRule,]; + $backupPlan = (new BackupPlan()) + ->setBackupRules($backupPlanBackupRules) + ->setResourceType($backupPlanResourceType) + ->setBackupVault($formattedBackupPlanBackupVault); + $request = (new CreateBackupPlanRequest()) + ->setParent($formattedParent) + ->setBackupPlanId($backupPlanId) + ->setBackupPlan($backupPlan); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->createBackupPlan($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BackupPlan $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + $backupPlanId = '[BACKUP_PLAN_ID]'; + $backupPlanBackupRulesRuleId = '[RULE_ID]'; + $backupPlanBackupRulesBackupRetentionDays = 0; + $backupPlanBackupRulesStandardScheduleRecurrenceType = RecurrenceType::RECURRENCE_TYPE_UNSPECIFIED; + $backupPlanBackupRulesStandardScheduleBackupWindowStartHourOfDay = 0; + $backupPlanBackupRulesStandardScheduleBackupWindowEndHourOfDay = 0; + $backupPlanBackupRulesStandardScheduleTimeZone = '[TIME_ZONE]'; + $backupPlanResourceType = '[RESOURCE_TYPE]'; + $formattedBackupPlanBackupVault = BackupDRClient::backupVaultName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]' + ); + + create_backup_plan_sample( + $formattedParent, + $backupPlanId, + $backupPlanBackupRulesRuleId, + $backupPlanBackupRulesBackupRetentionDays, + $backupPlanBackupRulesStandardScheduleRecurrenceType, + $backupPlanBackupRulesStandardScheduleBackupWindowStartHourOfDay, + $backupPlanBackupRulesStandardScheduleBackupWindowEndHourOfDay, + $backupPlanBackupRulesStandardScheduleTimeZone, + $backupPlanResourceType, + $formattedBackupPlanBackupVault + ); +} +// [END backupdr_v1_generated_BackupDR_CreateBackupPlan_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_backup_plan_association.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_backup_plan_association.php new file mode 100644 index 000000000000..16cba9b49c8c --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_backup_plan_association.php @@ -0,0 +1,114 @@ +setResource($backupPlanAssociationResource) + ->setBackupPlan($formattedBackupPlanAssociationBackupPlan); + $request = (new CreateBackupPlanAssociationRequest()) + ->setParent($formattedParent) + ->setBackupPlanAssociationId($backupPlanAssociationId) + ->setBackupPlanAssociation($backupPlanAssociation); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->createBackupPlanAssociation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BackupPlanAssociation $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + $backupPlanAssociationId = '[BACKUP_PLAN_ASSOCIATION_ID]'; + $backupPlanAssociationResource = '[RESOURCE]'; + $formattedBackupPlanAssociationBackupPlan = BackupDRClient::backupPlanName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN]' + ); + + create_backup_plan_association_sample( + $formattedParent, + $backupPlanAssociationId, + $backupPlanAssociationResource, + $formattedBackupPlanAssociationBackupPlan + ); +} +// [END backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_backup_vault.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_backup_vault.php new file mode 100644 index 000000000000..0eb8a39cdfc9 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_backup_vault.php @@ -0,0 +1,93 @@ +setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new CreateBackupVaultRequest()) + ->setParent($formattedParent) + ->setBackupVaultId($backupVaultId) + ->setBackupVault($backupVault); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->createBackupVault($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BackupVault $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + $backupVaultId = '[BACKUP_VAULT_ID]'; + + create_backup_vault_sample($formattedParent, $backupVaultId); +} +// [END backupdr_v1_generated_BackupDR_CreateBackupVault_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_management_server.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_management_server.php new file mode 100644 index 000000000000..c453145930c7 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_management_server.php @@ -0,0 +1,96 @@ +setNetworks($managementServerNetworks); + $request = (new CreateManagementServerRequest()) + ->setParent($formattedParent) + ->setManagementServerId($managementServerId) + ->setManagementServer($managementServer); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->createManagementServer($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ManagementServer $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + $managementServerId = '[MANAGEMENT_SERVER_ID]'; + + create_management_server_sample($formattedParent, $managementServerId); +} +// [END backupdr_v1_generated_BackupDR_CreateManagementServer_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup.php new file mode 100644 index 000000000000..e57d2bbfa7fe --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup.php @@ -0,0 +1,89 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->deleteBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + + delete_backup_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_DeleteBackup_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup_plan.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup_plan.php new file mode 100644 index 000000000000..ceefc320aa66 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup_plan.php @@ -0,0 +1,82 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->deleteBackupPlan($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + + delete_backup_plan_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_DeleteBackupPlan_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup_plan_association.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup_plan_association.php new file mode 100644 index 000000000000..8ebdabee84f5 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup_plan_association.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->deleteBackupPlanAssociation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + + delete_backup_plan_association_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup_vault.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup_vault.php new file mode 100644 index 000000000000..d1035e0287a1 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_backup_vault.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->deleteBackupVault($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + + delete_backup_vault_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_DeleteBackupVault_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_management_server.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_management_server.php new file mode 100644 index 000000000000..600741c46b66 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_management_server.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->deleteManagementServer($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::managementServerName( + '[PROJECT]', + '[LOCATION]', + '[MANAGEMENTSERVER]' + ); + + delete_management_server_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_DeleteManagementServer_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/fetch_usable_backup_vaults.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/fetch_usable_backup_vaults.php new file mode 100644 index 000000000000..ca3baa61001d --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/fetch_usable_backup_vaults.php @@ -0,0 +1,83 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->fetchUsableBackupVaults($request); + + /** @var BackupVault $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + + fetch_usable_backup_vaults_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup.php new file mode 100644 index 000000000000..d022b8e9926a --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Backup $response */ + $response = $backupDRClient->getBackup($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + + get_backup_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetBackup_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup_plan.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup_plan.php new file mode 100644 index 000000000000..bafab40279bf --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup_plan.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var BackupPlan $response */ + $response = $backupDRClient->getBackupPlan($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + + get_backup_plan_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetBackupPlan_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup_plan_association.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup_plan_association.php new file mode 100644 index 000000000000..9eec0a558560 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup_plan_association.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var BackupPlanAssociation $response */ + $response = $backupDRClient->getBackupPlanAssociation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + + get_backup_plan_association_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup_vault.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup_vault.php new file mode 100644 index 000000000000..7eda9342994a --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_backup_vault.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var BackupVault $response */ + $response = $backupDRClient->getBackupVault($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + + get_backup_vault_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetBackupVault_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_data_source.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_data_source.php new file mode 100644 index 000000000000..53f3211d7c1a --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_data_source.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DataSource $response */ + $response = $backupDRClient->getDataSource($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::dataSourceName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]' + ); + + get_data_source_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetDataSource_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_iam_policy.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_iam_policy.php new file mode 100644 index 000000000000..051e2e471612 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $backupDRClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END backupdr_v1_generated_BackupDR_GetIamPolicy_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_location.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_location.php new file mode 100644 index 000000000000..6e6c3ede82e1 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END backupdr_v1_generated_BackupDR_GetLocation_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_management_server.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_management_server.php new file mode 100644 index 000000000000..f7fa6231f8c0 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_management_server.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ManagementServer $response */ + $response = $backupDRClient->getManagementServer($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::managementServerName( + '[PROJECT]', + '[LOCATION]', + '[MANAGEMENTSERVER]' + ); + + get_management_server_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetManagementServer_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backup_plan_associations.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backup_plan_associations.php new file mode 100644 index 000000000000..8f286295c44b --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backup_plan_associations.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listBackupPlanAssociations($request); + + /** @var BackupPlanAssociation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + + list_backup_plan_associations_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backup_plans.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backup_plans.php new file mode 100644 index 000000000000..7e5f8ceee6a8 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backup_plans.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listBackupPlans($request); + + /** @var BackupPlan $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + + list_backup_plans_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListBackupPlans_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backup_vaults.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backup_vaults.php new file mode 100644 index 000000000000..3ebc85f7ddef --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backup_vaults.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listBackupVaults($request); + + /** @var BackupVault $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + + list_backup_vaults_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListBackupVaults_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backups.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backups.php new file mode 100644 index 000000000000..def0a0a36513 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_backups.php @@ -0,0 +1,86 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listBackups($request); + + /** @var Backup $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BackupDRClient::dataSourceName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]' + ); + + list_backups_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListBackups_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_data_sources.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_data_sources.php new file mode 100644 index 000000000000..833e650fed27 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_data_sources.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listDataSources($request); + + /** @var DataSource $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BackupDRClient::backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + + list_data_sources_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListDataSources_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_locations.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_locations.php new file mode 100644 index 000000000000..baacf567a7fa --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END backupdr_v1_generated_BackupDR_ListLocations_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_management_servers.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_management_servers.php new file mode 100644 index 000000000000..c1a2219808e9 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_management_servers.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listManagementServers($request); + + /** @var ManagementServer $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + + list_management_servers_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListManagementServers_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/restore_backup.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/restore_backup.php new file mode 100644 index 000000000000..6a6199b2a611 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/restore_backup.php @@ -0,0 +1,90 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->restoreBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RestoreBackupResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + + restore_backup_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_RestoreBackup_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/set_iam_policy.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/set_iam_policy.php new file mode 100644 index 000000000000..5de0fc44b7fb --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $backupDRClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END backupdr_v1_generated_BackupDR_SetIamPolicy_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/test_iam_permissions.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/test_iam_permissions.php new file mode 100644 index 000000000000..e9e41bb418a7 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $backupDRClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END backupdr_v1_generated_BackupDR_TestIamPermissions_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/trigger_backup.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/trigger_backup.php new file mode 100644 index 000000000000..e5d82046cf0e --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/trigger_backup.php @@ -0,0 +1,91 @@ +setName($formattedName) + ->setRuleId($ruleId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->triggerBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BackupPlanAssociation $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BackupDRClient::backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $ruleId = '[RULE_ID]'; + + trigger_backup_sample($formattedName, $ruleId); +} +// [END backupdr_v1_generated_BackupDR_TriggerBackup_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/update_backup.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/update_backup.php new file mode 100644 index 000000000000..0986bd437465 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/update_backup.php @@ -0,0 +1,74 @@ +setUpdateMask($updateMask) + ->setBackup($backup); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->updateBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END backupdr_v1_generated_BackupDR_UpdateBackup_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/update_backup_vault.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/update_backup_vault.php new file mode 100644 index 000000000000..6cc6d590003a --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/update_backup_vault.php @@ -0,0 +1,77 @@ +setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new UpdateBackupVaultRequest()) + ->setUpdateMask($updateMask) + ->setBackupVault($backupVault); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->updateBackupVault($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BackupVault $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END backupdr_v1_generated_BackupDR_UpdateBackupVault_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/update_data_source.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/update_data_source.php new file mode 100644 index 000000000000..e62566e4e330 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/update_data_source.php @@ -0,0 +1,74 @@ +setUpdateMask($updateMask) + ->setDataSource($dataSource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->updateDataSource($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var DataSource $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END backupdr_v1_generated_BackupDR_UpdateDataSource_sync] diff --git a/owl-bot-staging/BackupDr/v1/src/V1/Client/BackupDRClient.php b/owl-bot-staging/BackupDr/v1/src/V1/Client/BackupDRClient.php new file mode 100644 index 000000000000..cbcb9b79662e --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/src/V1/Client/BackupDRClient.php @@ -0,0 +1,1311 @@ + createBackupPlanAsync(CreateBackupPlanRequest $request, array $optionalArgs = []) + * @method PromiseInterface createBackupPlanAssociationAsync(CreateBackupPlanAssociationRequest $request, array $optionalArgs = []) + * @method PromiseInterface createBackupVaultAsync(CreateBackupVaultRequest $request, array $optionalArgs = []) + * @method PromiseInterface createManagementServerAsync(CreateManagementServerRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteBackupAsync(DeleteBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteBackupPlanAsync(DeleteBackupPlanRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteBackupPlanAssociationAsync(DeleteBackupPlanAssociationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteBackupVaultAsync(DeleteBackupVaultRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteManagementServerAsync(DeleteManagementServerRequest $request, array $optionalArgs = []) + * @method PromiseInterface fetchUsableBackupVaultsAsync(FetchUsableBackupVaultsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getBackupAsync(GetBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getBackupPlanAsync(GetBackupPlanRequest $request, array $optionalArgs = []) + * @method PromiseInterface getBackupPlanAssociationAsync(GetBackupPlanAssociationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getBackupVaultAsync(GetBackupVaultRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDataSourceAsync(GetDataSourceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getManagementServerAsync(GetManagementServerRequest $request, array $optionalArgs = []) + * @method PromiseInterface listBackupPlanAssociationsAsync(ListBackupPlanAssociationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listBackupPlansAsync(ListBackupPlansRequest $request, array $optionalArgs = []) + * @method PromiseInterface listBackupVaultsAsync(ListBackupVaultsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listBackupsAsync(ListBackupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDataSourcesAsync(ListDataSourcesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listManagementServersAsync(ListManagementServersRequest $request, array $optionalArgs = []) + * @method PromiseInterface restoreBackupAsync(RestoreBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface triggerBackupAsync(TriggerBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateBackupAsync(UpdateBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateBackupVaultAsync(UpdateBackupVaultRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDataSourceAsync(UpdateDataSourceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class BackupDRClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.backupdr.v1.BackupDR'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'backupdr.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'backupdr.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/backup_dr_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/backup_dr_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/backup_dr_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/backup_dr_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a backup + * resource. + * + * @param string $project + * @param string $location + * @param string $backupvault + * @param string $datasource + * @param string $backup + * + * @return string The formatted backup resource. + */ + public static function backupName(string $project, string $location, string $backupvault, string $datasource, string $backup): string + { + return self::getPathTemplate('backup')->render([ + 'project' => $project, + 'location' => $location, + 'backupvault' => $backupvault, + 'datasource' => $datasource, + 'backup' => $backup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a backup_plan + * resource. + * + * @param string $project + * @param string $location + * @param string $backupPlan + * + * @return string The formatted backup_plan resource. + */ + public static function backupPlanName(string $project, string $location, string $backupPlan): string + { + return self::getPathTemplate('backupPlan')->render([ + 'project' => $project, + 'location' => $location, + 'backup_plan' => $backupPlan, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * backup_plan_association resource. + * + * @param string $project + * @param string $location + * @param string $backupPlanAssociation + * + * @return string The formatted backup_plan_association resource. + */ + public static function backupPlanAssociationName(string $project, string $location, string $backupPlanAssociation): string + { + return self::getPathTemplate('backupPlanAssociation')->render([ + 'project' => $project, + 'location' => $location, + 'backup_plan_association' => $backupPlanAssociation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a backup_vault + * resource. + * + * @param string $project + * @param string $location + * @param string $backupvault + * + * @return string The formatted backup_vault resource. + */ + public static function backupVaultName(string $project, string $location, string $backupvault): string + { + return self::getPathTemplate('backupVault')->render([ + 'project' => $project, + 'location' => $location, + 'backupvault' => $backupvault, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a data_source + * resource. + * + * @param string $project + * @param string $location + * @param string $backupvault + * @param string $datasource + * + * @return string The formatted data_source resource. + */ + public static function dataSourceName(string $project, string $location, string $backupvault, string $datasource): string + { + return self::getPathTemplate('dataSource')->render([ + 'project' => $project, + 'location' => $location, + 'backupvault' => $backupvault, + 'datasource' => $datasource, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * management_server resource. + * + * @param string $project + * @param string $location + * @param string $managementserver + * + * @return string The formatted management_server resource. + */ + public static function managementServerName(string $project, string $location, string $managementserver): string + { + return self::getPathTemplate('managementServer')->render([ + 'project' => $project, + 'location' => $location, + 'managementserver' => $managementserver, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - backup: projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup} + * - backupPlan: projects/{project}/locations/{location}/backupPlans/{backup_plan} + * - backupPlanAssociation: projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association} + * - backupVault: projects/{project}/locations/{location}/backupVaults/{backupvault} + * - dataSource: projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + * - location: projects/{project}/locations/{location} + * - managementServer: projects/{project}/locations/{location}/managementServers/{managementserver} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'backupdr.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Create a BackupPlan + * + * The async variant is {@see BackupDRClient::createBackupPlanAsync()} . + * + * @example samples/V1/BackupDRClient/create_backup_plan.php + * + * @param CreateBackupPlanRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBackupPlan(CreateBackupPlanRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateBackupPlan', $request, $callOptions)->wait(); + } + + /** + * Create a BackupPlanAssociation + * + * The async variant is {@see BackupDRClient::createBackupPlanAssociationAsync()} . + * + * @example samples/V1/BackupDRClient/create_backup_plan_association.php + * + * @param CreateBackupPlanAssociationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBackupPlanAssociation(CreateBackupPlanAssociationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateBackupPlanAssociation', $request, $callOptions)->wait(); + } + + /** + * Creates a new BackupVault in a given project and location. + * + * The async variant is {@see BackupDRClient::createBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/create_backup_vault.php + * + * @param CreateBackupVaultRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBackupVault(CreateBackupVaultRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateBackupVault', $request, $callOptions)->wait(); + } + + /** + * Creates a new ManagementServer in a given project and location. + * + * The async variant is {@see BackupDRClient::createManagementServerAsync()} . + * + * @example samples/V1/BackupDRClient/create_management_server.php + * + * @param CreateManagementServerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createManagementServer(CreateManagementServerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateManagementServer', $request, $callOptions)->wait(); + } + + /** + * Deletes a Backup. + * + * The async variant is {@see BackupDRClient::deleteBackupAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup.php + * + * @param DeleteBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackup(DeleteBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteBackup', $request, $callOptions)->wait(); + } + + /** + * Deletes a single BackupPlan. + * + * The async variant is {@see BackupDRClient::deleteBackupPlanAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup_plan.php + * + * @param DeleteBackupPlanRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackupPlan(DeleteBackupPlanRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteBackupPlan', $request, $callOptions)->wait(); + } + + /** + * Deletes a single BackupPlanAssociation. + * + * The async variant is {@see BackupDRClient::deleteBackupPlanAssociationAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup_plan_association.php + * + * @param DeleteBackupPlanAssociationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackupPlanAssociation(DeleteBackupPlanAssociationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteBackupPlanAssociation', $request, $callOptions)->wait(); + } + + /** + * Deletes a BackupVault. + * + * The async variant is {@see BackupDRClient::deleteBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup_vault.php + * + * @param DeleteBackupVaultRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackupVault(DeleteBackupVaultRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteBackupVault', $request, $callOptions)->wait(); + } + + /** + * Deletes a single ManagementServer. + * + * The async variant is {@see BackupDRClient::deleteManagementServerAsync()} . + * + * @example samples/V1/BackupDRClient/delete_management_server.php + * + * @param DeleteManagementServerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteManagementServer(DeleteManagementServerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteManagementServer', $request, $callOptions)->wait(); + } + + /** + * FetchUsableBackupVaults lists usable BackupVaults in a given project and + * location. Usable BackupVault are the ones that user has + * backupdr.backupVaults.get permission. + * + * The async variant is {@see BackupDRClient::fetchUsableBackupVaultsAsync()} . + * + * @example samples/V1/BackupDRClient/fetch_usable_backup_vaults.php + * + * @param FetchUsableBackupVaultsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchUsableBackupVaults(FetchUsableBackupVaultsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('FetchUsableBackupVaults', $request, $callOptions); + } + + /** + * Gets details of a Backup. + * + * The async variant is {@see BackupDRClient::getBackupAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup.php + * + * @param GetBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Backup + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackup(GetBackupRequest $request, array $callOptions = []): Backup + { + return $this->startApiCall('GetBackup', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single BackupPlan. + * + * The async variant is {@see BackupDRClient::getBackupPlanAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup_plan.php + * + * @param GetBackupPlanRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BackupPlan + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackupPlan(GetBackupPlanRequest $request, array $callOptions = []): BackupPlan + { + return $this->startApiCall('GetBackupPlan', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single BackupPlanAssociation. + * + * The async variant is {@see BackupDRClient::getBackupPlanAssociationAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup_plan_association.php + * + * @param GetBackupPlanAssociationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BackupPlanAssociation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackupPlanAssociation(GetBackupPlanAssociationRequest $request, array $callOptions = []): BackupPlanAssociation + { + return $this->startApiCall('GetBackupPlanAssociation', $request, $callOptions)->wait(); + } + + /** + * Gets details of a BackupVault. + * + * The async variant is {@see BackupDRClient::getBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup_vault.php + * + * @param GetBackupVaultRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BackupVault + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackupVault(GetBackupVaultRequest $request, array $callOptions = []): BackupVault + { + return $this->startApiCall('GetBackupVault', $request, $callOptions)->wait(); + } + + /** + * Gets details of a DataSource. + * + * The async variant is {@see BackupDRClient::getDataSourceAsync()} . + * + * @example samples/V1/BackupDRClient/get_data_source.php + * + * @param GetDataSourceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataSource + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDataSource(GetDataSourceRequest $request, array $callOptions = []): DataSource + { + return $this->startApiCall('GetDataSource', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single ManagementServer. + * + * The async variant is {@see BackupDRClient::getManagementServerAsync()} . + * + * @example samples/V1/BackupDRClient/get_management_server.php + * + * @param GetManagementServerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ManagementServer + * + * @throws ApiException Thrown if the API call fails. + */ + public function getManagementServer(GetManagementServerRequest $request, array $callOptions = []): ManagementServer + { + return $this->startApiCall('GetManagementServer', $request, $callOptions)->wait(); + } + + /** + * Lists BackupPlanAssociations in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupPlanAssociationsAsync()} . + * + * @example samples/V1/BackupDRClient/list_backup_plan_associations.php + * + * @param ListBackupPlanAssociationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackupPlanAssociations(ListBackupPlanAssociationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBackupPlanAssociations', $request, $callOptions); + } + + /** + * Lists BackupPlans in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupPlansAsync()} . + * + * @example samples/V1/BackupDRClient/list_backup_plans.php + * + * @param ListBackupPlansRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackupPlans(ListBackupPlansRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBackupPlans', $request, $callOptions); + } + + /** + * Lists BackupVaults in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupVaultsAsync()} . + * + * @example samples/V1/BackupDRClient/list_backup_vaults.php + * + * @param ListBackupVaultsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackupVaults(ListBackupVaultsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBackupVaults', $request, $callOptions); + } + + /** + * Lists Backups in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupsAsync()} . + * + * @example samples/V1/BackupDRClient/list_backups.php + * + * @param ListBackupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackups(ListBackupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBackups', $request, $callOptions); + } + + /** + * Lists DataSources in a given project and location. + * + * The async variant is {@see BackupDRClient::listDataSourcesAsync()} . + * + * @example samples/V1/BackupDRClient/list_data_sources.php + * + * @param ListDataSourcesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDataSources(ListDataSourcesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDataSources', $request, $callOptions); + } + + /** + * Lists ManagementServers in a given project and location. + * + * The async variant is {@see BackupDRClient::listManagementServersAsync()} . + * + * @example samples/V1/BackupDRClient/list_management_servers.php + * + * @param ListManagementServersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listManagementServers(ListManagementServersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListManagementServers', $request, $callOptions); + } + + /** + * Restore from a Backup + * + * The async variant is {@see BackupDRClient::restoreBackupAsync()} . + * + * @example samples/V1/BackupDRClient/restore_backup.php + * + * @param RestoreBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function restoreBackup(RestoreBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RestoreBackup', $request, $callOptions)->wait(); + } + + /** + * Triggers a new Backup. + * + * The async variant is {@see BackupDRClient::triggerBackupAsync()} . + * + * @example samples/V1/BackupDRClient/trigger_backup.php + * + * @param TriggerBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function triggerBackup(TriggerBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('TriggerBackup', $request, $callOptions)->wait(); + } + + /** + * Updates the settings of a Backup. + * + * The async variant is {@see BackupDRClient::updateBackupAsync()} . + * + * @example samples/V1/BackupDRClient/update_backup.php + * + * @param UpdateBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateBackup(UpdateBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateBackup', $request, $callOptions)->wait(); + } + + /** + * Updates the settings of a BackupVault. + * + * The async variant is {@see BackupDRClient::updateBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/update_backup_vault.php + * + * @param UpdateBackupVaultRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateBackupVault(UpdateBackupVaultRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateBackupVault', $request, $callOptions)->wait(); + } + + /** + * Updates the settings of a DataSource. + * + * The async variant is {@see BackupDRClient::updateDataSourceAsync()} . + * + * @example samples/V1/BackupDRClient/update_data_source.php + * + * @param UpdateDataSourceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDataSource(UpdateDataSourceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateDataSource', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see BackupDRClient::getLocationAsync()} . + * + * @example samples/V1/BackupDRClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see BackupDRClient::listLocationsAsync()} . + * + * @example samples/V1/BackupDRClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see BackupDRClient::getIamPolicyAsync()} . + * + * @example samples/V1/BackupDRClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see BackupDRClient::setIamPolicyAsync()} . + * + * @example samples/V1/BackupDRClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is {@see BackupDRClient::testIamPermissionsAsync()} . + * + * @example samples/V1/BackupDRClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BackupDr/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BackupDr/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..130c7f38a667 --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/src/V1/gapic_metadata.json @@ -0,0 +1,178 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.backupdr.v1", + "libraryPackage": "Google\\Cloud\\BackupDR\\V1", + "services": { + "BackupDR": { + "clients": { + "grpc": { + "libraryClient": "BackupDRGapicClient", + "rpcs": { + "CreateBackupPlan": { + "methods": [ + "createBackupPlan" + ] + }, + "CreateBackupPlanAssociation": { + "methods": [ + "createBackupPlanAssociation" + ] + }, + "CreateBackupVault": { + "methods": [ + "createBackupVault" + ] + }, + "CreateManagementServer": { + "methods": [ + "createManagementServer" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "deleteBackupPlan" + ] + }, + "DeleteBackupPlanAssociation": { + "methods": [ + "deleteBackupPlanAssociation" + ] + }, + "DeleteBackupVault": { + "methods": [ + "deleteBackupVault" + ] + }, + "DeleteManagementServer": { + "methods": [ + "deleteManagementServer" + ] + }, + "FetchUsableBackupVaults": { + "methods": [ + "fetchUsableBackupVaults" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetBackupPlan": { + "methods": [ + "getBackupPlan" + ] + }, + "GetBackupPlanAssociation": { + "methods": [ + "getBackupPlanAssociation" + ] + }, + "GetBackupVault": { + "methods": [ + "getBackupVault" + ] + }, + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "GetManagementServer": { + "methods": [ + "getManagementServer" + ] + }, + "ListBackupPlanAssociations": { + "methods": [ + "listBackupPlanAssociations" + ] + }, + "ListBackupPlans": { + "methods": [ + "listBackupPlans" + ] + }, + "ListBackupVaults": { + "methods": [ + "listBackupVaults" + ] + }, + "ListBackups": { + "methods": [ + "listBackups" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources" + ] + }, + "ListManagementServers": { + "methods": [ + "listManagementServers" + ] + }, + "RestoreBackup": { + "methods": [ + "restoreBackup" + ] + }, + "TriggerBackup": { + "methods": [ + "triggerBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "UpdateBackupVault": { + "methods": [ + "updateBackupVault" + ] + }, + "UpdateDataSource": { + "methods": [ + "updateDataSource" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_client_config.json b/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_client_config.json new file mode 100644 index 000000000000..c505f44b1add --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_client_config.json @@ -0,0 +1,204 @@ +{ + "interfaces": { + "google.cloud.backupdr.v1.BackupDR": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateBackupPlanAssociation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateManagementServer": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteBackupPlanAssociation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteManagementServer": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "FetchUsableBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetBackupPlanAssociation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetManagementServer": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListBackupPlanAssociations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListBackupPlans": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDataSources": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListManagementServers": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RestoreBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TriggerBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_descriptor_config.php b/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_descriptor_config.php new file mode 100644 index 000000000000..669fa4bd998c --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_descriptor_config.php @@ -0,0 +1,591 @@ + [ + 'google.cloud.backupdr.v1.BackupDR' => [ + 'CreateBackupPlan' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlan', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateBackupPlanAssociation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlanAssociation', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateBackupVault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupVault', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateManagementServer' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\ManagementServer', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\Backup', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlan' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlanAssociation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupVault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteManagementServer' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RestoreBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\RestoreBackupResponse', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'TriggerBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlanAssociation', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\Backup', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'backup.name', + 'fieldAccessors' => [ + 'getBackup', + 'getName', + ], + ], + ], + ], + 'UpdateBackupVault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupVault', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'backup_vault.name', + 'fieldAccessors' => [ + 'getBackupVault', + 'getName', + ], + ], + ], + ], + 'UpdateDataSource' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\DataSource', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'data_source.name', + 'fieldAccessors' => [ + 'getDataSource', + 'getName', + ], + ], + ], + ], + 'FetchUsableBackupVaults' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupVaults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\FetchUsableBackupVaultsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetBackup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\Backup', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlan' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\BackupPlan', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlanAssociation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\BackupPlanAssociation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupVault' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\BackupVault', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDataSource' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\DataSource', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetManagementServer' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ManagementServer', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListBackupPlanAssociations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupPlanAssociations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupPlanAssociationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupPlans' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupPlans', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupPlansResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupVaults' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupVaults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupVaultsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackups', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListDataSources' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataSources', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListDataSourcesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListManagementServers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getManagementServers', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListManagementServersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'backup' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}', + 'backupPlan' => 'projects/{project}/locations/{location}/backupPlans/{backup_plan}', + 'backupPlanAssociation' => 'projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}', + 'backupVault' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}', + 'dataSource' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}', + 'location' => 'projects/{project}/locations/{location}', + 'managementServer' => 'projects/{project}/locations/{location}/managementServers/{managementserver}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_rest_client_config.php b/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_rest_client_config.php new file mode 100644 index 000000000000..072b35af529f --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_rest_client_config.php @@ -0,0 +1,467 @@ + [ + 'google.cloud.backupdr.v1.BackupDR' => [ + 'CreateBackupPlan' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlans', + 'body' => 'backup_plan', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_plan_id', + ], + ], + 'CreateBackupPlanAssociation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlanAssociations', + 'body' => 'backup_plan_association', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_plan_association_id', + ], + ], + 'CreateBackupVault' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults', + 'body' => 'backup_vault', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_vault_id', + ], + ], + 'CreateManagementServer' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/managementServers', + 'body' => 'management_server', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'management_server_id', + ], + ], + 'DeleteBackup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlan' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlans/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlanAssociation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupVault' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteManagementServer' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/managementServers/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'FetchUsableBackupVaults' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetBackup' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlan' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlans/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlanAssociation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupVault' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDataSource' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetManagementServer' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/managementServers/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListBackupPlanAssociations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlanAssociations', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupPlans' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlans', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupVaults' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackups' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListDataSources' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListManagementServers' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/managementServers', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RestoreBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'TriggerBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', + 'body' => 'backup', + 'placeholders' => [ + 'backup.name' => [ + 'getters' => [ + 'getBackup', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateBackupVault' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}', + 'body' => 'backup_vault', + 'placeholders' => [ + 'backup_vault.name' => [ + 'getters' => [ + 'getBackupVault', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateDataSource' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}', + 'body' => 'data_source', + 'placeholders' => [ + 'data_source.name' => [ + 'getters' => [ + 'getDataSource', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/managementServers/*}:getIamPolicy', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/managementServers/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/managementServers/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/BackupDr/v1/tests/Unit/V1/Client/BackupDRClientTest.php b/owl-bot-staging/BackupDr/v1/tests/Unit/V1/Client/BackupDRClientTest.php new file mode 100644 index 000000000000..27d4a103280a --- /dev/null +++ b/owl-bot-staging/BackupDr/v1/tests/Unit/V1/Client/BackupDRClientTest.php @@ -0,0 +1,3373 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BackupDRClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BackupDRClient($options); + } + + /** @test */ + public function createBackupPlanTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupPlanTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $resourceType = 'resourceType979623115'; + $etag = 'etag3123477'; + $backupVault = 'backupVault353808757'; + $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; + $expectedResponse = new BackupPlan(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupVault($backupVault); + $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupPlanTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupPlanId = 'backupPlanId-25762700'; + $backupPlan = new BackupPlan(); + $backupPlanBackupRules = []; + $backupPlan->setBackupRules($backupPlanBackupRules); + $backupPlanResourceType = 'backupPlanResourceType1515155475'; + $backupPlan->setResourceType($backupPlanResourceType); + $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $backupPlan->setBackupVault($backupPlanBackupVault); + $request = (new CreateBackupPlanRequest()) + ->setParent($formattedParent) + ->setBackupPlanId($backupPlanId) + ->setBackupPlan($backupPlan); + $response = $gapicClient->createBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlan', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanId(); + $this->assertProtobufEquals($backupPlanId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlan(); + $this->assertProtobufEquals($backupPlan, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupPlanExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupPlanTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupPlanId = 'backupPlanId-25762700'; + $backupPlan = new BackupPlan(); + $backupPlanBackupRules = []; + $backupPlan->setBackupRules($backupPlanBackupRules); + $backupPlanResourceType = 'backupPlanResourceType1515155475'; + $backupPlan->setResourceType($backupPlanResourceType); + $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $backupPlan->setBackupVault($backupPlanBackupVault); + $request = (new CreateBackupPlanRequest()) + ->setParent($formattedParent) + ->setBackupPlanId($backupPlanId) + ->setBackupPlan($backupPlan); + $response = $gapicClient->createBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupPlanAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $resourceType = 'resourceType979623115'; + $resource = 'resource-341064690'; + $backupPlan = 'backupPlan1119623046'; + $dataSource = 'dataSource-1333894576'; + $expectedResponse = new BackupPlanAssociation(); + $expectedResponse->setName($name); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setResource($resource); + $expectedResponse->setBackupPlan($backupPlan); + $expectedResponse->setDataSource($dataSource); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupPlanAssociationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupPlanAssociationId = 'backupPlanAssociationId133124978'; + $backupPlanAssociation = new BackupPlanAssociation(); + $backupPlanAssociationResource = 'backupPlanAssociationResource1527164324'; + $backupPlanAssociation->setResource($backupPlanAssociationResource); + $backupPlanAssociationBackupPlan = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $backupPlanAssociation->setBackupPlan($backupPlanAssociationBackupPlan); + $request = (new CreateBackupPlanAssociationRequest()) + ->setParent($formattedParent) + ->setBackupPlanAssociationId($backupPlanAssociationId) + ->setBackupPlanAssociation($backupPlanAssociation); + $response = $gapicClient->createBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlanAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanAssociationId(); + $this->assertProtobufEquals($backupPlanAssociationId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanAssociation(); + $this->assertProtobufEquals($backupPlanAssociation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanAssociationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupPlanAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupPlanAssociationId = 'backupPlanAssociationId133124978'; + $backupPlanAssociation = new BackupPlanAssociation(); + $backupPlanAssociationResource = 'backupPlanAssociationResource1527164324'; + $backupPlanAssociation->setResource($backupPlanAssociationResource); + $backupPlanAssociationBackupPlan = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $backupPlanAssociation->setBackupPlan($backupPlanAssociationBackupPlan); + $request = (new CreateBackupPlanAssociationRequest()) + ->setParent($formattedParent) + ->setBackupPlanAssociationId($backupPlanAssociationId) + ->setBackupPlanAssociation($backupPlanAssociation); + $response = $gapicClient->createBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanAssociationTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupVaultTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $deletable = true; + $etag = 'etag3123477'; + $backupCount = 336678994; + $serviceAccount = 'serviceAccount-1948028253'; + $totalStoredBytes = 1181597162; + $uid = 'uid115792'; + $expectedResponse = new BackupVault(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setDeletable($deletable); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupVaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupVaultId = 'backupVaultId467030053'; + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new CreateBackupVaultRequest()) + ->setParent($formattedParent) + ->setBackupVaultId($backupVaultId) + ->setBackupVault($backupVault); + $response = $gapicClient->createBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupVault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupVaultId(); + $this->assertProtobufEquals($backupVaultId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupVault(); + $this->assertProtobufEquals($backupVault, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupVaultTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupVaultExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupVaultId = 'backupVaultId467030053'; + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new CreateBackupVaultRequest()) + ->setParent($formattedParent) + ->setBackupVaultId($backupVaultId) + ->setBackupVault($backupVault); + $response = $gapicClient->createBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupVaultTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createManagementServerTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $oauth2ClientId = 'oauth2ClientId-1833466037'; + $satisfiesPzi = false; + $expectedResponse = new ManagementServer(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setOauth2ClientId($oauth2ClientId); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createManagementServerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $managementServerId = 'managementServerId1884787355'; + $managementServer = new ManagementServer(); + $managementServerNetworks = []; + $managementServer->setNetworks($managementServerNetworks); + $request = (new CreateManagementServerRequest()) + ->setParent($formattedParent) + ->setManagementServerId($managementServerId) + ->setManagementServer($managementServer); + $response = $gapicClient->createManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateManagementServer', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getManagementServerId(); + $this->assertProtobufEquals($managementServerId, $actualValue); + $actualValue = $actualApiRequestObject->getManagementServer(); + $this->assertProtobufEquals($managementServer, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createManagementServerExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $managementServerId = 'managementServerId1884787355'; + $managementServer = new ManagementServer(); + $managementServerNetworks = []; + $managementServer->setNetworks($managementServerNetworks); + $request = (new CreateManagementServerRequest()) + ->setParent($formattedParent) + ->setManagementServerId($managementServerId) + ->setManagementServer($managementServer); + $response = $gapicClient->createManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $resourceSizeBytes = 275424386; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setResourceSizeBytes($resourceSizeBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); + $request = (new DeleteBackupRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); + $request = (new DeleteBackupRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupPlanTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new DeleteBackupPlanRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupPlan', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new DeleteBackupPlanRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupPlanAssociationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); + $request = (new DeleteBackupPlanAssociationRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupPlanAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanAssociationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); + $request = (new DeleteBackupPlanAssociationRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanAssociationTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupVaultTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupVaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new DeleteBackupVaultRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupVault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupVaultTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupVaultExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new DeleteBackupVaultRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupVaultTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteManagementServerTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteManagementServerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new DeleteManagementServerRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteManagementServer', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteManagementServerExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new DeleteManagementServerRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function fetchUsableBackupVaultsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupVaultsElement = new BackupVault(); + $backupVaults = [ + $backupVaultsElement, + ]; + $expectedResponse = new FetchUsableBackupVaultsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupVaults($backupVaults); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new FetchUsableBackupVaultsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->fetchUsableBackupVaults($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupVaults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/FetchUsableBackupVaults', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchUsableBackupVaultsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new FetchUsableBackupVaultsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->fetchUsableBackupVaults($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $resourceSizeBytes = 275424386; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setResourceSizeBytes($resourceSizeBytes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); + $request = (new GetBackupRequest()) + ->setName($formattedName); + $response = $gapicClient->getBackup($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); + $request = (new GetBackupRequest()) + ->setName($formattedName); + try { + $gapicClient->getBackup($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupPlanTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $resourceType = 'resourceType979623115'; + $etag = 'etag3123477'; + $backupVault = 'backupVault353808757'; + $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; + $expectedResponse = new BackupPlan(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupVault($backupVault); + $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new GetBackupPlanRequest()) + ->setName($formattedName); + $response = $gapicClient->getBackupPlan($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackupPlan', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupPlanExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new GetBackupPlanRequest()) + ->setName($formattedName); + try { + $gapicClient->getBackupPlan($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupPlanAssociationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $resourceType = 'resourceType979623115'; + $resource = 'resource-341064690'; + $backupPlan = 'backupPlan1119623046'; + $dataSource = 'dataSource-1333894576'; + $expectedResponse = new BackupPlanAssociation(); + $expectedResponse->setName($name2); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setResource($resource); + $expectedResponse->setBackupPlan($backupPlan); + $expectedResponse->setDataSource($dataSource); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); + $request = (new GetBackupPlanAssociationRequest()) + ->setName($formattedName); + $response = $gapicClient->getBackupPlanAssociation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackupPlanAssociation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupPlanAssociationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); + $request = (new GetBackupPlanAssociationRequest()) + ->setName($formattedName); + try { + $gapicClient->getBackupPlanAssociation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupVaultTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $deletable = true; + $etag = 'etag3123477'; + $backupCount = 336678994; + $serviceAccount = 'serviceAccount-1948028253'; + $totalStoredBytes = 1181597162; + $uid = 'uid115792'; + $expectedResponse = new BackupVault(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setDeletable($deletable); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new GetBackupVaultRequest()) + ->setName($formattedName); + $response = $gapicClient->getBackupVault($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackupVault', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupVaultExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new GetBackupVaultRequest()) + ->setName($formattedName); + try { + $gapicClient->getBackupVault($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataSourceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $backupCount = 336678994; + $etag = 'etag3123477'; + $totalStoredBytes = 1181597162; + $expectedResponse = new DataSource(); + $expectedResponse->setName($name2); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setEtag($etag); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new GetDataSourceRequest()) + ->setName($formattedName); + $response = $gapicClient->getDataSource($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetDataSource', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataSourceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new GetDataSourceRequest()) + ->setName($formattedName); + try { + $gapicClient->getDataSource($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getManagementServerTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $oauth2ClientId = 'oauth2ClientId-1833466037'; + $satisfiesPzi = false; + $expectedResponse = new ManagementServer(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setOauth2ClientId($oauth2ClientId); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new GetManagementServerRequest()) + ->setName($formattedName); + $response = $gapicClient->getManagementServer($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetManagementServer', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getManagementServerExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new GetManagementServerRequest()) + ->setName($formattedName); + try { + $gapicClient->getManagementServer($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupPlanAssociationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupPlanAssociationsElement = new BackupPlanAssociation(); + $backupPlanAssociations = [ + $backupPlanAssociationsElement, + ]; + $expectedResponse = new ListBackupPlanAssociationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupPlanAssociations($backupPlanAssociations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlanAssociationsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listBackupPlanAssociations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupPlanAssociations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupPlanAssociations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupPlanAssociationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlanAssociationsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listBackupPlanAssociations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupPlansTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupPlansElement = new BackupPlan(); + $backupPlans = [ + $backupPlansElement, + ]; + $expectedResponse = new ListBackupPlansResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupPlans($backupPlans); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlansRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listBackupPlans($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupPlans()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupPlans', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupPlansExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlansRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listBackupPlans($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupVaultsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupVaultsElement = new BackupVault(); + $backupVaults = [ + $backupVaultsElement, + ]; + $expectedResponse = new ListBackupVaultsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupVaults($backupVaults); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupVaultsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listBackupVaults($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupVaults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupVaults', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupVaultsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupVaultsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listBackupVaults($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupsElement = new Backup(); + $backups = [ + $backupsElement, + ]; + $expectedResponse = new ListBackupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackups($backups); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new ListBackupsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listBackups($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackups', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new ListBackupsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listBackups($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataSourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataSourcesElement = new DataSource(); + $dataSources = [ + $dataSourcesElement, + ]; + $expectedResponse = new ListDataSourcesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataSources($dataSources); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new ListDataSourcesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listDataSources($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataSources()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListDataSources', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataSourcesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new ListDataSourcesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listDataSources($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagementServersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $managementServersElement = new ManagementServer(); + $managementServers = [ + $managementServersElement, + ]; + $expectedResponse = new ListManagementServersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setManagementServers($managementServers); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListManagementServersRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listManagementServers($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getManagementServers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListManagementServers', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagementServersExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListManagementServersRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listManagementServers($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function restoreBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new RestoreBackupResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restoreBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); + $request = (new RestoreBackupRequest()) + ->setName($formattedName); + $response = $gapicClient->restoreBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/RestoreBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreBackupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function restoreBackupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); + $request = (new RestoreBackupRequest()) + ->setName($formattedName); + $response = $gapicClient->restoreBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreBackupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function triggerBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/triggerBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $resourceType = 'resourceType979623115'; + $resource = 'resource-341064690'; + $backupPlan = 'backupPlan1119623046'; + $dataSource = 'dataSource-1333894576'; + $expectedResponse = new BackupPlanAssociation(); + $expectedResponse->setName($name2); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setResource($resource); + $expectedResponse->setBackupPlan($backupPlan); + $expectedResponse->setDataSource($dataSource); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/triggerBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); + $ruleId = 'ruleId1548659006'; + $request = (new TriggerBackupRequest()) + ->setName($formattedName) + ->setRuleId($ruleId); + $response = $gapicClient->triggerBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/TriggerBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getRuleId(); + $this->assertProtobufEquals($ruleId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/triggerBackupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function triggerBackupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/triggerBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); + $ruleId = 'ruleId1548659006'; + $request = (new TriggerBackupRequest()) + ->setName($formattedName) + ->setRuleId($ruleId); + $response = $gapicClient->triggerBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/triggerBackupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $resourceSizeBytes = 275424386; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setResourceSizeBytes($resourceSizeBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $backup = new Backup(); + $request = (new UpdateBackupRequest()) + ->setUpdateMask($updateMask) + ->setBackup($backup); + $response = $gapicClient->updateBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getBackup(); + $this->assertProtobufEquals($backup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBackupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateBackupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $backup = new Backup(); + $request = (new UpdateBackupRequest()) + ->setUpdateMask($updateMask) + ->setBackup($backup); + $response = $gapicClient->updateBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBackupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateBackupVaultTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $deletable = true; + $etag = 'etag3123477'; + $backupCount = 336678994; + $serviceAccount = 'serviceAccount-1948028253'; + $totalStoredBytes = 1181597162; + $uid = 'uid115792'; + $expectedResponse = new BackupVault(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setDeletable($deletable); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateBackupVaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new UpdateBackupVaultRequest()) + ->setUpdateMask($updateMask) + ->setBackupVault($backupVault); + $response = $gapicClient->updateBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateBackupVault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getBackupVault(); + $this->assertProtobufEquals($backupVault, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBackupVaultTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateBackupVaultExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new UpdateBackupVaultRequest()) + ->setUpdateMask($updateMask) + ->setBackupVault($backupVault); + $response = $gapicClient->updateBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBackupVaultTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateDataSourceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDataSourceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $backupCount = 336678994; + $etag = 'etag3123477'; + $totalStoredBytes = 1181597162; + $expectedResponse = new DataSource(); + $expectedResponse->setName($name); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setEtag($etag); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateDataSourceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $dataSource = new DataSource(); + $request = (new UpdateDataSourceRequest()) + ->setUpdateMask($updateMask) + ->setDataSource($dataSource); + $response = $gapicClient->updateDataSource($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateDataSource', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getDataSource(); + $this->assertProtobufEquals($dataSource, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDataSourceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateDataSourceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDataSourceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $dataSource = new DataSource(); + $request = (new UpdateDataSourceRequest()) + ->setUpdateMask($updateMask) + ->setDataSource($dataSource); + $response = $gapicClient->updateDataSource($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDataSourceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createBackupPlanAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupPlanTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $resourceType = 'resourceType979623115'; + $etag = 'etag3123477'; + $backupVault = 'backupVault353808757'; + $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; + $expectedResponse = new BackupPlan(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupVault($backupVault); + $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupPlanTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupPlanId = 'backupPlanId-25762700'; + $backupPlan = new BackupPlan(); + $backupPlanBackupRules = []; + $backupPlan->setBackupRules($backupPlanBackupRules); + $backupPlanResourceType = 'backupPlanResourceType1515155475'; + $backupPlan->setResourceType($backupPlanResourceType); + $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $backupPlan->setBackupVault($backupPlanBackupVault); + $request = (new CreateBackupPlanRequest()) + ->setParent($formattedParent) + ->setBackupPlanId($backupPlanId) + ->setBackupPlan($backupPlan); + $response = $gapicClient->createBackupPlanAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlan', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanId(); + $this->assertProtobufEquals($backupPlanId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlan(); + $this->assertProtobufEquals($backupPlan, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Baremetalsolution.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Baremetalsolution.php new file mode 100644 index 000000000000..fa0826e2f624 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Baremetalsolution.php @@ -0,0 +1,113 @@ +internalAddGeneratedFile( + ' +¨U +9google/cloud/baremetalsolution/v2/baremetalsolution.proto!google.cloud.baremetalsolution.v2google/api/client.protogoogle/api/field_behavior.proto0google/cloud/baremetalsolution/v2/instance.proto+google/cloud/baremetalsolution/v2/lun.proto/google/cloud/baremetalsolution/v2/network.proto1google/cloud/baremetalsolution/v2/nfs_share.proto/google/cloud/baremetalsolution/v2/osimage.proto4google/cloud/baremetalsolution/v2/provisioning.proto/google/cloud/baremetalsolution/v2/ssh_key.proto.google/cloud/baremetalsolution/v2/volume.proto7google/cloud/baremetalsolution/v2/volume_snapshot.proto#google/longrunning/operations.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.proto"€ +OperationMetadata4 + create_time ( 2.google.protobuf.TimestampBàA1 +end_time ( 2.google.protobuf.TimestampBàA +target ( BàA +verb ( BàA +status_message ( BàA# +requested_cancellation (BàA + api_version ( BàA" +ResetInstanceResponse2ºK +BareMetalSolution + ListInstances7.google.cloud.baremetalsolution.v2.ListInstancesRequest8.google.cloud.baremetalsolution.v2.ListInstancesResponse">ÚAparent‚Óä“/-/v2/{parent=projects/*/locations/*}/instances¯ + GetInstance5.google.cloud.baremetalsolution.v2.GetInstanceRequest+.google.cloud.baremetalsolution.v2.Instance"<ÚAname‚Óä“/-/v2/{name=projects/*/locations/*/instances/*}ê +UpdateInstance8.google.cloud.baremetalsolution.v2.UpdateInstanceRequest.google.longrunning.Operation"ÊA +InstanceOperationMetadataÚAinstance,update_mask‚Óä“B26/v2/{instance.name=projects/*/locations/*/instances/*}:instanceÏ +RenameInstance8.google.cloud.baremetalsolution.v2.RenameInstanceRequest+.google.cloud.baremetalsolution.v2.Instance"VÚAname,new_instance_id‚Óä“9"4/v2/{name=projects/*/locations/*/instances/*}:rename:*Û + ResetInstance7.google.cloud.baremetalsolution.v2.ResetInstanceRequest.google.longrunning.Operation"rÊA* +ResetInstanceResponseOperationMetadataÚAname‚Óä“8"3/v2/{name=projects/*/locations/*/instances/*}:reset:*Û + StartInstance7.google.cloud.baremetalsolution.v2.StartInstanceRequest.google.longrunning.Operation"rÊA* +StartInstanceResponseOperationMetadataÚAname‚Óä“8"3/v2/{name=projects/*/locations/*/instances/*}:start:*× + StopInstance6.google.cloud.baremetalsolution.v2.StopInstanceRequest.google.longrunning.Operation"pÊA) +StopInstanceResponseOperationMetadataÚAname‚Óä“7"2/v2/{name=projects/*/locations/*/instances/*}:stop:*¨ +EnableInteractiveSerialConsoleH.google.cloud.baremetalsolution.v2.EnableInteractiveSerialConsoleRequest.google.longrunning.Operation"œÊA; +&EnableInteractiveSerialConsoleResponseOperationMetadataÚAname‚Óä“Q"L/v2/{name=projects/*/locations/*/instances/*}:enableInteractiveSerialConsole:*¬ +DisableInteractiveSerialConsoleI.google.cloud.baremetalsolution.v2.DisableInteractiveSerialConsoleRequest.google.longrunning.Operation"žÊA< +\'DisableInteractiveSerialConsoleResponseOperationMetadataÚAname‚Óä“R"M/v2/{name=projects/*/locations/*/instances/*}:disableInteractiveSerialConsole:*Ö + DetachLun3.google.cloud.baremetalsolution.v2.DetachLunRequest.google.longrunning.Operation"uÊA +InstanceOperationMetadataÚA instance,lun‚Óä“@";/v2/{instance=projects/*/locations/*/instances/*}:detachLun:*º + ListSSHKeys5.google.cloud.baremetalsolution.v2.ListSSHKeysRequest6.google.cloud.baremetalsolution.v2.ListSSHKeysResponse"<ÚAparent‚Óä“-+/v2/{parent=projects/*/locations/*}/sshKeysË + CreateSSHKey6.google.cloud.baremetalsolution.v2.CreateSSHKeyRequest).google.cloud.baremetalsolution.v2.SSHKey"XÚAparent,ssh_key,ssh_key_id‚Óä“6"+/v2/{parent=projects/*/locations/*}/sshKeys:ssh_keyš + DeleteSSHKey6.google.cloud.baremetalsolution.v2.DeleteSSHKeyRequest.google.protobuf.Empty":ÚAname‚Óä“-*+/v2/{name=projects/*/locations/*/sshKeys/*}º + ListVolumes5.google.cloud.baremetalsolution.v2.ListVolumesRequest6.google.cloud.baremetalsolution.v2.ListVolumesResponse"<ÚAparent‚Óä“-+/v2/{parent=projects/*/locations/*}/volumes§ + GetVolume3.google.cloud.baremetalsolution.v2.GetVolumeRequest).google.cloud.baremetalsolution.v2.Volume":ÚAname‚Óä“-+/v2/{name=projects/*/locations/*/volumes/*}Ü + UpdateVolume6.google.cloud.baremetalsolution.v2.UpdateVolumeRequest.google.longrunning.Operation"uÊA +VolumeOperationMetadataÚAvolume,update_mask‚Óä“<22/v2/{volume.name=projects/*/locations/*/volumes/*}:volumeÅ + RenameVolume6.google.cloud.baremetalsolution.v2.RenameVolumeRequest).google.cloud.baremetalsolution.v2.Volume"RÚAname,new_volume_id‚Óä“7"2/v2/{name=projects/*/locations/*/volumes/*}:rename:*Õ + EvictVolume5.google.cloud.baremetalsolution.v2.EvictVolumeRequest.google.longrunning.Operation"pÊA* +google.protobuf.EmptyOperationMetadataÚAname‚Óä“6"1/v2/{name=projects/*/locations/*/volumes/*}:evict:*Ö + ResizeVolume6.google.cloud.baremetalsolution.v2.ResizeVolumeRequest.google.longrunning.Operation"oÊA +VolumeOperationMetadataÚAvolume,size_gib‚Óä“9"4/v2/{volume=projects/*/locations/*/volumes/*}:resize:*¾ + ListNetworks6.google.cloud.baremetalsolution.v2.ListNetworksRequest7.google.cloud.baremetalsolution.v2.ListNetworksResponse"=ÚAparent‚Óä“.,/v2/{parent=projects/*/locations/*}/networksß +ListNetworkUsage:.google.cloud.baremetalsolution.v2.ListNetworkUsageRequest;.google.cloud.baremetalsolution.v2.ListNetworkUsageResponse"RÚAlocation‚Óä“A?/v2/{location=projects/*/locations/*}/networks:listNetworkUsage« + +GetNetwork4.google.cloud.baremetalsolution.v2.GetNetworkRequest*.google.cloud.baremetalsolution.v2.Network";ÚAname‚Óä“.,/v2/{name=projects/*/locations/*/networks/*}ã + UpdateNetwork7.google.cloud.baremetalsolution.v2.UpdateNetworkRequest.google.longrunning.Operation"zÊA +NetworkOperationMetadataÚAnetwork,update_mask‚Óä“?24/v2/{network.name=projects/*/locations/*/networks/*}:networkô +CreateVolumeSnapshot>.google.cloud.baremetalsolution.v2.CreateVolumeSnapshotRequest1.google.cloud.baremetalsolution.v2.VolumeSnapshot"iÚAparent,volume_snapshot‚Óä“J"7/v2/{parent=projects/*/locations/*/volumes/*}/snapshots:volume_snapshot• +RestoreVolumeSnapshot?.google.cloud.baremetalsolution.v2.RestoreVolumeSnapshotRequest.google.longrunning.Operation"›ÊA# +VolumeSnapshotOperationMetadataÚAvolume_snapshot‚Óä“]"X/v2/{volume_snapshot=projects/*/locations/*/volumes/*/snapshots/*}:restoreVolumeSnapshot:*¶ +DeleteVolumeSnapshot>.google.cloud.baremetalsolution.v2.DeleteVolumeSnapshotRequest.google.protobuf.Empty"FÚAname‚Óä“9*7/v2/{name=projects/*/locations/*/volumes/*/snapshots/*}Ë +GetVolumeSnapshot;.google.cloud.baremetalsolution.v2.GetVolumeSnapshotRequest1.google.cloud.baremetalsolution.v2.VolumeSnapshot"FÚAname‚Óä“97/v2/{name=projects/*/locations/*/volumes/*/snapshots/*}Þ +ListVolumeSnapshots=.google.cloud.baremetalsolution.v2.ListVolumeSnapshotsRequest>.google.cloud.baremetalsolution.v2.ListVolumeSnapshotsResponse"HÚAparent‚Óä“97/v2/{parent=projects/*/locations/*/volumes/*}/snapshots¥ +GetLun0.google.cloud.baremetalsolution.v2.GetLunRequest&.google.cloud.baremetalsolution.v2.Lun"AÚAname‚Óä“42/v2/{name=projects/*/locations/*/volumes/*/luns/*}¸ +ListLuns2.google.cloud.baremetalsolution.v2.ListLunsRequest3.google.cloud.baremetalsolution.v2.ListLunsResponse"CÚAparent‚Óä“42/v2/{parent=projects/*/locations/*/volumes/*}/lunsÖ +EvictLun2.google.cloud.baremetalsolution.v2.EvictLunRequest.google.longrunning.Operation"wÊA* +google.protobuf.EmptyOperationMetadataÚAname‚Óä“="8/v2/{name=projects/*/locations/*/volumes/*/luns/*}:evict:*¯ + GetNfsShare5.google.cloud.baremetalsolution.v2.GetNfsShareRequest+.google.cloud.baremetalsolution.v2.NfsShare"<ÚAname‚Óä“/-/v2/{name=projects/*/locations/*/nfsShares/*} + ListNfsShares7.google.cloud.baremetalsolution.v2.ListNfsSharesRequest8.google.cloud.baremetalsolution.v2.ListNfsSharesResponse">ÚAparent‚Óä“/-/v2/{parent=projects/*/locations/*}/nfsSharesî +UpdateNfsShare8.google.cloud.baremetalsolution.v2.UpdateNfsShareRequest.google.longrunning.Operation"‚ÊA +NfsShareOperationMetadataÚAnfs_share,update_mask‚Óä“D27/v2/{nfs_share.name=projects/*/locations/*/nfsShares/*}: nfs_shareÞ +CreateNfsShare8.google.cloud.baremetalsolution.v2.CreateNfsShareRequest.google.longrunning.Operation"sÊA +NfsShareOperationMetadataÚAparent,nfs_share‚Óä“:"-/v2/{parent=projects/*/locations/*}/nfsShares: nfs_shareÏ +RenameNfsShare8.google.cloud.baremetalsolution.v2.RenameNfsShareRequest+.google.cloud.baremetalsolution.v2.NfsShare"VÚAname,new_nfsshare_id‚Óä“9"4/v2/{name=projects/*/locations/*/nfsShares/*}:rename:*Ô +DeleteNfsShare8.google.cloud.baremetalsolution.v2.DeleteNfsShareRequest.google.longrunning.Operation"iÊA* +google.protobuf.EmptyOperationMetadataÚAname‚Óä“/*-/v2/{name=projects/*/locations/*/nfsShares/*}æ +ListProvisioningQuotas@.google.cloud.baremetalsolution.v2.ListProvisioningQuotasRequestA.google.cloud.baremetalsolution.v2.ListProvisioningQuotasResponse"GÚAparent‚Óä“86/v2/{parent=projects/*/locations/*}/provisioningQuotas‹ +SubmitProvisioningConfigB.google.cloud.baremetalsolution.v2.SubmitProvisioningConfigRequestC.google.cloud.baremetalsolution.v2.SubmitProvisioningConfigResponse"fÚAparent,provisioning_config‚Óä“C">/v2/{parent=projects/*/locations/*}/provisioningConfigs:submit:*× +GetProvisioningConfig?.google.cloud.baremetalsolution.v2.GetProvisioningConfigRequest5.google.cloud.baremetalsolution.v2.ProvisioningConfig"FÚAname‚Óä“97/v2/{name=projects/*/locations/*/provisioningConfigs/*}ˆ +CreateProvisioningConfigB.google.cloud.baremetalsolution.v2.CreateProvisioningConfigRequest5.google.cloud.baremetalsolution.v2.ProvisioningConfig"qÚAparent,provisioning_config‚Óä“N"7/v2/{parent=projects/*/locations/*}/provisioningConfigs:provisioning_config¢ +UpdateProvisioningConfigB.google.cloud.baremetalsolution.v2.UpdateProvisioningConfigRequest5.google.cloud.baremetalsolution.v2.ProvisioningConfig"ŠÚAprovisioning_config,update_mask‚Óä“b2K/v2/{provisioning_config.name=projects/*/locations/*/provisioningConfigs/*}:provisioning_configÊ + RenameNetwork7.google.cloud.baremetalsolution.v2.RenameNetworkRequest*.google.cloud.baremetalsolution.v2.Network"TÚAname,new_network_id‚Óä“8"3/v2/{name=projects/*/locations/*/networks/*}:rename:*¾ + ListOSImages6.google.cloud.baremetalsolution.v2.ListOSImagesRequest7.google.cloud.baremetalsolution.v2.ListOSImagesResponse"=ÚAparent‚Óä“.,/v2/{parent=projects/*/locations/*}/osImagesTÊA baremetalsolution.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB… +%com.google.cloud.baremetalsolution.v2BBareMetalSolutionProtoPZScloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb;baremetalsolutionpbª!Google.Cloud.BareMetalSolution.V2Ê!Google\\Cloud\\BareMetalSolution\\V2ê$Google::Cloud::BareMetalSolution::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Common.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Common.php new file mode 100644 index 000000000000..d062cb191bef Binary files /dev/null and b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Common.php differ diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Instance.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Instance.php new file mode 100644 index 000000000000..364927302379 Binary files /dev/null and b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Instance.php differ diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Lun.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Lun.php new file mode 100644 index 000000000000..c307e85ea707 Binary files /dev/null and b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Lun.php differ diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Network.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Network.php new file mode 100644 index 000000000000..137b733375d1 Binary files /dev/null and b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Network.php differ diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/NfsShare.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/NfsShare.php new file mode 100644 index 000000000000..057823850ae3 Binary files /dev/null and b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/NfsShare.php differ diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Osimage.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Osimage.php new file mode 100644 index 000000000000..8ca039c2d73d --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Osimage.php @@ -0,0 +1,45 @@ +internalAddGeneratedFile( + ' +ç +/google/cloud/baremetalsolution/v2/osimage.proto!google.cloud.baremetalsolution.v2google/api/resource.proto"† +OSImage +name ( BàA +code (  + description ( ! +applicable_instance_types ( # +supported_network_templates ( :}êAz +(baremetalsolution.googleapis.com/OsImage;projects/{project}/locations/{location}/osImages/{os_image}*osImages2osImage"w +ListOSImagesRequest9 +parent ( B)àAúA# +!locations.googleapis.com/Location + page_size ( + +page_token ( "n +ListOSImagesResponse= + os_images ( 2*.google.cloud.baremetalsolution.v2.OSImage +next_page_token ( Bû +%com.google.cloud.baremetalsolution.v2B OsImageProtoPZScloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb;baremetalsolutionpbª!Google.Cloud.BareMetalSolution.V2Ê!Google\\Cloud\\BareMetalSolution\\V2ê$Google::Cloud::BareMetalSolution::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Provisioning.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Provisioning.php new file mode 100644 index 000000000000..6b8be6c35f8d Binary files /dev/null and b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Provisioning.php differ diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/SshKey.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/SshKey.php new file mode 100644 index 000000000000..81b8ace59aae --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/SshKey.php @@ -0,0 +1,52 @@ +internalAddGeneratedFile( + ' +÷ +/google/cloud/baremetalsolution/v2/ssh_key.proto!google.cloud.baremetalsolution.v2google/api/resource.proto"˜ +SSHKey +name ( BàA + +public_key ( :gêAd +\'baremetalsolution.googleapis.com/SshKey9projects/{project}/locations/{location}/sshKeys/{ssh_key}"v +ListSSHKeysRequest9 +parent ( B)àAúA# +!locations.googleapis.com/Location + page_size ( + +page_token ( "k +ListSSHKeysResponse; +ssh_keys ( 2).google.cloud.baremetalsolution.v2.SSHKey +next_page_tokenZ ( "ª +CreateSSHKeyRequest9 +parent ( B)àAúA# +!locations.googleapis.com/Location? +ssh_key ( 2).google.cloud.baremetalsolution.v2.SSHKeyBàA + +ssh_key_id ( BàA"T +DeleteSSHKeyRequest= +name ( B/àAúA) +\'baremetalsolution.googleapis.com/SshKeyBú +%com.google.cloud.baremetalsolution.v2B SshKeyProtoPZScloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb;baremetalsolutionpbª!Google.Cloud.BareMetalSolution.V2Ê!Google\\Cloud\\BareMetalSolution\\V2ê$Google::Cloud::BareMetalSolution::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Volume.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Volume.php new file mode 100644 index 000000000000..64c919dabd2d Binary files /dev/null and b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/Volume.php differ diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/VolumeSnapshot.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/VolumeSnapshot.php new file mode 100644 index 000000000000..342fa243e15a Binary files /dev/null and b/owl-bot-staging/BareMetalSolution/v2/proto/src/GPBMetadata/Google/Cloud/Baremetalsolution/V2/VolumeSnapshot.php differ diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateNfsShareRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateNfsShareRequest.php new file mode 100644 index 000000000000..7440bd8a9556 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateNfsShareRequest.php @@ -0,0 +1,127 @@ +google.cloud.baremetalsolution.v2.CreateNfsShareRequest + */ +class CreateNfsShareRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent project and location. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The NfsShare to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare nfs_share = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $nfs_share = null; + + /** + * @param string $parent Required. The parent project and location. Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BareMetalSolution\V2\NfsShare $nfsShare Required. The NfsShare to create. + * + * @return \Google\Cloud\BareMetalSolution\V2\CreateNfsShareRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BareMetalSolution\V2\NfsShare $nfsShare): self + { + return (new self()) + ->setParent($parent) + ->setNfsShare($nfsShare); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent project and location. + * @type \Google\Cloud\BareMetalSolution\V2\NfsShare $nfs_share + * Required. The NfsShare to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\NfsShare::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent project and location. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent project and location. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The NfsShare to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare nfs_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BareMetalSolution\V2\NfsShare|null + */ + public function getNfsShare() + { + return $this->nfs_share; + } + + public function hasNfsShare() + { + return isset($this->nfs_share); + } + + public function clearNfsShare() + { + unset($this->nfs_share); + } + + /** + * Required. The NfsShare to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare nfs_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BareMetalSolution\V2\NfsShare $var + * @return $this + */ + public function setNfsShare($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\NfsShare::class); + $this->nfs_share = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateProvisioningConfigRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateProvisioningConfigRequest.php new file mode 100644 index 000000000000..af131bba0df5 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateProvisioningConfigRequest.php @@ -0,0 +1,170 @@ +google.cloud.baremetalsolution.v2.CreateProvisioningConfigRequest + */ +class CreateProvisioningConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent project and location containing the + * ProvisioningConfig. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ProvisioningConfig to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $provisioning_config = null; + /** + * Optional. Email provided to send a confirmation with provisioning config + * to. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $email = ''; + + /** + * @param string $parent Required. The parent project and location containing the + * ProvisioningConfig. Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $provisioningConfig Required. The ProvisioningConfig to create. + * + * @return \Google\Cloud\BareMetalSolution\V2\CreateProvisioningConfigRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $provisioningConfig): self + { + return (new self()) + ->setParent($parent) + ->setProvisioningConfig($provisioningConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent project and location containing the + * ProvisioningConfig. + * @type \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $provisioning_config + * Required. The ProvisioningConfig to create. + * @type string $email + * Optional. Email provided to send a confirmation with provisioning config + * to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent project and location containing the + * ProvisioningConfig. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent project and location containing the + * ProvisioningConfig. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The ProvisioningConfig to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig|null + */ + public function getProvisioningConfig() + { + return $this->provisioning_config; + } + + public function hasProvisioningConfig() + { + return isset($this->provisioning_config); + } + + public function clearProvisioningConfig() + { + unset($this->provisioning_config); + } + + /** + * Required. The ProvisioningConfig to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $var + * @return $this + */ + public function setProvisioningConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig::class); + $this->provisioning_config = $var; + + return $this; + } + + /** + * Optional. Email provided to send a confirmation with provisioning config + * to. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Optional. Email provided to send a confirmation with provisioning config + * to. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateSSHKeyRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateSSHKeyRequest.php new file mode 100644 index 000000000000..cfedc3945247 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateSSHKeyRequest.php @@ -0,0 +1,179 @@ +google.cloud.baremetalsolution.v2.CreateSSHKeyRequest + */ +class CreateSSHKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent containing the SSH keys. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The SSH key to register. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.SSHKey ssh_key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssh_key = null; + /** + * Required. The ID to use for the key, which will become the final component + * of the key's resource name. + * This value must match the regex: + * [a-zA-Z0-9@.\-_]{1,64} + * + * Generated from protobuf field string ssh_key_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssh_key_id = ''; + + /** + * @param string $parent Required. The parent containing the SSH keys. Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BareMetalSolution\V2\SSHKey $sshKey Required. The SSH key to register. + * @param string $sshKeyId Required. The ID to use for the key, which will become the final component + * of the key's resource name. + * + * This value must match the regex: + * [a-zA-Z0-9@.\-_]{1,64} + * + * @return \Google\Cloud\BareMetalSolution\V2\CreateSSHKeyRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BareMetalSolution\V2\SSHKey $sshKey, string $sshKeyId): self + { + return (new self()) + ->setParent($parent) + ->setSshKey($sshKey) + ->setSshKeyId($sshKeyId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent containing the SSH keys. + * @type \Google\Cloud\BareMetalSolution\V2\SSHKey $ssh_key + * Required. The SSH key to register. + * @type string $ssh_key_id + * Required. The ID to use for the key, which will become the final component + * of the key's resource name. + * This value must match the regex: + * [a-zA-Z0-9@.\-_]{1,64} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\SshKey::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent containing the SSH keys. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent containing the SSH keys. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The SSH key to register. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.SSHKey ssh_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BareMetalSolution\V2\SSHKey|null + */ + public function getSshKey() + { + return $this->ssh_key; + } + + public function hasSshKey() + { + return isset($this->ssh_key); + } + + public function clearSshKey() + { + unset($this->ssh_key); + } + + /** + * Required. The SSH key to register. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.SSHKey ssh_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BareMetalSolution\V2\SSHKey $var + * @return $this + */ + public function setSshKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\SSHKey::class); + $this->ssh_key = $var; + + return $this; + } + + /** + * Required. The ID to use for the key, which will become the final component + * of the key's resource name. + * This value must match the regex: + * [a-zA-Z0-9@.\-_]{1,64} + * + * Generated from protobuf field string ssh_key_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSshKeyId() + { + return $this->ssh_key_id; + } + + /** + * Required. The ID to use for the key, which will become the final component + * of the key's resource name. + * This value must match the regex: + * [a-zA-Z0-9@.\-_]{1,64} + * + * Generated from protobuf field string ssh_key_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSshKeyId($var) + { + GPBUtil::checkString($var, True); + $this->ssh_key_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateVolumeSnapshotRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateVolumeSnapshotRequest.php new file mode 100644 index 000000000000..596dbb03246e --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/CreateVolumeSnapshotRequest.php @@ -0,0 +1,127 @@ +google.cloud.baremetalsolution.v2.CreateVolumeSnapshotRequest + */ +class CreateVolumeSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The volume to snapshot. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The snapshot to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeSnapshot volume_snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $volume_snapshot = null; + + /** + * @param string $parent Required. The volume to snapshot. Please see + * {@see BareMetalSolutionClient::volumeName()} for help formatting this field. + * @param \Google\Cloud\BareMetalSolution\V2\VolumeSnapshot $volumeSnapshot Required. The snapshot to create. + * + * @return \Google\Cloud\BareMetalSolution\V2\CreateVolumeSnapshotRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BareMetalSolution\V2\VolumeSnapshot $volumeSnapshot): self + { + return (new self()) + ->setParent($parent) + ->setVolumeSnapshot($volumeSnapshot); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The volume to snapshot. + * @type \Google\Cloud\BareMetalSolution\V2\VolumeSnapshot $volume_snapshot + * Required. The snapshot to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\VolumeSnapshot::initOnce(); + parent::__construct($data); + } + + /** + * Required. The volume to snapshot. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The volume to snapshot. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The snapshot to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeSnapshot volume_snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BareMetalSolution\V2\VolumeSnapshot|null + */ + public function getVolumeSnapshot() + { + return $this->volume_snapshot; + } + + public function hasVolumeSnapshot() + { + return isset($this->volume_snapshot); + } + + public function clearVolumeSnapshot() + { + unset($this->volume_snapshot); + } + + /** + * Required. The snapshot to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeSnapshot volume_snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BareMetalSolution\V2\VolumeSnapshot $var + * @return $this + */ + public function setVolumeSnapshot($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\VolumeSnapshot::class); + $this->volume_snapshot = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DeleteNfsShareRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DeleteNfsShareRequest.php new file mode 100644 index 000000000000..f3f766e04791 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DeleteNfsShareRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.DeleteNfsShareRequest + */ +class DeleteNfsShareRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the NFS share to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the NFS share to delete. Please see + * {@see BareMetalSolutionClient::nFSShareName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\DeleteNfsShareRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the NFS share to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\NfsShare::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the NFS share to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the NFS share to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DeleteSSHKeyRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DeleteSSHKeyRequest.php new file mode 100644 index 000000000000..814572e4b1b5 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DeleteSSHKeyRequest.php @@ -0,0 +1,86 @@ +google.cloud.baremetalsolution.v2.DeleteSSHKeyRequest + */ +class DeleteSSHKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the SSH key to delete. + * Currently, the only valid value for the location is "global". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the SSH key to delete. + * Currently, the only valid value for the location is "global". Please see + * {@see BareMetalSolutionClient::sshKeyName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\DeleteSSHKeyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the SSH key to delete. + * Currently, the only valid value for the location is "global". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\SshKey::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the SSH key to delete. + * Currently, the only valid value for the location is "global". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the SSH key to delete. + * Currently, the only valid value for the location is "global". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DeleteVolumeSnapshotRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DeleteVolumeSnapshotRequest.php new file mode 100644 index 000000000000..19119d332bcb --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DeleteVolumeSnapshotRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.DeleteVolumeSnapshotRequest + */ +class DeleteVolumeSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the snapshot to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the snapshot to delete. Please see + * {@see BareMetalSolutionClient::volumeSnapshotName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\DeleteVolumeSnapshotRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the snapshot to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\VolumeSnapshot::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the snapshot to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the snapshot to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DetachLunRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DetachLunRequest.php new file mode 100644 index 000000000000..81712c80e095 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DetachLunRequest.php @@ -0,0 +1,152 @@ +google.cloud.baremetalsolution.v2.DetachLunRequest + */ +class DetachLunRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the instance. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $instance = ''; + /** + * Required. Name of the Lun to detach. + * + * Generated from protobuf field string lun = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $lun = ''; + /** + * If true, performs lun unmapping without instance reboot. + * + * Generated from protobuf field bool skip_reboot = 3; + */ + protected $skip_reboot = false; + + /** + * @param string $instance Required. Name of the instance. Please see + * {@see BareMetalSolutionClient::instanceName()} for help formatting this field. + * @param string $lun Required. Name of the Lun to detach. Please see + * {@see BareMetalSolutionClient::lunName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\DetachLunRequest + * + * @experimental + */ + public static function build(string $instance, string $lun): self + { + return (new self()) + ->setInstance($instance) + ->setLun($lun); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Required. Name of the instance. + * @type string $lun + * Required. Name of the Lun to detach. + * @type bool $skip_reboot + * If true, performs lun unmapping without instance reboot. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the instance. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Required. Name of the instance. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Required. Name of the Lun to detach. + * + * Generated from protobuf field string lun = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getLun() + { + return $this->lun; + } + + /** + * Required. Name of the Lun to detach. + * + * Generated from protobuf field string lun = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLun($var) + { + GPBUtil::checkString($var, True); + $this->lun = $var; + + return $this; + } + + /** + * If true, performs lun unmapping without instance reboot. + * + * Generated from protobuf field bool skip_reboot = 3; + * @return bool + */ + public function getSkipReboot() + { + return $this->skip_reboot; + } + + /** + * If true, performs lun unmapping without instance reboot. + * + * Generated from protobuf field bool skip_reboot = 3; + * @param bool $var + * @return $this + */ + public function setSkipReboot($var) + { + GPBUtil::checkBool($var); + $this->skip_reboot = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DisableInteractiveSerialConsoleRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DisableInteractiveSerialConsoleRequest.php new file mode 100644 index 000000000000..aa3868a802ab --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DisableInteractiveSerialConsoleRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.DisableInteractiveSerialConsoleRequest + */ +class DisableInteractiveSerialConsoleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BareMetalSolutionClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\DisableInteractiveSerialConsoleRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DisableInteractiveSerialConsoleResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DisableInteractiveSerialConsoleResponse.php new file mode 100644 index 000000000000..737e33fffce2 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/DisableInteractiveSerialConsoleResponse.php @@ -0,0 +1,33 @@ +google.cloud.baremetalsolution.v2.DisableInteractiveSerialConsoleResponse + */ +class DisableInteractiveSerialConsoleResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EnableInteractiveSerialConsoleRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EnableInteractiveSerialConsoleRequest.php new file mode 100644 index 000000000000..6f2964df785f --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EnableInteractiveSerialConsoleRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.EnableInteractiveSerialConsoleRequest + */ +class EnableInteractiveSerialConsoleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BareMetalSolutionClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\EnableInteractiveSerialConsoleRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EnableInteractiveSerialConsoleResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EnableInteractiveSerialConsoleResponse.php new file mode 100644 index 000000000000..26260201b3b4 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EnableInteractiveSerialConsoleResponse.php @@ -0,0 +1,33 @@ +google.cloud.baremetalsolution.v2.EnableInteractiveSerialConsoleResponse + */ +class EnableInteractiveSerialConsoleResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EvictLunRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EvictLunRequest.php new file mode 100644 index 000000000000..38c315af1d6c --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EvictLunRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.EvictLunRequest + */ +class EvictLunRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the lun. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the lun. Please see + * {@see BareMetalSolutionClient::lunName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\EvictLunRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the lun. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Lun::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the lun. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the lun. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EvictVolumeRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EvictVolumeRequest.php new file mode 100644 index 000000000000..3f04fee83e53 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/EvictVolumeRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.EvictVolumeRequest + */ +class EvictVolumeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Volume. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the Volume. Please see + * {@see BareMetalSolutionClient::volumeName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\EvictVolumeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the Volume. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Volume::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Volume. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the Volume. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetInstanceRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetInstanceRequest.php new file mode 100644 index 000000000000..7a98047a6e5c --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetInstanceRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.GetInstanceRequest + */ +class GetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BareMetalSolutionClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\GetInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetLunRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetLunRequest.php new file mode 100644 index 000000000000..1b3818ef6068 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetLunRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.GetLunRequest + */ +class GetLunRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BareMetalSolutionClient::lunName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\GetLunRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Lun::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetNetworkRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetNetworkRequest.php new file mode 100644 index 000000000000..b176df8e0052 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetNetworkRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.GetNetworkRequest + */ +class GetNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BareMetalSolutionClient::networkName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\GetNetworkRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetNfsShareRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetNfsShareRequest.php new file mode 100644 index 000000000000..95048183c5a2 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetNfsShareRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.GetNfsShareRequest + */ +class GetNfsShareRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BareMetalSolutionClient::nFSShareName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\GetNfsShareRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\NfsShare::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetProvisioningConfigRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetProvisioningConfigRequest.php new file mode 100644 index 000000000000..79256f54066f --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetProvisioningConfigRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.GetProvisioningConfigRequest + */ +class GetProvisioningConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the ProvisioningConfig. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the ProvisioningConfig. Please see + * {@see BareMetalSolutionClient::provisioningConfigName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\GetProvisioningConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the ProvisioningConfig. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the ProvisioningConfig. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the ProvisioningConfig. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetVolumeRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetVolumeRequest.php new file mode 100644 index 000000000000..16d3f54aa0b8 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetVolumeRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.GetVolumeRequest + */ +class GetVolumeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BareMetalSolutionClient::volumeName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\GetVolumeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Volume::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetVolumeSnapshotRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetVolumeSnapshotRequest.php new file mode 100644 index 000000000000..49af9dcb744f --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/GetVolumeSnapshotRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.GetVolumeSnapshotRequest + */ +class GetVolumeSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the snapshot. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the snapshot. Please see + * {@see BareMetalSolutionClient::volumeSnapshotName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\GetVolumeSnapshotRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the snapshot. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\VolumeSnapshot::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the snapshot. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the snapshot. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Instance.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Instance.php new file mode 100644 index 000000000000..85e0e58624a5 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Instance.php @@ -0,0 +1,779 @@ +google.cloud.baremetalsolution.v2.Instance + */ +class Instance extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name of this `Instance`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Output only. An identifier for the `Instance`, generated by the backend. + * + * Generated from protobuf field string id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $id = ''; + /** + * Output only. Create a time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update a time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Immutable. The server type. + * [Available server + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field string machine_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $machine_type = ''; + /** + * Output only. The state of the server. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * True if you enable hyperthreading for the server, otherwise false. + * The default value is false. + * + * Generated from protobuf field bool hyperthreading_enabled = 6; + */ + protected $hyperthreading_enabled = false; + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + /** + * Immutable. List of LUNs associated with this server. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE]; + */ + private $luns; + /** + * Input only. List of Volumes to attach to this Instance on creation. + * This field won't be populated in Get/List responses. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private $volumes; + /** + * Output only. List of networks associated with this server. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $networks; + /** + * Output only. True if the interactive serial console feature is enabled for + * the instance, false otherwise. The default value is false. + * + * Generated from protobuf field bool interactive_serial_console_enabled = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $interactive_serial_console_enabled = false; + /** + * The OS image currently installed on the server. + * + * Generated from protobuf field string os_image = 12; + */ + protected $os_image = ''; + /** + * Immutable. Pod name. + * Pod is an independent part of infrastructure. + * Instance can be connected to the assets (networks, volumes) allocated + * in the same pod only. + * + * Generated from protobuf field string pod = 13 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $pod = ''; + /** + * Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc. + * Generally, the template name follows the syntax of + * "bond" or "nic". + * + * Generated from protobuf field string network_template = 14 [(.google.api.resource_reference) = { + */ + protected $network_template = ''; + /** + * List of logical interfaces for the instance. The number of logical + * interfaces will be the same as number of hardware bond/nic on the chosen + * network template. For the non-multivlan configurations (for eg, existing + * servers) that use existing default network template (bondaa-bondaa), both + * the Instance.networks field and the Instance.logical_interfaces fields will + * be filled to ensure backward compatibility. For the others, only + * Instance.logical_interfaces will be filled. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15; + */ + private $logical_interfaces; + /** + * Output only. Text field about info for logging in. + * + * Generated from protobuf field string login_info = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $login_info = ''; + /** + * The workload profile for the instance. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.WorkloadProfile workload_profile = 18; + */ + protected $workload_profile = 0; + /** + * Output only. The firmware version for the instance. + * + * Generated from protobuf field string firmware_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $firmware_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name of this `Instance`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}` + * @type string $id + * Output only. An identifier for the `Instance`, generated by the backend. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create a time stamp. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update a time stamp. + * @type string $machine_type + * Immutable. The server type. + * [Available server + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * @type int $state + * Output only. The state of the server. + * @type bool $hyperthreading_enabled + * True if you enable hyperthreading for the server, otherwise false. + * The default value is false. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs. + * @type array<\Google\Cloud\BareMetalSolution\V2\Lun>|\Google\Protobuf\Internal\RepeatedField $luns + * Immutable. List of LUNs associated with this server. + * @type array<\Google\Cloud\BareMetalSolution\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * Input only. List of Volumes to attach to this Instance on creation. + * This field won't be populated in Get/List responses. + * @type array<\Google\Cloud\BareMetalSolution\V2\Network>|\Google\Protobuf\Internal\RepeatedField $networks + * Output only. List of networks associated with this server. + * @type bool $interactive_serial_console_enabled + * Output only. True if the interactive serial console feature is enabled for + * the instance, false otherwise. The default value is false. + * @type string $os_image + * The OS image currently installed on the server. + * @type string $pod + * Immutable. Pod name. + * Pod is an independent part of infrastructure. + * Instance can be connected to the assets (networks, volumes) allocated + * in the same pod only. + * @type string $network_template + * Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc. + * Generally, the template name follows the syntax of + * "bond" or "nic". + * @type array<\Google\Cloud\BareMetalSolution\V2\LogicalInterface>|\Google\Protobuf\Internal\RepeatedField $logical_interfaces + * List of logical interfaces for the instance. The number of logical + * interfaces will be the same as number of hardware bond/nic on the chosen + * network template. For the non-multivlan configurations (for eg, existing + * servers) that use existing default network template (bondaa-bondaa), both + * the Instance.networks field and the Instance.logical_interfaces fields will + * be filled to ensure backward compatibility. For the others, only + * Instance.logical_interfaces will be filled. + * @type string $login_info + * Output only. Text field about info for logging in. + * @type int $workload_profile + * The workload profile for the instance. + * @type string $firmware_version + * Output only. The firmware version for the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name of this `Instance`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name of this `Instance`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. An identifier for the `Instance`, generated by the backend. + * + * Generated from protobuf field string id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Output only. An identifier for the `Instance`, generated by the backend. + * + * Generated from protobuf field string id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Output only. Create a time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Create a time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update a time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Update a time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Immutable. The server type. + * [Available server + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field string machine_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * Immutable. The server type. + * [Available server + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field string machine_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * Output only. The state of the server. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the server. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Instance\State::class); + $this->state = $var; + + return $this; + } + + /** + * True if you enable hyperthreading for the server, otherwise false. + * The default value is false. + * + * Generated from protobuf field bool hyperthreading_enabled = 6; + * @return bool + */ + public function getHyperthreadingEnabled() + { + return $this->hyperthreading_enabled; + } + + /** + * True if you enable hyperthreading for the server, otherwise false. + * The default value is false. + * + * Generated from protobuf field bool hyperthreading_enabled = 6; + * @param bool $var + * @return $this + */ + public function setHyperthreadingEnabled($var) + { + GPBUtil::checkBool($var); + $this->hyperthreading_enabled = $var; + + return $this; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 7; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Immutable. List of LUNs associated with this server. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLuns() + { + return $this->luns; + } + + /** + * Immutable. List of LUNs associated with this server. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * @param array<\Google\Cloud\BareMetalSolution\V2\Lun>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLuns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\Lun::class); + $this->luns = $arr; + + return $this; + } + + /** + * Input only. List of Volumes to attach to this Instance on creation. + * This field won't be populated in Get/List responses. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * Input only. List of Volumes to attach to this Instance on creation. + * This field won't be populated in Get/List responses. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param array<\Google\Cloud\BareMetalSolution\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * Output only. List of networks associated with this server. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworks() + { + return $this->networks; + } + + /** + * Output only. List of networks associated with this server. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BareMetalSolution\V2\Network>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\Network::class); + $this->networks = $arr; + + return $this; + } + + /** + * Output only. True if the interactive serial console feature is enabled for + * the instance, false otherwise. The default value is false. + * + * Generated from protobuf field bool interactive_serial_console_enabled = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getInteractiveSerialConsoleEnabled() + { + return $this->interactive_serial_console_enabled; + } + + /** + * Output only. True if the interactive serial console feature is enabled for + * the instance, false otherwise. The default value is false. + * + * Generated from protobuf field bool interactive_serial_console_enabled = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setInteractiveSerialConsoleEnabled($var) + { + GPBUtil::checkBool($var); + $this->interactive_serial_console_enabled = $var; + + return $this; + } + + /** + * The OS image currently installed on the server. + * + * Generated from protobuf field string os_image = 12; + * @return string + */ + public function getOsImage() + { + return $this->os_image; + } + + /** + * The OS image currently installed on the server. + * + * Generated from protobuf field string os_image = 12; + * @param string $var + * @return $this + */ + public function setOsImage($var) + { + GPBUtil::checkString($var, True); + $this->os_image = $var; + + return $this; + } + + /** + * Immutable. Pod name. + * Pod is an independent part of infrastructure. + * Instance can be connected to the assets (networks, volumes) allocated + * in the same pod only. + * + * Generated from protobuf field string pod = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getPod() + { + return $this->pod; + } + + /** + * Immutable. Pod name. + * Pod is an independent part of infrastructure. + * Instance can be connected to the assets (networks, volumes) allocated + * in the same pod only. + * + * Generated from protobuf field string pod = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setPod($var) + { + GPBUtil::checkString($var, True); + $this->pod = $var; + + return $this; + } + + /** + * Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc. + * Generally, the template name follows the syntax of + * "bond" or "nic". + * + * Generated from protobuf field string network_template = 14 [(.google.api.resource_reference) = { + * @return string + */ + public function getNetworkTemplate() + { + return $this->network_template; + } + + /** + * Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc. + * Generally, the template name follows the syntax of + * "bond" or "nic". + * + * Generated from protobuf field string network_template = 14 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetworkTemplate($var) + { + GPBUtil::checkString($var, True); + $this->network_template = $var; + + return $this; + } + + /** + * List of logical interfaces for the instance. The number of logical + * interfaces will be the same as number of hardware bond/nic on the chosen + * network template. For the non-multivlan configurations (for eg, existing + * servers) that use existing default network template (bondaa-bondaa), both + * the Instance.networks field and the Instance.logical_interfaces fields will + * be filled to ensure backward compatibility. For the others, only + * Instance.logical_interfaces will be filled. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogicalInterfaces() + { + return $this->logical_interfaces; + } + + /** + * List of logical interfaces for the instance. The number of logical + * interfaces will be the same as number of hardware bond/nic on the chosen + * network template. For the non-multivlan configurations (for eg, existing + * servers) that use existing default network template (bondaa-bondaa), both + * the Instance.networks field and the Instance.logical_interfaces fields will + * be filled to ensure backward compatibility. For the others, only + * Instance.logical_interfaces will be filled. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15; + * @param array<\Google\Cloud\BareMetalSolution\V2\LogicalInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogicalInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\LogicalInterface::class); + $this->logical_interfaces = $arr; + + return $this; + } + + /** + * Output only. Text field about info for logging in. + * + * Generated from protobuf field string login_info = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLoginInfo() + { + return $this->login_info; + } + + /** + * Output only. Text field about info for logging in. + * + * Generated from protobuf field string login_info = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLoginInfo($var) + { + GPBUtil::checkString($var, True); + $this->login_info = $var; + + return $this; + } + + /** + * The workload profile for the instance. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.WorkloadProfile workload_profile = 18; + * @return int + */ + public function getWorkloadProfile() + { + return $this->workload_profile; + } + + /** + * The workload profile for the instance. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.WorkloadProfile workload_profile = 18; + * @param int $var + * @return $this + */ + public function setWorkloadProfile($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\WorkloadProfile::class); + $this->workload_profile = $var; + + return $this; + } + + /** + * Output only. The firmware version for the instance. + * + * Generated from protobuf field string firmware_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getFirmwareVersion() + { + return $this->firmware_version; + } + + /** + * Output only. The firmware version for the instance. + * + * Generated from protobuf field string firmware_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setFirmwareVersion($var) + { + GPBUtil::checkString($var, True); + $this->firmware_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Instance/State.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Instance/State.php new file mode 100644 index 000000000000..9a746059a3d8 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Instance/State.php @@ -0,0 +1,99 @@ +google.cloud.baremetalsolution.v2.Instance.State + */ +class State +{ + /** + * The server is in an unknown state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The server is being provisioned. + * + * Generated from protobuf enum PROVISIONING = 1; + */ + const PROVISIONING = 1; + /** + * The server is running. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * The server has been deleted. + * + * Generated from protobuf enum DELETED = 3; + */ + const DELETED = 3; + /** + * The server is being updated. + * + * Generated from protobuf enum UPDATING = 4; + */ + const UPDATING = 4; + /** + * The server is starting. + * + * Generated from protobuf enum STARTING = 5; + */ + const STARTING = 5; + /** + * The server is stopping. + * + * Generated from protobuf enum STOPPING = 6; + */ + const STOPPING = 6; + /** + * The server is shutdown. + * + * Generated from protobuf enum SHUTDOWN = 7; + */ + const SHUTDOWN = 7; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PROVISIONING => 'PROVISIONING', + self::RUNNING => 'RUNNING', + self::DELETED => 'DELETED', + self::UPDATING => 'UPDATING', + self::STARTING => 'STARTING', + self::STOPPING => 'STOPPING', + self::SHUTDOWN => 'SHUTDOWN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BareMetalSolution\V2\Instance_State::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceConfig.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceConfig.php new file mode 100644 index 000000000000..1e77b13cf9bf --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceConfig.php @@ -0,0 +1,549 @@ +google.cloud.baremetalsolution.v2.InstanceConfig + */ +class InstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the instance config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * A transient unique identifier to idenfity an instance within an + * ProvisioningConfig request. + * + * Generated from protobuf field string id = 2; + */ + protected $id = ''; + /** + * Instance type. + * [Available + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field string instance_type = 3; + */ + protected $instance_type = ''; + /** + * Whether the instance should be provisioned with Hyperthreading enabled. + * + * Generated from protobuf field bool hyperthreading = 4; + */ + protected $hyperthreading = false; + /** + * OS image to initialize the instance. + * [Available + * images](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field string os_image = 5; + */ + protected $os_image = ''; + /** + * Client network address. Filled if InstanceConfig.multivlan_config is false. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.InstanceConfig.NetworkAddress client_network = 6 [deprecated = true]; + * @deprecated + */ + protected $client_network = null; + /** + * Private network address, if any. Filled if InstanceConfig.multivlan_config + * is false. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.InstanceConfig.NetworkAddress private_network = 7 [deprecated = true]; + * @deprecated + */ + protected $private_network = null; + /** + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * + * Generated from protobuf field string user_note = 8; + */ + protected $user_note = ''; + /** + * If true networks can be from different projects of the same vendor account. + * + * Generated from protobuf field bool account_networks_enabled = 9; + */ + protected $account_networks_enabled = false; + /** + * The type of network configuration on the instance. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.InstanceConfig.NetworkConfig network_config = 10; + */ + protected $network_config = 0; + /** + * Server network template name. Filled if InstanceConfig.multivlan_config is + * true. + * + * Generated from protobuf field string network_template = 11; + */ + protected $network_template = ''; + /** + * List of logical interfaces for the instance. The number of logical + * interfaces will be the same as number of hardware bond/nic on the chosen + * network template. Filled if InstanceConfig.multivlan_config is true. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 12; + */ + private $logical_interfaces; + /** + * List of names of ssh keys used to provision the instance. + * + * Generated from protobuf field repeated string ssh_key_names = 13; + */ + private $ssh_key_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the instance config. + * @type string $id + * A transient unique identifier to idenfity an instance within an + * ProvisioningConfig request. + * @type string $instance_type + * Instance type. + * [Available + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * @type bool $hyperthreading + * Whether the instance should be provisioned with Hyperthreading enabled. + * @type string $os_image + * OS image to initialize the instance. + * [Available + * images](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * @type \Google\Cloud\BareMetalSolution\V2\InstanceConfig\NetworkAddress $client_network + * Client network address. Filled if InstanceConfig.multivlan_config is false. + * @type \Google\Cloud\BareMetalSolution\V2\InstanceConfig\NetworkAddress $private_network + * Private network address, if any. Filled if InstanceConfig.multivlan_config + * is false. + * @type string $user_note + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * @type bool $account_networks_enabled + * If true networks can be from different projects of the same vendor account. + * @type int $network_config + * The type of network configuration on the instance. + * @type string $network_template + * Server network template name. Filled if InstanceConfig.multivlan_config is + * true. + * @type array<\Google\Cloud\BareMetalSolution\V2\LogicalInterface>|\Google\Protobuf\Internal\RepeatedField $logical_interfaces + * List of logical interfaces for the instance. The number of logical + * interfaces will be the same as number of hardware bond/nic on the chosen + * network template. Filled if InstanceConfig.multivlan_config is true. + * @type array|\Google\Protobuf\Internal\RepeatedField $ssh_key_names + * List of names of ssh keys used to provision the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the instance config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the instance config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A transient unique identifier to idenfity an instance within an + * ProvisioningConfig request. + * + * Generated from protobuf field string id = 2; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * A transient unique identifier to idenfity an instance within an + * ProvisioningConfig request. + * + * Generated from protobuf field string id = 2; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Instance type. + * [Available + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field string instance_type = 3; + * @return string + */ + public function getInstanceType() + { + return $this->instance_type; + } + + /** + * Instance type. + * [Available + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field string instance_type = 3; + * @param string $var + * @return $this + */ + public function setInstanceType($var) + { + GPBUtil::checkString($var, True); + $this->instance_type = $var; + + return $this; + } + + /** + * Whether the instance should be provisioned with Hyperthreading enabled. + * + * Generated from protobuf field bool hyperthreading = 4; + * @return bool + */ + public function getHyperthreading() + { + return $this->hyperthreading; + } + + /** + * Whether the instance should be provisioned with Hyperthreading enabled. + * + * Generated from protobuf field bool hyperthreading = 4; + * @param bool $var + * @return $this + */ + public function setHyperthreading($var) + { + GPBUtil::checkBool($var); + $this->hyperthreading = $var; + + return $this; + } + + /** + * OS image to initialize the instance. + * [Available + * images](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field string os_image = 5; + * @return string + */ + public function getOsImage() + { + return $this->os_image; + } + + /** + * OS image to initialize the instance. + * [Available + * images](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field string os_image = 5; + * @param string $var + * @return $this + */ + public function setOsImage($var) + { + GPBUtil::checkString($var, True); + $this->os_image = $var; + + return $this; + } + + /** + * Client network address. Filled if InstanceConfig.multivlan_config is false. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.InstanceConfig.NetworkAddress client_network = 6 [deprecated = true]; + * @return \Google\Cloud\BareMetalSolution\V2\InstanceConfig\NetworkAddress|null + * @deprecated + */ + public function getClientNetwork() + { + @trigger_error('client_network is deprecated.', E_USER_DEPRECATED); + return $this->client_network; + } + + public function hasClientNetwork() + { + @trigger_error('client_network is deprecated.', E_USER_DEPRECATED); + return isset($this->client_network); + } + + public function clearClientNetwork() + { + @trigger_error('client_network is deprecated.', E_USER_DEPRECATED); + unset($this->client_network); + } + + /** + * Client network address. Filled if InstanceConfig.multivlan_config is false. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.InstanceConfig.NetworkAddress client_network = 6 [deprecated = true]; + * @param \Google\Cloud\BareMetalSolution\V2\InstanceConfig\NetworkAddress $var + * @return $this + * @deprecated + */ + public function setClientNetwork($var) + { + @trigger_error('client_network is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\InstanceConfig\NetworkAddress::class); + $this->client_network = $var; + + return $this; + } + + /** + * Private network address, if any. Filled if InstanceConfig.multivlan_config + * is false. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.InstanceConfig.NetworkAddress private_network = 7 [deprecated = true]; + * @return \Google\Cloud\BareMetalSolution\V2\InstanceConfig\NetworkAddress|null + * @deprecated + */ + public function getPrivateNetwork() + { + @trigger_error('private_network is deprecated.', E_USER_DEPRECATED); + return $this->private_network; + } + + public function hasPrivateNetwork() + { + @trigger_error('private_network is deprecated.', E_USER_DEPRECATED); + return isset($this->private_network); + } + + public function clearPrivateNetwork() + { + @trigger_error('private_network is deprecated.', E_USER_DEPRECATED); + unset($this->private_network); + } + + /** + * Private network address, if any. Filled if InstanceConfig.multivlan_config + * is false. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.InstanceConfig.NetworkAddress private_network = 7 [deprecated = true]; + * @param \Google\Cloud\BareMetalSolution\V2\InstanceConfig\NetworkAddress $var + * @return $this + * @deprecated + */ + public function setPrivateNetwork($var) + { + @trigger_error('private_network is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\InstanceConfig\NetworkAddress::class); + $this->private_network = $var; + + return $this; + } + + /** + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * + * Generated from protobuf field string user_note = 8; + * @return string + */ + public function getUserNote() + { + return $this->user_note; + } + + /** + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * + * Generated from protobuf field string user_note = 8; + * @param string $var + * @return $this + */ + public function setUserNote($var) + { + GPBUtil::checkString($var, True); + $this->user_note = $var; + + return $this; + } + + /** + * If true networks can be from different projects of the same vendor account. + * + * Generated from protobuf field bool account_networks_enabled = 9; + * @return bool + */ + public function getAccountNetworksEnabled() + { + return $this->account_networks_enabled; + } + + /** + * If true networks can be from different projects of the same vendor account. + * + * Generated from protobuf field bool account_networks_enabled = 9; + * @param bool $var + * @return $this + */ + public function setAccountNetworksEnabled($var) + { + GPBUtil::checkBool($var); + $this->account_networks_enabled = $var; + + return $this; + } + + /** + * The type of network configuration on the instance. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.InstanceConfig.NetworkConfig network_config = 10; + * @return int + */ + public function getNetworkConfig() + { + return $this->network_config; + } + + /** + * The type of network configuration on the instance. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.InstanceConfig.NetworkConfig network_config = 10; + * @param int $var + * @return $this + */ + public function setNetworkConfig($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\InstanceConfig\NetworkConfig::class); + $this->network_config = $var; + + return $this; + } + + /** + * Server network template name. Filled if InstanceConfig.multivlan_config is + * true. + * + * Generated from protobuf field string network_template = 11; + * @return string + */ + public function getNetworkTemplate() + { + return $this->network_template; + } + + /** + * Server network template name. Filled if InstanceConfig.multivlan_config is + * true. + * + * Generated from protobuf field string network_template = 11; + * @param string $var + * @return $this + */ + public function setNetworkTemplate($var) + { + GPBUtil::checkString($var, True); + $this->network_template = $var; + + return $this; + } + + /** + * List of logical interfaces for the instance. The number of logical + * interfaces will be the same as number of hardware bond/nic on the chosen + * network template. Filled if InstanceConfig.multivlan_config is true. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogicalInterfaces() + { + return $this->logical_interfaces; + } + + /** + * List of logical interfaces for the instance. The number of logical + * interfaces will be the same as number of hardware bond/nic on the chosen + * network template. Filled if InstanceConfig.multivlan_config is true. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 12; + * @param array<\Google\Cloud\BareMetalSolution\V2\LogicalInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogicalInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\LogicalInterface::class); + $this->logical_interfaces = $arr; + + return $this; + } + + /** + * List of names of ssh keys used to provision the instance. + * + * Generated from protobuf field repeated string ssh_key_names = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSshKeyNames() + { + return $this->ssh_key_names; + } + + /** + * List of names of ssh keys used to provision the instance. + * + * Generated from protobuf field repeated string ssh_key_names = 13; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSshKeyNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ssh_key_names = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceConfig/NetworkAddress.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceConfig/NetworkAddress.php new file mode 100644 index 000000000000..7ab49c50498c --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceConfig/NetworkAddress.php @@ -0,0 +1,138 @@ +google.cloud.baremetalsolution.v2.InstanceConfig.NetworkAddress + */ +class NetworkAddress extends \Google\Protobuf\Internal\Message +{ + /** + * Id of the network to use, within the same ProvisioningConfig request. + * + * Generated from protobuf field string network_id = 1; + */ + protected $network_id = ''; + /** + * IPv4 address to be assigned to the server. + * + * Generated from protobuf field string address = 2; + */ + protected $address = ''; + /** + * Name of the existing network to use. + * + * Generated from protobuf field string existing_network_id = 3; + */ + protected $existing_network_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_id + * Id of the network to use, within the same ProvisioningConfig request. + * @type string $address + * IPv4 address to be assigned to the server. + * @type string $existing_network_id + * Name of the existing network to use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Id of the network to use, within the same ProvisioningConfig request. + * + * Generated from protobuf field string network_id = 1; + * @return string + */ + public function getNetworkId() + { + return $this->network_id; + } + + /** + * Id of the network to use, within the same ProvisioningConfig request. + * + * Generated from protobuf field string network_id = 1; + * @param string $var + * @return $this + */ + public function setNetworkId($var) + { + GPBUtil::checkString($var, True); + $this->network_id = $var; + + return $this; + } + + /** + * IPv4 address to be assigned to the server. + * + * Generated from protobuf field string address = 2; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * IPv4 address to be assigned to the server. + * + * Generated from protobuf field string address = 2; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * Name of the existing network to use. + * + * Generated from protobuf field string existing_network_id = 3; + * @return string + */ + public function getExistingNetworkId() + { + return $this->existing_network_id; + } + + /** + * Name of the existing network to use. + * + * Generated from protobuf field string existing_network_id = 3; + * @param string $var + * @return $this + */ + public function setExistingNetworkId($var) + { + GPBUtil::checkString($var, True); + $this->existing_network_id = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkAddress::class, \Google\Cloud\BareMetalSolution\V2\InstanceConfig_NetworkAddress::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceConfig/NetworkConfig.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceConfig/NetworkConfig.php new file mode 100644 index 000000000000..30f7aa107cdd --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceConfig/NetworkConfig.php @@ -0,0 +1,65 @@ +google.cloud.baremetalsolution.v2.InstanceConfig.NetworkConfig + */ +class NetworkConfig +{ + /** + * The unspecified network configuration. + * + * Generated from protobuf enum NETWORKCONFIG_UNSPECIFIED = 0; + */ + const NETWORKCONFIG_UNSPECIFIED = 0; + /** + * Instance part of single client network and single private network. + * + * Generated from protobuf enum SINGLE_VLAN = 1; + */ + const SINGLE_VLAN = 1; + /** + * Instance part of multiple (or single) client networks and private + * networks. + * + * Generated from protobuf enum MULTI_VLAN = 2; + */ + const MULTI_VLAN = 2; + + private static $valueToName = [ + self::NETWORKCONFIG_UNSPECIFIED => 'NETWORKCONFIG_UNSPECIFIED', + self::SINGLE_VLAN => 'SINGLE_VLAN', + self::MULTI_VLAN => 'MULTI_VLAN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkConfig::class, \Google\Cloud\BareMetalSolution\V2\InstanceConfig_NetworkConfig::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceQuota.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceQuota.php new file mode 100644 index 000000000000..21db20745c70 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/InstanceQuota.php @@ -0,0 +1,216 @@ +google.cloud.baremetalsolution.v2.InstanceQuota + */ +class InstanceQuota extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the instance quota. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Instance type. + * Deprecated: use gcp_service. + * + * Generated from protobuf field string instance_type = 2 [deprecated = true]; + * @deprecated + */ + protected $instance_type = ''; + /** + * The gcp service of the provisioning quota. + * + * Generated from protobuf field string gcp_service = 5; + */ + protected $gcp_service = ''; + /** + * Location where the quota applies. + * + * Generated from protobuf field string location = 3; + */ + protected $location = ''; + /** + * Number of machines than can be created for the given location and + * instance_type. + * + * Generated from protobuf field int32 available_machine_count = 4; + */ + protected $available_machine_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the instance quota. + * @type string $instance_type + * Instance type. + * Deprecated: use gcp_service. + * @type string $gcp_service + * The gcp service of the provisioning quota. + * @type string $location + * Location where the quota applies. + * @type int $available_machine_count + * Number of machines than can be created for the given location and + * instance_type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the instance quota. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the instance quota. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Instance type. + * Deprecated: use gcp_service. + * + * Generated from protobuf field string instance_type = 2 [deprecated = true]; + * @return string + * @deprecated + */ + public function getInstanceType() + { + @trigger_error('instance_type is deprecated.', E_USER_DEPRECATED); + return $this->instance_type; + } + + /** + * Instance type. + * Deprecated: use gcp_service. + * + * Generated from protobuf field string instance_type = 2 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setInstanceType($var) + { + @trigger_error('instance_type is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->instance_type = $var; + + return $this; + } + + /** + * The gcp service of the provisioning quota. + * + * Generated from protobuf field string gcp_service = 5; + * @return string + */ + public function getGcpService() + { + return $this->gcp_service; + } + + /** + * The gcp service of the provisioning quota. + * + * Generated from protobuf field string gcp_service = 5; + * @param string $var + * @return $this + */ + public function setGcpService($var) + { + GPBUtil::checkString($var, True); + $this->gcp_service = $var; + + return $this; + } + + /** + * Location where the quota applies. + * + * Generated from protobuf field string location = 3; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Location where the quota applies. + * + * Generated from protobuf field string location = 3; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Number of machines than can be created for the given location and + * instance_type. + * + * Generated from protobuf field int32 available_machine_count = 4; + * @return int + */ + public function getAvailableMachineCount() + { + return $this->available_machine_count; + } + + /** + * Number of machines than can be created for the given location and + * instance_type. + * + * Generated from protobuf field int32 available_machine_count = 4; + * @param int $var + * @return $this + */ + public function setAvailableMachineCount($var) + { + GPBUtil::checkInt32($var); + $this->available_machine_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListInstancesRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListInstancesRequest.php new file mode 100644 index 000000000000..b8df2634e290 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListInstancesRequest.php @@ -0,0 +1,187 @@ +google.cloud.baremetalsolution.v2.ListInstancesRequest + */ +class ListInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListInstancesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, the server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + + /** + * @param string $parent Required. Parent value for ListInstancesRequest. Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\ListInstancesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListInstancesRequest. + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, the server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results from the server. + * @type string $filter + * List filter. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListInstancesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListInstancesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, the server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, the server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListInstancesResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListInstancesResponse.php new file mode 100644 index 000000000000..7bc39330cdee --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListInstancesResponse.php @@ -0,0 +1,135 @@ +google.cloud.baremetalsolution.v2.ListInstancesResponse + */ +class ListInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of servers. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Instance instances = 1; + */ + private $instances; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BareMetalSolution\V2\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * The list of servers. + * @type string $next_page_token + * A token identifying a page of results from the server. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The list of servers. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The list of servers. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Instance instances = 1; + * @param array<\Google\Cloud\BareMetalSolution\V2\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\Instance::class); + $this->instances = $arr; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListLunsRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListLunsRequest.php new file mode 100644 index 000000000000..46a9980f6ad5 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListLunsRequest.php @@ -0,0 +1,153 @@ +google.cloud.baremetalsolution.v2.ListLunsRequest + */ +class ListLunsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListLunsRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Parent value for ListLunsRequest. Please see + * {@see BareMetalSolutionClient::volumeName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\ListLunsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListLunsRequest. + * @type int $page_size + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results from the server. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Lun::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListLunsRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListLunsRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListLunsResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListLunsResponse.php new file mode 100644 index 000000000000..c15be31a1acd --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListLunsResponse.php @@ -0,0 +1,135 @@ +google.cloud.baremetalsolution.v2.ListLunsResponse + */ +class ListLunsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of luns. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Lun luns = 1; + */ + private $luns; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BareMetalSolution\V2\Lun>|\Google\Protobuf\Internal\RepeatedField $luns + * The list of luns. + * @type string $next_page_token + * A token identifying a page of results from the server. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Lun::initOnce(); + parent::__construct($data); + } + + /** + * The list of luns. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Lun luns = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLuns() + { + return $this->luns; + } + + /** + * The list of luns. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Lun luns = 1; + * @param array<\Google\Cloud\BareMetalSolution\V2\Lun>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLuns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\Lun::class); + $this->luns = $arr; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworkUsageRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworkUsageRequest.php new file mode 100644 index 000000000000..6c9b2360d478 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworkUsageRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.ListNetworkUsageRequest + */ +class ListNetworkUsageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value (project and location). + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $location = ''; + + /** + * @param string $location Required. Parent value (project and location). Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\ListNetworkUsageRequest + * + * @experimental + */ + public static function build(string $location): self + { + return (new self()) + ->setLocation($location); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $location + * Required. Parent value (project and location). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value (project and location). + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Required. Parent value (project and location). + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworkUsageResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworkUsageResponse.php new file mode 100644 index 000000000000..322b3281df57 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworkUsageResponse.php @@ -0,0 +1,67 @@ +google.cloud.baremetalsolution.v2.ListNetworkUsageResponse + */ +class ListNetworkUsageResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Networks with IPs. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkUsage networks = 1; + */ + private $networks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BareMetalSolution\V2\NetworkUsage>|\Google\Protobuf\Internal\RepeatedField $networks + * Networks with IPs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * Networks with IPs. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkUsage networks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworks() + { + return $this->networks; + } + + /** + * Networks with IPs. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkUsage networks = 1; + * @param array<\Google\Cloud\BareMetalSolution\V2\NetworkUsage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\NetworkUsage::class); + $this->networks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworksRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworksRequest.php new file mode 100644 index 000000000000..83913f7e5766 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworksRequest.php @@ -0,0 +1,187 @@ +google.cloud.baremetalsolution.v2.ListNetworksRequest + */ +class ListNetworksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListNetworksRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + + /** + * @param string $parent Required. Parent value for ListNetworksRequest. Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\ListNetworksRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListNetworksRequest. + * @type int $page_size + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results from the server. + * @type string $filter + * List filter. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListNetworksRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListNetworksRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworksResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworksResponse.php new file mode 100644 index 000000000000..864d99abb0ef --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNetworksResponse.php @@ -0,0 +1,135 @@ +google.cloud.baremetalsolution.v2.ListNetworksResponse + */ +class ListNetworksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of networks. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Network networks = 1; + */ + private $networks; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BareMetalSolution\V2\Network>|\Google\Protobuf\Internal\RepeatedField $networks + * The list of networks. + * @type string $next_page_token + * A token identifying a page of results from the server. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * The list of networks. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Network networks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworks() + { + return $this->networks; + } + + /** + * The list of networks. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Network networks = 1; + * @param array<\Google\Cloud\BareMetalSolution\V2\Network>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\Network::class); + $this->networks = $arr; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNfsSharesRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNfsSharesRequest.php new file mode 100644 index 000000000000..cc06bdec66a2 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNfsSharesRequest.php @@ -0,0 +1,187 @@ +google.cloud.baremetalsolution.v2.ListNfsSharesRequest + */ +class ListNfsSharesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListNfsSharesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + + /** + * @param string $parent Required. Parent value for ListNfsSharesRequest. Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\ListNfsSharesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListNfsSharesRequest. + * @type int $page_size + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results from the server. + * @type string $filter + * List filter. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\NfsShare::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListNfsSharesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListNfsSharesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNfsSharesResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNfsSharesResponse.php new file mode 100644 index 000000000000..1af3d5e7c36c --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListNfsSharesResponse.php @@ -0,0 +1,135 @@ +google.cloud.baremetalsolution.v2.ListNfsSharesResponse + */ +class ListNfsSharesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of NFS shares. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NfsShare nfs_shares = 1; + */ + private $nfs_shares; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BareMetalSolution\V2\NfsShare>|\Google\Protobuf\Internal\RepeatedField $nfs_shares + * The list of NFS shares. + * @type string $next_page_token + * A token identifying a page of results from the server. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\NfsShare::initOnce(); + parent::__construct($data); + } + + /** + * The list of NFS shares. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NfsShare nfs_shares = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNfsShares() + { + return $this->nfs_shares; + } + + /** + * The list of NFS shares. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NfsShare nfs_shares = 1; + * @param array<\Google\Cloud\BareMetalSolution\V2\NfsShare>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNfsShares($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\NfsShare::class); + $this->nfs_shares = $arr; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListOSImagesRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListOSImagesRequest.php new file mode 100644 index 000000000000..195fef9c9222 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListOSImagesRequest.php @@ -0,0 +1,161 @@ +google.cloud.baremetalsolution.v2.ListOSImagesRequest + */ +class ListOSImagesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListProvisioningQuotasRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * Notice that page_size field is not supported and won't be respected in + * the API request for now, will be updated when pagination is supported. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Parent value for ListProvisioningQuotasRequest. Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\ListOSImagesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListProvisioningQuotasRequest. + * @type int $page_size + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * Notice that page_size field is not supported and won't be respected in + * the API request for now, will be updated when pagination is supported. + * @type string $page_token + * A token identifying a page of results from the server. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Osimage::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListProvisioningQuotasRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListProvisioningQuotasRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * Notice that page_size field is not supported and won't be respected in + * the API request for now, will be updated when pagination is supported. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * Notice that page_size field is not supported and won't be respected in + * the API request for now, will be updated when pagination is supported. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListOSImagesResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListOSImagesResponse.php new file mode 100644 index 000000000000..92783d7acf49 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListOSImagesResponse.php @@ -0,0 +1,105 @@ +google.cloud.baremetalsolution.v2.ListOSImagesResponse + */ +class ListOSImagesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The OS images available. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.OSImage os_images = 1; + */ + private $os_images; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BareMetalSolution\V2\OSImage>|\Google\Protobuf\Internal\RepeatedField $os_images + * The OS images available. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Osimage::initOnce(); + parent::__construct($data); + } + + /** + * The OS images available. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.OSImage os_images = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOsImages() + { + return $this->os_images; + } + + /** + * The OS images available. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.OSImage os_images = 1; + * @param array<\Google\Cloud\BareMetalSolution\V2\OSImage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOsImages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\OSImage::class); + $this->os_images = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListProvisioningQuotasRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListProvisioningQuotasRequest.php new file mode 100644 index 000000000000..ef418f0024c7 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListProvisioningQuotasRequest.php @@ -0,0 +1,161 @@ +google.cloud.baremetalsolution.v2.ListProvisioningQuotasRequest + */ +class ListProvisioningQuotasRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListProvisioningQuotasRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * Notice that page_size field is not supported and won't be respected in + * the API request for now, will be updated when pagination is supported. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Parent value for ListProvisioningQuotasRequest. Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\ListProvisioningQuotasRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListProvisioningQuotasRequest. + * @type int $page_size + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * Notice that page_size field is not supported and won't be respected in + * the API request for now, will be updated when pagination is supported. + * @type string $page_token + * A token identifying a page of results from the server. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListProvisioningQuotasRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListProvisioningQuotasRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * Notice that page_size field is not supported and won't be respected in + * the API request for now, will be updated when pagination is supported. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * Notice that page_size field is not supported and won't be respected in + * the API request for now, will be updated when pagination is supported. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListProvisioningQuotasResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListProvisioningQuotasResponse.php new file mode 100644 index 000000000000..a470f6384160 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListProvisioningQuotasResponse.php @@ -0,0 +1,105 @@ +google.cloud.baremetalsolution.v2.ListProvisioningQuotasResponse + */ +class ListProvisioningQuotasResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The provisioning quotas registered in this project. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.ProvisioningQuota provisioning_quotas = 1; + */ + private $provisioning_quotas; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BareMetalSolution\V2\ProvisioningQuota>|\Google\Protobuf\Internal\RepeatedField $provisioning_quotas + * The provisioning quotas registered in this project. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * The provisioning quotas registered in this project. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.ProvisioningQuota provisioning_quotas = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProvisioningQuotas() + { + return $this->provisioning_quotas; + } + + /** + * The provisioning quotas registered in this project. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.ProvisioningQuota provisioning_quotas = 1; + * @param array<\Google\Cloud\BareMetalSolution\V2\ProvisioningQuota>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProvisioningQuotas($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\ProvisioningQuota::class); + $this->provisioning_quotas = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListSSHKeysRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListSSHKeysRequest.php new file mode 100644 index 000000000000..9903fca07cad --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListSSHKeysRequest.php @@ -0,0 +1,154 @@ +google.cloud.baremetalsolution.v2.ListSSHKeysRequest + */ +class ListSSHKeysRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent containing the SSH keys. + * Currently, the only valid value for the location is "global". + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent containing the SSH keys. + * Currently, the only valid value for the location is "global". Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\ListSSHKeysRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent containing the SSH keys. + * Currently, the only valid value for the location is "global". + * @type int $page_size + * The maximum number of items to return. + * @type string $page_token + * The next_page_token value returned from a previous List request, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\SshKey::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent containing the SSH keys. + * Currently, the only valid value for the location is "global". + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent containing the SSH keys. + * Currently, the only valid value for the location is "global". + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListSSHKeysResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListSSHKeysResponse.php new file mode 100644 index 000000000000..149698e30a9c --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListSSHKeysResponse.php @@ -0,0 +1,105 @@ +google.cloud.baremetalsolution.v2.ListSSHKeysResponse + */ +class ListSSHKeysResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The SSH keys registered in the project. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.SSHKey ssh_keys = 1; + */ + private $ssh_keys; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 90; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BareMetalSolution\V2\SSHKey>|\Google\Protobuf\Internal\RepeatedField $ssh_keys + * The SSH keys registered in the project. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\SshKey::initOnce(); + parent::__construct($data); + } + + /** + * The SSH keys registered in the project. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.SSHKey ssh_keys = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSshKeys() + { + return $this->ssh_keys; + } + + /** + * The SSH keys registered in the project. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.SSHKey ssh_keys = 1; + * @param array<\Google\Cloud\BareMetalSolution\V2\SSHKey>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSshKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\SSHKey::class); + $this->ssh_keys = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 90; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 90; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumeSnapshotsRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumeSnapshotsRequest.php new file mode 100644 index 000000000000..a867334d12c0 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumeSnapshotsRequest.php @@ -0,0 +1,153 @@ +google.cloud.baremetalsolution.v2.ListVolumeSnapshotsRequest + */ +class ListVolumeSnapshotsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListVolumesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Parent value for ListVolumesRequest. Please see + * {@see BareMetalSolutionClient::volumeName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\ListVolumeSnapshotsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListVolumesRequest. + * @type int $page_size + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results from the server. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\VolumeSnapshot::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListVolumesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListVolumesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumeSnapshotsResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumeSnapshotsResponse.php new file mode 100644 index 000000000000..0905ddc4a4e7 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumeSnapshotsResponse.php @@ -0,0 +1,135 @@ +google.cloud.baremetalsolution.v2.ListVolumeSnapshotsResponse + */ +class ListVolumeSnapshotsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of snapshots. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeSnapshot volume_snapshots = 1; + */ + private $volume_snapshots; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BareMetalSolution\V2\VolumeSnapshot>|\Google\Protobuf\Internal\RepeatedField $volume_snapshots + * The list of snapshots. + * @type string $next_page_token + * A token identifying a page of results from the server. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\VolumeSnapshot::initOnce(); + parent::__construct($data); + } + + /** + * The list of snapshots. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeSnapshot volume_snapshots = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumeSnapshots() + { + return $this->volume_snapshots; + } + + /** + * The list of snapshots. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeSnapshot volume_snapshots = 1; + * @param array<\Google\Cloud\BareMetalSolution\V2\VolumeSnapshot>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumeSnapshots($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\VolumeSnapshot::class); + $this->volume_snapshots = $arr; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumesRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumesRequest.php new file mode 100644 index 000000000000..cc4000006dcd --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumesRequest.php @@ -0,0 +1,187 @@ +google.cloud.baremetalsolution.v2.ListVolumesRequest + */ +class ListVolumesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListVolumesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + + /** + * @param string $parent Required. Parent value for ListVolumesRequest. Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\ListVolumesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListVolumesRequest. + * @type int $page_size + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results from the server. + * @type string $filter + * List filter. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Volume::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListVolumesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListVolumesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. The server might return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumesResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumesResponse.php new file mode 100644 index 000000000000..c6df4005c656 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ListVolumesResponse.php @@ -0,0 +1,135 @@ +google.cloud.baremetalsolution.v2.ListVolumesResponse + */ +class ListVolumesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of storage volumes. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Volume volumes = 1; + */ + private $volumes; + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BareMetalSolution\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * The list of storage volumes. + * @type string $next_page_token + * A token identifying a page of results from the server. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Volume::initOnce(); + parent::__construct($data); + } + + /** + * The list of storage volumes. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Volume volumes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * The list of storage volumes. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.Volume volumes = 1; + * @param array<\Google\Cloud\BareMetalSolution\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results from the server. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/LogicalInterface.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/LogicalInterface.php new file mode 100644 index 000000000000..b5f309a88f6c --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/LogicalInterface.php @@ -0,0 +1,151 @@ +google.cloud.baremetalsolution.v2.LogicalInterface + */ +class LogicalInterface extends \Google\Protobuf\Internal\Message +{ + /** + * List of logical network interfaces within a logical interface. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.LogicalInterface.LogicalNetworkInterface logical_network_interfaces = 1; + */ + private $logical_network_interfaces; + /** + * Interface name. This is of syntax or and + * forms part of the network template name. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * The index of the logical interface mapping to the index of the hardware + * bond or nic on the chosen network template. This field is deprecated. + * + * Generated from protobuf field int32 interface_index = 3 [deprecated = true]; + * @deprecated + */ + protected $interface_index = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BareMetalSolution\V2\LogicalInterface\LogicalNetworkInterface>|\Google\Protobuf\Internal\RepeatedField $logical_network_interfaces + * List of logical network interfaces within a logical interface. + * @type string $name + * Interface name. This is of syntax or and + * forms part of the network template name. + * @type int $interface_index + * The index of the logical interface mapping to the index of the hardware + * bond or nic on the chosen network template. This field is deprecated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * List of logical network interfaces within a logical interface. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.LogicalInterface.LogicalNetworkInterface logical_network_interfaces = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogicalNetworkInterfaces() + { + return $this->logical_network_interfaces; + } + + /** + * List of logical network interfaces within a logical interface. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.LogicalInterface.LogicalNetworkInterface logical_network_interfaces = 1; + * @param array<\Google\Cloud\BareMetalSolution\V2\LogicalInterface\LogicalNetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogicalNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\LogicalInterface\LogicalNetworkInterface::class); + $this->logical_network_interfaces = $arr; + + return $this; + } + + /** + * Interface name. This is of syntax or and + * forms part of the network template name. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Interface name. This is of syntax or and + * forms part of the network template name. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The index of the logical interface mapping to the index of the hardware + * bond or nic on the chosen network template. This field is deprecated. + * + * Generated from protobuf field int32 interface_index = 3 [deprecated = true]; + * @return int + * @deprecated + */ + public function getInterfaceIndex() + { + @trigger_error('interface_index is deprecated.', E_USER_DEPRECATED); + return $this->interface_index; + } + + /** + * The index of the logical interface mapping to the index of the hardware + * bond or nic on the chosen network template. This field is deprecated. + * + * Generated from protobuf field int32 interface_index = 3 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setInterfaceIndex($var) + { + @trigger_error('interface_index is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkInt32($var); + $this->interface_index = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/LogicalInterface/LogicalNetworkInterface.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/LogicalInterface/LogicalNetworkInterface.php new file mode 100644 index 000000000000..f4de9eae30d7 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/LogicalInterface/LogicalNetworkInterface.php @@ -0,0 +1,210 @@ +google.cloud.baremetalsolution.v2.LogicalInterface.LogicalNetworkInterface + */ +class LogicalNetworkInterface extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network + * + * Generated from protobuf field string network = 1; + */ + protected $network = ''; + /** + * IP address in the network + * + * Generated from protobuf field string ip_address = 2; + */ + protected $ip_address = ''; + /** + * Whether this interface is the default gateway for the instance. Only + * one interface can be the default gateway for the instance. + * + * Generated from protobuf field bool default_gateway = 3; + */ + protected $default_gateway = false; + /** + * Type of network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network.Type network_type = 4; + */ + protected $network_type = 0; + /** + * An identifier for the `Network`, generated by the backend. + * + * Generated from protobuf field string id = 5; + */ + protected $id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Name of the network + * @type string $ip_address + * IP address in the network + * @type bool $default_gateway + * Whether this interface is the default gateway for the instance. Only + * one interface can be the default gateway for the instance. + * @type int $network_type + * Type of network. + * @type string $id + * An identifier for the `Network`, generated by the backend. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * Name of the network + * + * Generated from protobuf field string network = 1; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Name of the network + * + * Generated from protobuf field string network = 1; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * IP address in the network + * + * Generated from protobuf field string ip_address = 2; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * IP address in the network + * + * Generated from protobuf field string ip_address = 2; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * Whether this interface is the default gateway for the instance. Only + * one interface can be the default gateway for the instance. + * + * Generated from protobuf field bool default_gateway = 3; + * @return bool + */ + public function getDefaultGateway() + { + return $this->default_gateway; + } + + /** + * Whether this interface is the default gateway for the instance. Only + * one interface can be the default gateway for the instance. + * + * Generated from protobuf field bool default_gateway = 3; + * @param bool $var + * @return $this + */ + public function setDefaultGateway($var) + { + GPBUtil::checkBool($var); + $this->default_gateway = $var; + + return $this; + } + + /** + * Type of network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network.Type network_type = 4; + * @return int + */ + public function getNetworkType() + { + return $this->network_type; + } + + /** + * Type of network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network.Type network_type = 4; + * @param int $var + * @return $this + */ + public function setNetworkType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Network\Type::class); + $this->network_type = $var; + + return $this; + } + + /** + * An identifier for the `Network`, generated by the backend. + * + * Generated from protobuf field string id = 5; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * An identifier for the `Network`, generated by the backend. + * + * Generated from protobuf field string id = 5; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LogicalNetworkInterface::class, \Google\Cloud\BareMetalSolution\V2\LogicalInterface_LogicalNetworkInterface::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun.php new file mode 100644 index 000000000000..d7d50ce6f8ba --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun.php @@ -0,0 +1,459 @@ +google.cloud.baremetalsolution.v2.Lun + */ +class Lun extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the LUN. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * An identifier for the LUN, generated by the backend. + * + * Generated from protobuf field string id = 10; + */ + protected $id = ''; + /** + * The state of this storage volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Lun.State state = 2; + */ + protected $state = 0; + /** + * The size of this LUN, in gigabytes. + * + * Generated from protobuf field int64 size_gb = 3; + */ + protected $size_gb = 0; + /** + * The LUN multiprotocol type ensures the characteristics of the LUN are + * optimized for each operating system. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Lun.MultiprotocolType multiprotocol_type = 4; + */ + protected $multiprotocol_type = 0; + /** + * Display the storage volume for this LUN. + * + * Generated from protobuf field string storage_volume = 5 [(.google.api.resource_reference) = { + */ + protected $storage_volume = ''; + /** + * Display if this LUN can be shared between multiple physical servers. + * + * Generated from protobuf field bool shareable = 6; + */ + protected $shareable = false; + /** + * Display if this LUN is a boot LUN. + * + * Generated from protobuf field bool boot_lun = 7; + */ + protected $boot_lun = false; + /** + * The storage type for this LUN. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Lun.StorageType storage_type = 8; + */ + protected $storage_type = 0; + /** + * The WWID for this LUN. + * + * Generated from protobuf field string wwid = 9; + */ + protected $wwid = ''; + /** + * Output only. Time after which LUN will be fully deleted. + * It is filled only for LUNs in COOL_OFF state. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Output only. Instances this Lun is attached to. + * + * Generated from protobuf field repeated string instances = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the LUN. + * @type string $id + * An identifier for the LUN, generated by the backend. + * @type int $state + * The state of this storage volume. + * @type int|string $size_gb + * The size of this LUN, in gigabytes. + * @type int $multiprotocol_type + * The LUN multiprotocol type ensures the characteristics of the LUN are + * optimized for each operating system. + * @type string $storage_volume + * Display the storage volume for this LUN. + * @type bool $shareable + * Display if this LUN can be shared between multiple physical servers. + * @type bool $boot_lun + * Display if this LUN is a boot LUN. + * @type int $storage_type + * The storage type for this LUN. + * @type string $wwid + * The WWID for this LUN. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. Time after which LUN will be fully deleted. + * It is filled only for LUNs in COOL_OFF state. + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * Output only. Instances this Lun is attached to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Lun::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the LUN. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the LUN. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * An identifier for the LUN, generated by the backend. + * + * Generated from protobuf field string id = 10; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * An identifier for the LUN, generated by the backend. + * + * Generated from protobuf field string id = 10; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The state of this storage volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Lun.State state = 2; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of this storage volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Lun.State state = 2; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Lun\State::class); + $this->state = $var; + + return $this; + } + + /** + * The size of this LUN, in gigabytes. + * + * Generated from protobuf field int64 size_gb = 3; + * @return int|string + */ + public function getSizeGb() + { + return $this->size_gb; + } + + /** + * The size of this LUN, in gigabytes. + * + * Generated from protobuf field int64 size_gb = 3; + * @param int|string $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->size_gb = $var; + + return $this; + } + + /** + * The LUN multiprotocol type ensures the characteristics of the LUN are + * optimized for each operating system. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Lun.MultiprotocolType multiprotocol_type = 4; + * @return int + */ + public function getMultiprotocolType() + { + return $this->multiprotocol_type; + } + + /** + * The LUN multiprotocol type ensures the characteristics of the LUN are + * optimized for each operating system. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Lun.MultiprotocolType multiprotocol_type = 4; + * @param int $var + * @return $this + */ + public function setMultiprotocolType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Lun\MultiprotocolType::class); + $this->multiprotocol_type = $var; + + return $this; + } + + /** + * Display the storage volume for this LUN. + * + * Generated from protobuf field string storage_volume = 5 [(.google.api.resource_reference) = { + * @return string + */ + public function getStorageVolume() + { + return $this->storage_volume; + } + + /** + * Display the storage volume for this LUN. + * + * Generated from protobuf field string storage_volume = 5 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setStorageVolume($var) + { + GPBUtil::checkString($var, True); + $this->storage_volume = $var; + + return $this; + } + + /** + * Display if this LUN can be shared between multiple physical servers. + * + * Generated from protobuf field bool shareable = 6; + * @return bool + */ + public function getShareable() + { + return $this->shareable; + } + + /** + * Display if this LUN can be shared between multiple physical servers. + * + * Generated from protobuf field bool shareable = 6; + * @param bool $var + * @return $this + */ + public function setShareable($var) + { + GPBUtil::checkBool($var); + $this->shareable = $var; + + return $this; + } + + /** + * Display if this LUN is a boot LUN. + * + * Generated from protobuf field bool boot_lun = 7; + * @return bool + */ + public function getBootLun() + { + return $this->boot_lun; + } + + /** + * Display if this LUN is a boot LUN. + * + * Generated from protobuf field bool boot_lun = 7; + * @param bool $var + * @return $this + */ + public function setBootLun($var) + { + GPBUtil::checkBool($var); + $this->boot_lun = $var; + + return $this; + } + + /** + * The storage type for this LUN. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Lun.StorageType storage_type = 8; + * @return int + */ + public function getStorageType() + { + return $this->storage_type; + } + + /** + * The storage type for this LUN. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Lun.StorageType storage_type = 8; + * @param int $var + * @return $this + */ + public function setStorageType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Lun\StorageType::class); + $this->storage_type = $var; + + return $this; + } + + /** + * The WWID for this LUN. + * + * Generated from protobuf field string wwid = 9; + * @return string + */ + public function getWwid() + { + return $this->wwid; + } + + /** + * The WWID for this LUN. + * + * Generated from protobuf field string wwid = 9; + * @param string $var + * @return $this + */ + public function setWwid($var) + { + GPBUtil::checkString($var, True); + $this->wwid = $var; + + return $this; + } + + /** + * Output only. Time after which LUN will be fully deleted. + * It is filled only for LUNs in COOL_OFF state. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. Time after which LUN will be fully deleted. + * It is filled only for LUNs in COOL_OFF state. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. Instances this Lun is attached to. + * + * Generated from protobuf field repeated string instances = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Output only. Instances this Lun is attached to. + * + * Generated from protobuf field repeated string instances = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun/MultiprotocolType.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun/MultiprotocolType.php new file mode 100644 index 000000000000..c9390ce09906 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun/MultiprotocolType.php @@ -0,0 +1,57 @@ +google.cloud.baremetalsolution.v2.Lun.MultiprotocolType + */ +class MultiprotocolType +{ + /** + * Server has no OS specified. + * + * Generated from protobuf enum MULTIPROTOCOL_TYPE_UNSPECIFIED = 0; + */ + const MULTIPROTOCOL_TYPE_UNSPECIFIED = 0; + /** + * Server with Linux OS. + * + * Generated from protobuf enum LINUX = 1; + */ + const LINUX = 1; + + private static $valueToName = [ + self::MULTIPROTOCOL_TYPE_UNSPECIFIED => 'MULTIPROTOCOL_TYPE_UNSPECIFIED', + self::LINUX => 'LINUX', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MultiprotocolType::class, \Google\Cloud\BareMetalSolution\V2\Lun_MultiprotocolType::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun/State.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun/State.php new file mode 100644 index 000000000000..0d226c388658 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun/State.php @@ -0,0 +1,85 @@ +google.cloud.baremetalsolution.v2.Lun.State + */ +class State +{ + /** + * The LUN is in an unknown state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The LUN is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The LUN is being updated. + * + * Generated from protobuf enum UPDATING = 2; + */ + const UPDATING = 2; + /** + * The LUN is ready for use. + * + * Generated from protobuf enum READY = 3; + */ + const READY = 3; + /** + * The LUN has been requested to be deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * The LUN is in cool off state. It will be deleted after `expire_time`. + * + * Generated from protobuf enum COOL_OFF = 5; + */ + const COOL_OFF = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::UPDATING => 'UPDATING', + self::READY => 'READY', + self::DELETING => 'DELETING', + self::COOL_OFF => 'COOL_OFF', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BareMetalSolution\V2\Lun_State::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun/StorageType.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun/StorageType.php new file mode 100644 index 000000000000..f6896f77e408 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Lun/StorageType.php @@ -0,0 +1,64 @@ +google.cloud.baremetalsolution.v2.Lun.StorageType + */ +class StorageType +{ + /** + * The storage type for this LUN is unknown. + * + * Generated from protobuf enum STORAGE_TYPE_UNSPECIFIED = 0; + */ + const STORAGE_TYPE_UNSPECIFIED = 0; + /** + * This storage type for this LUN is SSD. + * + * Generated from protobuf enum SSD = 1; + */ + const SSD = 1; + /** + * This storage type for this LUN is HDD. + * + * Generated from protobuf enum HDD = 2; + */ + const HDD = 2; + + private static $valueToName = [ + self::STORAGE_TYPE_UNSPECIFIED => 'STORAGE_TYPE_UNSPECIFIED', + self::SSD => 'SSD', + self::HDD => 'HDD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StorageType::class, \Google\Cloud\BareMetalSolution\V2\Lun_StorageType::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Network.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Network.php new file mode 100644 index 000000000000..22f2706398da --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Network.php @@ -0,0 +1,611 @@ +google.cloud.baremetalsolution.v2.Network + */ +class Network extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of this `Network`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/networks/{network}` + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * An identifier for the `Network`, generated by the backend. + * + * Generated from protobuf field string id = 10; + */ + protected $id = ''; + /** + * The type of this network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network.Type type = 2; + */ + protected $type = 0; + /** + * IP address configured. + * + * Generated from protobuf field string ip_address = 3; + */ + protected $ip_address = ''; + /** + * List of physical interfaces. + * + * Generated from protobuf field repeated string mac_address = 4; + */ + private $mac_address; + /** + * The Network state. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network.State state = 6; + */ + protected $state = 0; + /** + * The vlan id of the Network. + * + * Generated from protobuf field string vlan_id = 7; + */ + protected $vlan_id = ''; + /** + * The cidr of the Network. + * + * Generated from protobuf field string cidr = 8; + */ + protected $cidr = ''; + /** + * The vrf for the Network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF vrf = 9; + */ + protected $vrf = null; + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 11; + */ + private $labels; + /** + * IP range for reserved for services (e.g. NFS). + * + * Generated from protobuf field string services_cidr = 12; + */ + protected $services_cidr = ''; + /** + * List of IP address reservations in this network. + * When updating this field, an error will be generated if a reservation + * conflicts with an IP address already allocated to a physical server. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13; + */ + private $reservations; + /** + * Output only. Pod name. + * + * Generated from protobuf field string pod = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $pod = ''; + /** + * Input only. List of mount points to attach the network to. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkMountPoint mount_points = 15 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private $mount_points; + /** + * Whether network uses standard frames or jumbo ones. + * + * Generated from protobuf field bool jumbo_frames_enabled = 16; + */ + protected $jumbo_frames_enabled = false; + /** + * Output only. Gateway ip address. + * + * Generated from protobuf field string gateway_ip = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $gateway_ip = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of this `Network`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/networks/{network}` + * @type string $id + * An identifier for the `Network`, generated by the backend. + * @type int $type + * The type of this network. + * @type string $ip_address + * IP address configured. + * @type array|\Google\Protobuf\Internal\RepeatedField $mac_address + * List of physical interfaces. + * @type int $state + * The Network state. + * @type string $vlan_id + * The vlan id of the Network. + * @type string $cidr + * The cidr of the Network. + * @type \Google\Cloud\BareMetalSolution\V2\VRF $vrf + * The vrf for the Network. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs. + * @type string $services_cidr + * IP range for reserved for services (e.g. NFS). + * @type array<\Google\Cloud\BareMetalSolution\V2\NetworkAddressReservation>|\Google\Protobuf\Internal\RepeatedField $reservations + * List of IP address reservations in this network. + * When updating this field, an error will be generated if a reservation + * conflicts with an IP address already allocated to a physical server. + * @type string $pod + * Output only. Pod name. + * @type array<\Google\Cloud\BareMetalSolution\V2\NetworkMountPoint>|\Google\Protobuf\Internal\RepeatedField $mount_points + * Input only. List of mount points to attach the network to. + * @type bool $jumbo_frames_enabled + * Whether network uses standard frames or jumbo ones. + * @type string $gateway_ip + * Output only. Gateway ip address. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of this `Network`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/networks/{network}` + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of this `Network`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/networks/{network}` + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * An identifier for the `Network`, generated by the backend. + * + * Generated from protobuf field string id = 10; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * An identifier for the `Network`, generated by the backend. + * + * Generated from protobuf field string id = 10; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The type of this network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network.Type type = 2; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of this network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network.Type type = 2; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Network\Type::class); + $this->type = $var; + + return $this; + } + + /** + * IP address configured. + * + * Generated from protobuf field string ip_address = 3; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * IP address configured. + * + * Generated from protobuf field string ip_address = 3; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * List of physical interfaces. + * + * Generated from protobuf field repeated string mac_address = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMacAddress() + { + return $this->mac_address; + } + + /** + * List of physical interfaces. + * + * Generated from protobuf field repeated string mac_address = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMacAddress($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->mac_address = $arr; + + return $this; + } + + /** + * The Network state. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network.State state = 6; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The Network state. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network.State state = 6; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Network\State::class); + $this->state = $var; + + return $this; + } + + /** + * The vlan id of the Network. + * + * Generated from protobuf field string vlan_id = 7; + * @return string + */ + public function getVlanId() + { + return $this->vlan_id; + } + + /** + * The vlan id of the Network. + * + * Generated from protobuf field string vlan_id = 7; + * @param string $var + * @return $this + */ + public function setVlanId($var) + { + GPBUtil::checkString($var, True); + $this->vlan_id = $var; + + return $this; + } + + /** + * The cidr of the Network. + * + * Generated from protobuf field string cidr = 8; + * @return string + */ + public function getCidr() + { + return $this->cidr; + } + + /** + * The cidr of the Network. + * + * Generated from protobuf field string cidr = 8; + * @param string $var + * @return $this + */ + public function setCidr($var) + { + GPBUtil::checkString($var, True); + $this->cidr = $var; + + return $this; + } + + /** + * The vrf for the Network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF vrf = 9; + * @return \Google\Cloud\BareMetalSolution\V2\VRF|null + */ + public function getVrf() + { + return $this->vrf; + } + + public function hasVrf() + { + return isset($this->vrf); + } + + public function clearVrf() + { + unset($this->vrf); + } + + /** + * The vrf for the Network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF vrf = 9; + * @param \Google\Cloud\BareMetalSolution\V2\VRF $var + * @return $this + */ + public function setVrf($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\VRF::class); + $this->vrf = $var; + + return $this; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 11; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 11; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * IP range for reserved for services (e.g. NFS). + * + * Generated from protobuf field string services_cidr = 12; + * @return string + */ + public function getServicesCidr() + { + return $this->services_cidr; + } + + /** + * IP range for reserved for services (e.g. NFS). + * + * Generated from protobuf field string services_cidr = 12; + * @param string $var + * @return $this + */ + public function setServicesCidr($var) + { + GPBUtil::checkString($var, True); + $this->services_cidr = $var; + + return $this; + } + + /** + * List of IP address reservations in this network. + * When updating this field, an error will be generated if a reservation + * conflicts with an IP address already allocated to a physical server. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReservations() + { + return $this->reservations; + } + + /** + * List of IP address reservations in this network. + * When updating this field, an error will be generated if a reservation + * conflicts with an IP address already allocated to a physical server. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13; + * @param array<\Google\Cloud\BareMetalSolution\V2\NetworkAddressReservation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReservations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\NetworkAddressReservation::class); + $this->reservations = $arr; + + return $this; + } + + /** + * Output only. Pod name. + * + * Generated from protobuf field string pod = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPod() + { + return $this->pod; + } + + /** + * Output only. Pod name. + * + * Generated from protobuf field string pod = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPod($var) + { + GPBUtil::checkString($var, True); + $this->pod = $var; + + return $this; + } + + /** + * Input only. List of mount points to attach the network to. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkMountPoint mount_points = 15 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMountPoints() + { + return $this->mount_points; + } + + /** + * Input only. List of mount points to attach the network to. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkMountPoint mount_points = 15 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param array<\Google\Cloud\BareMetalSolution\V2\NetworkMountPoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMountPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\NetworkMountPoint::class); + $this->mount_points = $arr; + + return $this; + } + + /** + * Whether network uses standard frames or jumbo ones. + * + * Generated from protobuf field bool jumbo_frames_enabled = 16; + * @return bool + */ + public function getJumboFramesEnabled() + { + return $this->jumbo_frames_enabled; + } + + /** + * Whether network uses standard frames or jumbo ones. + * + * Generated from protobuf field bool jumbo_frames_enabled = 16; + * @param bool $var + * @return $this + */ + public function setJumboFramesEnabled($var) + { + GPBUtil::checkBool($var); + $this->jumbo_frames_enabled = $var; + + return $this; + } + + /** + * Output only. Gateway ip address. + * + * Generated from protobuf field string gateway_ip = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getGatewayIp() + { + return $this->gateway_ip; + } + + /** + * Output only. Gateway ip address. + * + * Generated from protobuf field string gateway_ip = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setGatewayIp($var) + { + GPBUtil::checkString($var, True); + $this->gateway_ip = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Network/State.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Network/State.php new file mode 100644 index 000000000000..461eaa871ee6 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Network/State.php @@ -0,0 +1,78 @@ +google.cloud.baremetalsolution.v2.Network.State + */ +class State +{ + /** + * The Network is in an unknown state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The Network is provisioning. + * + * Generated from protobuf enum PROVISIONING = 1; + */ + const PROVISIONING = 1; + /** + * The Network has been provisioned. + * + * Generated from protobuf enum PROVISIONED = 2; + */ + const PROVISIONED = 2; + /** + * The Network is being deprovisioned. + * + * Generated from protobuf enum DEPROVISIONING = 3; + */ + const DEPROVISIONING = 3; + /** + * The Network is being updated. + * + * Generated from protobuf enum UPDATING = 4; + */ + const UPDATING = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PROVISIONING => 'PROVISIONING', + self::PROVISIONED => 'PROVISIONED', + self::DEPROVISIONING => 'DEPROVISIONING', + self::UPDATING => 'UPDATING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BareMetalSolution\V2\Network_State::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Network/Type.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Network/Type.php new file mode 100644 index 000000000000..5b7a71e8a639 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Network/Type.php @@ -0,0 +1,68 @@ +google.cloud.baremetalsolution.v2.Network.Type + */ +class Type +{ + /** + * Unspecified value. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Client network, a network peered to a Google Cloud VPC. + * + * Generated from protobuf enum CLIENT = 1; + */ + const CLIENT = 1; + /** + * Private network, a network local to the Bare Metal Solution environment. + * + * Generated from protobuf enum PRIVATE = 2; + */ + const PBPRIVATE = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::CLIENT => 'CLIENT', + self::PBPRIVATE => 'PRIVATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\BareMetalSolution\V2\Network_Type::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkAddressReservation.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkAddressReservation.php new file mode 100644 index 000000000000..e9164232774a --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkAddressReservation.php @@ -0,0 +1,151 @@ +google.cloud.baremetalsolution.v2.NetworkAddressReservation + */ +class NetworkAddressReservation extends \Google\Protobuf\Internal\Message +{ + /** + * The first address of this reservation block. + * Must be specified as a single IPv4 address, e.g. 10.1.2.2. + * + * Generated from protobuf field string start_address = 1; + */ + protected $start_address = ''; + /** + * The last address of this reservation block, inclusive. I.e., for cases when + * reservations are only single addresses, end_address and start_address will + * be the same. + * Must be specified as a single IPv4 address, e.g. 10.1.2.2. + * + * Generated from protobuf field string end_address = 2; + */ + protected $end_address = ''; + /** + * A note about this reservation, intended for human consumption. + * + * Generated from protobuf field string note = 3; + */ + protected $note = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $start_address + * The first address of this reservation block. + * Must be specified as a single IPv4 address, e.g. 10.1.2.2. + * @type string $end_address + * The last address of this reservation block, inclusive. I.e., for cases when + * reservations are only single addresses, end_address and start_address will + * be the same. + * Must be specified as a single IPv4 address, e.g. 10.1.2.2. + * @type string $note + * A note about this reservation, intended for human consumption. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * The first address of this reservation block. + * Must be specified as a single IPv4 address, e.g. 10.1.2.2. + * + * Generated from protobuf field string start_address = 1; + * @return string + */ + public function getStartAddress() + { + return $this->start_address; + } + + /** + * The first address of this reservation block. + * Must be specified as a single IPv4 address, e.g. 10.1.2.2. + * + * Generated from protobuf field string start_address = 1; + * @param string $var + * @return $this + */ + public function setStartAddress($var) + { + GPBUtil::checkString($var, True); + $this->start_address = $var; + + return $this; + } + + /** + * The last address of this reservation block, inclusive. I.e., for cases when + * reservations are only single addresses, end_address and start_address will + * be the same. + * Must be specified as a single IPv4 address, e.g. 10.1.2.2. + * + * Generated from protobuf field string end_address = 2; + * @return string + */ + public function getEndAddress() + { + return $this->end_address; + } + + /** + * The last address of this reservation block, inclusive. I.e., for cases when + * reservations are only single addresses, end_address and start_address will + * be the same. + * Must be specified as a single IPv4 address, e.g. 10.1.2.2. + * + * Generated from protobuf field string end_address = 2; + * @param string $var + * @return $this + */ + public function setEndAddress($var) + { + GPBUtil::checkString($var, True); + $this->end_address = $var; + + return $this; + } + + /** + * A note about this reservation, intended for human consumption. + * + * Generated from protobuf field string note = 3; + * @return string + */ + public function getNote() + { + return $this->note; + } + + /** + * A note about this reservation, intended for human consumption. + * + * Generated from protobuf field string note = 3; + * @param string $var + * @return $this + */ + public function setNote($var) + { + GPBUtil::checkString($var, True); + $this->note = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig.php new file mode 100644 index 000000000000..85659bf9e249 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig.php @@ -0,0 +1,423 @@ +google.cloud.baremetalsolution.v2.NetworkConfig + */ +class NetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the network config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * A transient unique identifier to identify a volume within an + * ProvisioningConfig request. + * + * Generated from protobuf field string id = 2; + */ + protected $id = ''; + /** + * The type of this network, either Client or Private. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NetworkConfig.Type type = 3; + */ + protected $type = 0; + /** + * Interconnect bandwidth. Set only when type is CLIENT. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NetworkConfig.Bandwidth bandwidth = 4; + */ + protected $bandwidth = 0; + /** + * List of VLAN attachments. As of now there are always 2 attachments, but it + * is going to change in the future (multi vlan). + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkConfig.IntakeVlanAttachment vlan_attachments = 5; + */ + private $vlan_attachments; + /** + * CIDR range of the network. + * + * Generated from protobuf field string cidr = 6; + */ + protected $cidr = ''; + /** + * Service CIDR, if any. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NetworkConfig.ServiceCidr service_cidr = 7; + */ + protected $service_cidr = 0; + /** + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * + * Generated from protobuf field string user_note = 8; + */ + protected $user_note = ''; + /** + * The GCP service of the network. Available gcp_service are in + * https://cloud.google.com/bare-metal/docs/bms-planning. + * + * Generated from protobuf field string gcp_service = 9; + */ + protected $gcp_service = ''; + /** + * Whether the VLAN attachment pair is located in the same project. + * + * Generated from protobuf field bool vlan_same_project = 10; + */ + protected $vlan_same_project = false; + /** + * The JumboFramesEnabled option for customer to set. + * + * Generated from protobuf field bool jumbo_frames_enabled = 11; + */ + protected $jumbo_frames_enabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the network config. + * @type string $id + * A transient unique identifier to identify a volume within an + * ProvisioningConfig request. + * @type int $type + * The type of this network, either Client or Private. + * @type int $bandwidth + * Interconnect bandwidth. Set only when type is CLIENT. + * @type array<\Google\Cloud\BareMetalSolution\V2\NetworkConfig\IntakeVlanAttachment>|\Google\Protobuf\Internal\RepeatedField $vlan_attachments + * List of VLAN attachments. As of now there are always 2 attachments, but it + * is going to change in the future (multi vlan). + * @type string $cidr + * CIDR range of the network. + * @type int $service_cidr + * Service CIDR, if any. + * @type string $user_note + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * @type string $gcp_service + * The GCP service of the network. Available gcp_service are in + * https://cloud.google.com/bare-metal/docs/bms-planning. + * @type bool $vlan_same_project + * Whether the VLAN attachment pair is located in the same project. + * @type bool $jumbo_frames_enabled + * The JumboFramesEnabled option for customer to set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the network config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the network config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A transient unique identifier to identify a volume within an + * ProvisioningConfig request. + * + * Generated from protobuf field string id = 2; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * A transient unique identifier to identify a volume within an + * ProvisioningConfig request. + * + * Generated from protobuf field string id = 2; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The type of this network, either Client or Private. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NetworkConfig.Type type = 3; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of this network, either Client or Private. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NetworkConfig.Type type = 3; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\NetworkConfig\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Interconnect bandwidth. Set only when type is CLIENT. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NetworkConfig.Bandwidth bandwidth = 4; + * @return int + */ + public function getBandwidth() + { + return $this->bandwidth; + } + + /** + * Interconnect bandwidth. Set only when type is CLIENT. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NetworkConfig.Bandwidth bandwidth = 4; + * @param int $var + * @return $this + */ + public function setBandwidth($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\NetworkConfig\Bandwidth::class); + $this->bandwidth = $var; + + return $this; + } + + /** + * List of VLAN attachments. As of now there are always 2 attachments, but it + * is going to change in the future (multi vlan). + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkConfig.IntakeVlanAttachment vlan_attachments = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVlanAttachments() + { + return $this->vlan_attachments; + } + + /** + * List of VLAN attachments. As of now there are always 2 attachments, but it + * is going to change in the future (multi vlan). + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkConfig.IntakeVlanAttachment vlan_attachments = 5; + * @param array<\Google\Cloud\BareMetalSolution\V2\NetworkConfig\IntakeVlanAttachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVlanAttachments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\NetworkConfig\IntakeVlanAttachment::class); + $this->vlan_attachments = $arr; + + return $this; + } + + /** + * CIDR range of the network. + * + * Generated from protobuf field string cidr = 6; + * @return string + */ + public function getCidr() + { + return $this->cidr; + } + + /** + * CIDR range of the network. + * + * Generated from protobuf field string cidr = 6; + * @param string $var + * @return $this + */ + public function setCidr($var) + { + GPBUtil::checkString($var, True); + $this->cidr = $var; + + return $this; + } + + /** + * Service CIDR, if any. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NetworkConfig.ServiceCidr service_cidr = 7; + * @return int + */ + public function getServiceCidr() + { + return $this->service_cidr; + } + + /** + * Service CIDR, if any. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NetworkConfig.ServiceCidr service_cidr = 7; + * @param int $var + * @return $this + */ + public function setServiceCidr($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\NetworkConfig\ServiceCidr::class); + $this->service_cidr = $var; + + return $this; + } + + /** + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * + * Generated from protobuf field string user_note = 8; + * @return string + */ + public function getUserNote() + { + return $this->user_note; + } + + /** + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * + * Generated from protobuf field string user_note = 8; + * @param string $var + * @return $this + */ + public function setUserNote($var) + { + GPBUtil::checkString($var, True); + $this->user_note = $var; + + return $this; + } + + /** + * The GCP service of the network. Available gcp_service are in + * https://cloud.google.com/bare-metal/docs/bms-planning. + * + * Generated from protobuf field string gcp_service = 9; + * @return string + */ + public function getGcpService() + { + return $this->gcp_service; + } + + /** + * The GCP service of the network. Available gcp_service are in + * https://cloud.google.com/bare-metal/docs/bms-planning. + * + * Generated from protobuf field string gcp_service = 9; + * @param string $var + * @return $this + */ + public function setGcpService($var) + { + GPBUtil::checkString($var, True); + $this->gcp_service = $var; + + return $this; + } + + /** + * Whether the VLAN attachment pair is located in the same project. + * + * Generated from protobuf field bool vlan_same_project = 10; + * @return bool + */ + public function getVlanSameProject() + { + return $this->vlan_same_project; + } + + /** + * Whether the VLAN attachment pair is located in the same project. + * + * Generated from protobuf field bool vlan_same_project = 10; + * @param bool $var + * @return $this + */ + public function setVlanSameProject($var) + { + GPBUtil::checkBool($var); + $this->vlan_same_project = $var; + + return $this; + } + + /** + * The JumboFramesEnabled option for customer to set. + * + * Generated from protobuf field bool jumbo_frames_enabled = 11; + * @return bool + */ + public function getJumboFramesEnabled() + { + return $this->jumbo_frames_enabled; + } + + /** + * The JumboFramesEnabled option for customer to set. + * + * Generated from protobuf field bool jumbo_frames_enabled = 11; + * @param bool $var + * @return $this + */ + public function setJumboFramesEnabled($var) + { + GPBUtil::checkBool($var); + $this->jumbo_frames_enabled = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/Bandwidth.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/Bandwidth.php new file mode 100644 index 000000000000..b1f187f83d13 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/Bandwidth.php @@ -0,0 +1,78 @@ +google.cloud.baremetalsolution.v2.NetworkConfig.Bandwidth + */ +class Bandwidth +{ + /** + * Unspecified value. + * + * Generated from protobuf enum BANDWIDTH_UNSPECIFIED = 0; + */ + const BANDWIDTH_UNSPECIFIED = 0; + /** + * 1 Gbps. + * + * Generated from protobuf enum BW_1_GBPS = 1; + */ + const BW_1_GBPS = 1; + /** + * 2 Gbps. + * + * Generated from protobuf enum BW_2_GBPS = 2; + */ + const BW_2_GBPS = 2; + /** + * 5 Gbps. + * + * Generated from protobuf enum BW_5_GBPS = 3; + */ + const BW_5_GBPS = 3; + /** + * 10 Gbps. + * + * Generated from protobuf enum BW_10_GBPS = 4; + */ + const BW_10_GBPS = 4; + + private static $valueToName = [ + self::BANDWIDTH_UNSPECIFIED => 'BANDWIDTH_UNSPECIFIED', + self::BW_1_GBPS => 'BW_1_GBPS', + self::BW_2_GBPS => 'BW_2_GBPS', + self::BW_5_GBPS => 'BW_5_GBPS', + self::BW_10_GBPS => 'BW_10_GBPS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Bandwidth::class, \Google\Cloud\BareMetalSolution\V2\NetworkConfig_Bandwidth::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/IntakeVlanAttachment.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/IntakeVlanAttachment.php new file mode 100644 index 000000000000..3b6c74ad0653 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/IntakeVlanAttachment.php @@ -0,0 +1,104 @@ +google.cloud.baremetalsolution.v2.NetworkConfig.IntakeVlanAttachment + */ +class IntakeVlanAttachment extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier of the VLAN attachment. + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * Attachment pairing key. + * + * Generated from protobuf field string pairing_key = 2; + */ + protected $pairing_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Identifier of the VLAN attachment. + * @type string $pairing_key + * Attachment pairing key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Identifier of the VLAN attachment. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Identifier of the VLAN attachment. + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Attachment pairing key. + * + * Generated from protobuf field string pairing_key = 2; + * @return string + */ + public function getPairingKey() + { + return $this->pairing_key; + } + + /** + * Attachment pairing key. + * + * Generated from protobuf field string pairing_key = 2; + * @param string $var + * @return $this + */ + public function setPairingKey($var) + { + GPBUtil::checkString($var, True); + $this->pairing_key = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IntakeVlanAttachment::class, \Google\Cloud\BareMetalSolution\V2\NetworkConfig_IntakeVlanAttachment::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/ServiceCidr.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/ServiceCidr.php new file mode 100644 index 000000000000..fef9ef5310e5 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/ServiceCidr.php @@ -0,0 +1,78 @@ +google.cloud.baremetalsolution.v2.NetworkConfig.ServiceCidr + */ +class ServiceCidr +{ + /** + * Unspecified value. + * + * Generated from protobuf enum SERVICE_CIDR_UNSPECIFIED = 0; + */ + const SERVICE_CIDR_UNSPECIFIED = 0; + /** + * Services are disabled for the given network. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * Use the highest /26 block of the network to host services. + * + * Generated from protobuf enum HIGH_26 = 2; + */ + const HIGH_26 = 2; + /** + * Use the highest /27 block of the network to host services. + * + * Generated from protobuf enum HIGH_27 = 3; + */ + const HIGH_27 = 3; + /** + * Use the highest /28 block of the network to host services. + * + * Generated from protobuf enum HIGH_28 = 4; + */ + const HIGH_28 = 4; + + private static $valueToName = [ + self::SERVICE_CIDR_UNSPECIFIED => 'SERVICE_CIDR_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::HIGH_26 => 'HIGH_26', + self::HIGH_27 => 'HIGH_27', + self::HIGH_28 => 'HIGH_28', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ServiceCidr::class, \Google\Cloud\BareMetalSolution\V2\NetworkConfig_ServiceCidr::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/Type.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/Type.php new file mode 100644 index 000000000000..7ad2e6357a0f --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkConfig/Type.php @@ -0,0 +1,68 @@ +google.cloud.baremetalsolution.v2.NetworkConfig.Type + */ +class Type +{ + /** + * Unspecified value. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Client network, that is a network peered to a GCP VPC. + * + * Generated from protobuf enum CLIENT = 1; + */ + const CLIENT = 1; + /** + * Private network, that is a network local to the BMS POD. + * + * Generated from protobuf enum PRIVATE = 2; + */ + const PBPRIVATE = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::CLIENT => 'CLIENT', + self::PBPRIVATE => 'PRIVATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\BareMetalSolution\V2\NetworkConfig_Type::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkMountPoint.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkMountPoint.php new file mode 100644 index 000000000000..a147b3f1fa57 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkMountPoint.php @@ -0,0 +1,169 @@ +google.cloud.baremetalsolution.v2.NetworkMountPoint + */ +class NetworkMountPoint extends \Google\Protobuf\Internal\Message +{ + /** + * Instance to attach network to. + * + * Generated from protobuf field string instance = 1 [(.google.api.resource_reference) = { + */ + protected $instance = ''; + /** + * Logical interface to detach from. + * + * Generated from protobuf field string logical_interface = 2; + */ + protected $logical_interface = ''; + /** + * Network should be a default gateway. + * + * Generated from protobuf field bool default_gateway = 3; + */ + protected $default_gateway = false; + /** + * Ip address of the server. + * + * Generated from protobuf field string ip_address = 4; + */ + protected $ip_address = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Instance to attach network to. + * @type string $logical_interface + * Logical interface to detach from. + * @type bool $default_gateway + * Network should be a default gateway. + * @type string $ip_address + * Ip address of the server. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * Instance to attach network to. + * + * Generated from protobuf field string instance = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Instance to attach network to. + * + * Generated from protobuf field string instance = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Logical interface to detach from. + * + * Generated from protobuf field string logical_interface = 2; + * @return string + */ + public function getLogicalInterface() + { + return $this->logical_interface; + } + + /** + * Logical interface to detach from. + * + * Generated from protobuf field string logical_interface = 2; + * @param string $var + * @return $this + */ + public function setLogicalInterface($var) + { + GPBUtil::checkString($var, True); + $this->logical_interface = $var; + + return $this; + } + + /** + * Network should be a default gateway. + * + * Generated from protobuf field bool default_gateway = 3; + * @return bool + */ + public function getDefaultGateway() + { + return $this->default_gateway; + } + + /** + * Network should be a default gateway. + * + * Generated from protobuf field bool default_gateway = 3; + * @param bool $var + * @return $this + */ + public function setDefaultGateway($var) + { + GPBUtil::checkBool($var); + $this->default_gateway = $var; + + return $this; + } + + /** + * Ip address of the server. + * + * Generated from protobuf field string ip_address = 4; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * Ip address of the server. + * + * Generated from protobuf field string ip_address = 4; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkUsage.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkUsage.php new file mode 100644 index 000000000000..789ec3aa94c0 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NetworkUsage.php @@ -0,0 +1,111 @@ +google.cloud.baremetalsolution.v2.NetworkUsage + */ +class NetworkUsage extends \Google\Protobuf\Internal\Message +{ + /** + * Network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network network = 1; + */ + protected $network = null; + /** + * All used IP addresses in this network. + * + * Generated from protobuf field repeated string used_ips = 2; + */ + private $used_ips; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BareMetalSolution\V2\Network $network + * Network. + * @type array|\Google\Protobuf\Internal\RepeatedField $used_ips + * All used IP addresses in this network. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * Network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network network = 1; + * @return \Google\Cloud\BareMetalSolution\V2\Network|null + */ + public function getNetwork() + { + return $this->network; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * Network. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network network = 1; + * @param \Google\Cloud\BareMetalSolution\V2\Network $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\Network::class); + $this->network = $var; + + return $this; + } + + /** + * All used IP addresses in this network. + * + * Generated from protobuf field repeated string used_ips = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsedIps() + { + return $this->used_ips; + } + + /** + * All used IP addresses in this network. + * + * Generated from protobuf field repeated string used_ips = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsedIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->used_ips = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare.php new file mode 100644 index 000000000000..2362d9d26764 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare.php @@ -0,0 +1,351 @@ +google.cloud.baremetalsolution.v2.NfsShare + */ +class NfsShare extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The name of the NFS share. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Output only. An identifier for the NFS share, generated by the backend. + * This field will be deprecated in the future, use `id` instead. + * + * Generated from protobuf field string nfs_share_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $nfs_share_id = ''; + /** + * Output only. An identifier for the NFS share, generated by the backend. + * This is the same value as nfs_share_id and will replace it in the future. + * + * Generated from protobuf field string id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $id = ''; + /** + * Output only. The state of the NFS share. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The underlying volume of the share. Created automatically + * during provisioning. + * + * Generated from protobuf field string volume = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $volume = ''; + /** + * List of allowed access points. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NfsShare.AllowedClient allowed_clients = 5; + */ + private $allowed_clients; + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 6; + */ + private $labels; + /** + * The requested size, in GiB. + * + * Generated from protobuf field int64 requested_size_gib = 7; + */ + protected $requested_size_gib = 0; + /** + * Immutable. The storage type of the underlying volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare.StorageType storage_type = 9 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $storage_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The name of the NFS share. + * @type string $nfs_share_id + * Output only. An identifier for the NFS share, generated by the backend. + * This field will be deprecated in the future, use `id` instead. + * @type string $id + * Output only. An identifier for the NFS share, generated by the backend. + * This is the same value as nfs_share_id and will replace it in the future. + * @type int $state + * Output only. The state of the NFS share. + * @type string $volume + * Output only. The underlying volume of the share. Created automatically + * during provisioning. + * @type array<\Google\Cloud\BareMetalSolution\V2\NfsShare\AllowedClient>|\Google\Protobuf\Internal\RepeatedField $allowed_clients + * List of allowed access points. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs. + * @type int|string $requested_size_gib + * The requested size, in GiB. + * @type int $storage_type + * Immutable. The storage type of the underlying volume. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\NfsShare::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The name of the NFS share. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The name of the NFS share. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. An identifier for the NFS share, generated by the backend. + * This field will be deprecated in the future, use `id` instead. + * + * Generated from protobuf field string nfs_share_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNfsShareId() + { + return $this->nfs_share_id; + } + + /** + * Output only. An identifier for the NFS share, generated by the backend. + * This field will be deprecated in the future, use `id` instead. + * + * Generated from protobuf field string nfs_share_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNfsShareId($var) + { + GPBUtil::checkString($var, True); + $this->nfs_share_id = $var; + + return $this; + } + + /** + * Output only. An identifier for the NFS share, generated by the backend. + * This is the same value as nfs_share_id and will replace it in the future. + * + * Generated from protobuf field string id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Output only. An identifier for the NFS share, generated by the backend. + * This is the same value as nfs_share_id and will replace it in the future. + * + * Generated from protobuf field string id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Output only. The state of the NFS share. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the NFS share. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\NfsShare\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The underlying volume of the share. Created automatically + * during provisioning. + * + * Generated from protobuf field string volume = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getVolume() + { + return $this->volume; + } + + /** + * Output only. The underlying volume of the share. Created automatically + * during provisioning. + * + * Generated from protobuf field string volume = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setVolume($var) + { + GPBUtil::checkString($var, True); + $this->volume = $var; + + return $this; + } + + /** + * List of allowed access points. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NfsShare.AllowedClient allowed_clients = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedClients() + { + return $this->allowed_clients; + } + + /** + * List of allowed access points. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NfsShare.AllowedClient allowed_clients = 5; + * @param array<\Google\Cloud\BareMetalSolution\V2\NfsShare\AllowedClient>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedClients($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\NfsShare\AllowedClient::class); + $this->allowed_clients = $arr; + + return $this; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 6; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The requested size, in GiB. + * + * Generated from protobuf field int64 requested_size_gib = 7; + * @return int|string + */ + public function getRequestedSizeGib() + { + return $this->requested_size_gib; + } + + /** + * The requested size, in GiB. + * + * Generated from protobuf field int64 requested_size_gib = 7; + * @param int|string $var + * @return $this + */ + public function setRequestedSizeGib($var) + { + GPBUtil::checkInt64($var); + $this->requested_size_gib = $var; + + return $this; + } + + /** + * Immutable. The storage type of the underlying volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare.StorageType storage_type = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getStorageType() + { + return $this->storage_type; + } + + /** + * Immutable. The storage type of the underlying volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare.StorageType storage_type = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setStorageType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\NfsShare\StorageType::class); + $this->storage_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/AllowedClient.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/AllowedClient.php new file mode 100644 index 000000000000..392194acd694 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/AllowedClient.php @@ -0,0 +1,328 @@ +google.cloud.baremetalsolution.v2.NfsShare.AllowedClient + */ +class AllowedClient extends \Google\Protobuf\Internal\Message +{ + /** + * The network the access point sits on. + * + * Generated from protobuf field string network = 1 [(.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Output only. The IP address of the share on this network. Assigned + * automatically during provisioning based on the network's services_cidr. + * + * Generated from protobuf field string share_ip = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $share_ip = ''; + /** + * The subnet of IP addresses permitted to access the share. + * + * Generated from protobuf field string allowed_clients_cidr = 3; + */ + protected $allowed_clients_cidr = ''; + /** + * Mount permissions. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare.MountPermissions mount_permissions = 4; + */ + protected $mount_permissions = 0; + /** + * Allow dev flag. Which controls whether to allow creation of devices. + * + * Generated from protobuf field bool allow_dev = 5; + */ + protected $allow_dev = false; + /** + * Allow the setuid flag. + * + * Generated from protobuf field bool allow_suid = 6; + */ + protected $allow_suid = false; + /** + * Disable root squashing, which is a feature of NFS. + * Root squash is a special mapping of the remote superuser (root) identity + * when using identity authentication. + * + * Generated from protobuf field bool no_root_squash = 7; + */ + protected $no_root_squash = false; + /** + * Output only. The path to access NFS, in format shareIP:/InstanceID + * InstanceID is the generated ID instead of customer provided name. + * example like "10.0.0.0:/g123456789-nfs001" + * + * Generated from protobuf field string nfs_path = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $nfs_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * The network the access point sits on. + * @type string $share_ip + * Output only. The IP address of the share on this network. Assigned + * automatically during provisioning based on the network's services_cidr. + * @type string $allowed_clients_cidr + * The subnet of IP addresses permitted to access the share. + * @type int $mount_permissions + * Mount permissions. + * @type bool $allow_dev + * Allow dev flag. Which controls whether to allow creation of devices. + * @type bool $allow_suid + * Allow the setuid flag. + * @type bool $no_root_squash + * Disable root squashing, which is a feature of NFS. + * Root squash is a special mapping of the remote superuser (root) identity + * when using identity authentication. + * @type string $nfs_path + * Output only. The path to access NFS, in format shareIP:/InstanceID + * InstanceID is the generated ID instead of customer provided name. + * example like "10.0.0.0:/g123456789-nfs001" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\NfsShare::initOnce(); + parent::__construct($data); + } + + /** + * The network the access point sits on. + * + * Generated from protobuf field string network = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * The network the access point sits on. + * + * Generated from protobuf field string network = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Output only. The IP address of the share on this network. Assigned + * automatically during provisioning based on the network's services_cidr. + * + * Generated from protobuf field string share_ip = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getShareIp() + { + return $this->share_ip; + } + + /** + * Output only. The IP address of the share on this network. Assigned + * automatically during provisioning based on the network's services_cidr. + * + * Generated from protobuf field string share_ip = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setShareIp($var) + { + GPBUtil::checkString($var, True); + $this->share_ip = $var; + + return $this; + } + + /** + * The subnet of IP addresses permitted to access the share. + * + * Generated from protobuf field string allowed_clients_cidr = 3; + * @return string + */ + public function getAllowedClientsCidr() + { + return $this->allowed_clients_cidr; + } + + /** + * The subnet of IP addresses permitted to access the share. + * + * Generated from protobuf field string allowed_clients_cidr = 3; + * @param string $var + * @return $this + */ + public function setAllowedClientsCidr($var) + { + GPBUtil::checkString($var, True); + $this->allowed_clients_cidr = $var; + + return $this; + } + + /** + * Mount permissions. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare.MountPermissions mount_permissions = 4; + * @return int + */ + public function getMountPermissions() + { + return $this->mount_permissions; + } + + /** + * Mount permissions. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare.MountPermissions mount_permissions = 4; + * @param int $var + * @return $this + */ + public function setMountPermissions($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\NfsShare\MountPermissions::class); + $this->mount_permissions = $var; + + return $this; + } + + /** + * Allow dev flag. Which controls whether to allow creation of devices. + * + * Generated from protobuf field bool allow_dev = 5; + * @return bool + */ + public function getAllowDev() + { + return $this->allow_dev; + } + + /** + * Allow dev flag. Which controls whether to allow creation of devices. + * + * Generated from protobuf field bool allow_dev = 5; + * @param bool $var + * @return $this + */ + public function setAllowDev($var) + { + GPBUtil::checkBool($var); + $this->allow_dev = $var; + + return $this; + } + + /** + * Allow the setuid flag. + * + * Generated from protobuf field bool allow_suid = 6; + * @return bool + */ + public function getAllowSuid() + { + return $this->allow_suid; + } + + /** + * Allow the setuid flag. + * + * Generated from protobuf field bool allow_suid = 6; + * @param bool $var + * @return $this + */ + public function setAllowSuid($var) + { + GPBUtil::checkBool($var); + $this->allow_suid = $var; + + return $this; + } + + /** + * Disable root squashing, which is a feature of NFS. + * Root squash is a special mapping of the remote superuser (root) identity + * when using identity authentication. + * + * Generated from protobuf field bool no_root_squash = 7; + * @return bool + */ + public function getNoRootSquash() + { + return $this->no_root_squash; + } + + /** + * Disable root squashing, which is a feature of NFS. + * Root squash is a special mapping of the remote superuser (root) identity + * when using identity authentication. + * + * Generated from protobuf field bool no_root_squash = 7; + * @param bool $var + * @return $this + */ + public function setNoRootSquash($var) + { + GPBUtil::checkBool($var); + $this->no_root_squash = $var; + + return $this; + } + + /** + * Output only. The path to access NFS, in format shareIP:/InstanceID + * InstanceID is the generated ID instead of customer provided name. + * example like "10.0.0.0:/g123456789-nfs001" + * + * Generated from protobuf field string nfs_path = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNfsPath() + { + return $this->nfs_path; + } + + /** + * Output only. The path to access NFS, in format shareIP:/InstanceID + * InstanceID is the generated ID instead of customer provided name. + * example like "10.0.0.0:/g123456789-nfs001" + * + * Generated from protobuf field string nfs_path = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNfsPath($var) + { + GPBUtil::checkString($var, True); + $this->nfs_path = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowedClient::class, \Google\Cloud\BareMetalSolution\V2\NfsShare_AllowedClient::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/MountPermissions.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/MountPermissions.php new file mode 100644 index 000000000000..dadf339aea7f --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/MountPermissions.php @@ -0,0 +1,64 @@ +google.cloud.baremetalsolution.v2.NfsShare.MountPermissions + */ +class MountPermissions +{ + /** + * Permissions were not specified. + * + * Generated from protobuf enum MOUNT_PERMISSIONS_UNSPECIFIED = 0; + */ + const MOUNT_PERMISSIONS_UNSPECIFIED = 0; + /** + * NFS share can be mount with read-only permissions. + * + * Generated from protobuf enum READ = 1; + */ + const READ = 1; + /** + * NFS share can be mount with read-write permissions. + * + * Generated from protobuf enum READ_WRITE = 2; + */ + const READ_WRITE = 2; + + private static $valueToName = [ + self::MOUNT_PERMISSIONS_UNSPECIFIED => 'MOUNT_PERMISSIONS_UNSPECIFIED', + self::READ => 'READ', + self::READ_WRITE => 'READ_WRITE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MountPermissions::class, \Google\Cloud\BareMetalSolution\V2\NfsShare_MountPermissions::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/State.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/State.php new file mode 100644 index 000000000000..33726a32ec7b --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/State.php @@ -0,0 +1,78 @@ +google.cloud.baremetalsolution.v2.NfsShare.State + */ +class State +{ + /** + * The share is in an unknown state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The share has been provisioned. + * + * Generated from protobuf enum PROVISIONED = 1; + */ + const PROVISIONED = 1; + /** + * The NFS Share is being created. + * + * Generated from protobuf enum CREATING = 2; + */ + const CREATING = 2; + /** + * The NFS Share is being updated. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * The NFS Share has been requested to be deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PROVISIONED => 'PROVISIONED', + self::CREATING => 'CREATING', + self::UPDATING => 'UPDATING', + self::DELETING => 'DELETING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BareMetalSolution\V2\NfsShare_State::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/StorageType.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/StorageType.php new file mode 100644 index 000000000000..3d002a9bee9f --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/NfsShare/StorageType.php @@ -0,0 +1,64 @@ +google.cloud.baremetalsolution.v2.NfsShare.StorageType + */ +class StorageType +{ + /** + * The storage type for this volume is unknown. + * + * Generated from protobuf enum STORAGE_TYPE_UNSPECIFIED = 0; + */ + const STORAGE_TYPE_UNSPECIFIED = 0; + /** + * The storage type for this volume is SSD. + * + * Generated from protobuf enum SSD = 1; + */ + const SSD = 1; + /** + * This storage type for this volume is HDD. + * + * Generated from protobuf enum HDD = 2; + */ + const HDD = 2; + + private static $valueToName = [ + self::STORAGE_TYPE_UNSPECIFIED => 'STORAGE_TYPE_UNSPECIFIED', + self::SSD => 'SSD', + self::HDD => 'HDD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StorageType::class, \Google\Cloud\BareMetalSolution\V2\NfsShare_StorageType::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/OSImage.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/OSImage.php new file mode 100644 index 000000000000..46442969f67e --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/OSImage.php @@ -0,0 +1,211 @@ +google.cloud.baremetalsolution.v2.OSImage + */ +class OSImage extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. OS Image's unique name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * OS Image code. + * + * Generated from protobuf field string code = 2; + */ + protected $code = ''; + /** + * OS Image description. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * Instance types this image is applicable to. + * [Available + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field repeated string applicable_instance_types = 4; + */ + private $applicable_instance_types; + /** + * Network templates that can be used with this OS Image. + * + * Generated from protobuf field repeated string supported_network_templates = 5; + */ + private $supported_network_templates; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. OS Image's unique name. + * @type string $code + * OS Image code. + * @type string $description + * OS Image description. + * @type array|\Google\Protobuf\Internal\RepeatedField $applicable_instance_types + * Instance types this image is applicable to. + * [Available + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * @type array|\Google\Protobuf\Internal\RepeatedField $supported_network_templates + * Network templates that can be used with this OS Image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Osimage::initOnce(); + parent::__construct($data); + } + + /** + * Output only. OS Image's unique name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. OS Image's unique name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * OS Image code. + * + * Generated from protobuf field string code = 2; + * @return string + */ + public function getCode() + { + return $this->code; + } + + /** + * OS Image code. + * + * Generated from protobuf field string code = 2; + * @param string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkString($var, True); + $this->code = $var; + + return $this; + } + + /** + * OS Image description. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * OS Image description. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Instance types this image is applicable to. + * [Available + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field repeated string applicable_instance_types = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getApplicableInstanceTypes() + { + return $this->applicable_instance_types; + } + + /** + * Instance types this image is applicable to. + * [Available + * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations) + * + * Generated from protobuf field repeated string applicable_instance_types = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setApplicableInstanceTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->applicable_instance_types = $arr; + + return $this; + } + + /** + * Network templates that can be used with this OS Image. + * + * Generated from protobuf field repeated string supported_network_templates = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedNetworkTemplates() + { + return $this->supported_network_templates; + } + + /** + * Network templates that can be used with this OS Image. + * + * Generated from protobuf field repeated string supported_network_templates = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedNetworkTemplates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->supported_network_templates = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/OperationMetadata.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/OperationMetadata.php new file mode 100644 index 000000000000..e6061c8bf259 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.baremetalsolution.v2.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the action executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user requested the cancellation + * of the operation. Operations that have been successfully cancelled + * have [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]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used with the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the action executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user requested the cancellation + * of the operation. Operations that have been successfully cancelled + * have [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 with the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Baremetalsolution::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the action executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the action executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user requested the cancellation + * of the operation. Operations that have been successfully cancelled + * have [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 + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user requested the cancellation + * of the operation. Operations that have been successfully cancelled + * have [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 + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used with the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used with the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningConfig.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningConfig.php new file mode 100644 index 000000000000..9aedd8c65bfa --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningConfig.php @@ -0,0 +1,540 @@ +google.cloud.baremetalsolution.v2.ProvisioningConfig + */ +class ProvisioningConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The system-generated name of the provisioning config. This + * follows the UUID format. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Instances to be created. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.InstanceConfig instances = 2; + */ + private $instances; + /** + * Networks to be created. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkConfig networks = 3; + */ + private $networks; + /** + * Volumes to be created. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeConfig volumes = 4; + */ + private $volumes; + /** + * A generated ticket id to track provisioning request. + * + * Generated from protobuf field string ticket_id = 5; + */ + protected $ticket_id = ''; + /** + * A service account to enable customers to access instance credentials upon + * handover. + * + * Generated from protobuf field string handover_service_account = 6; + */ + protected $handover_service_account = ''; + /** + * Email provided to send a confirmation with provisioning config to. + * Deprecated in favour of email field in request messages. + * + * Generated from protobuf field string email = 7 [deprecated = true]; + * @deprecated + */ + protected $email = ''; + /** + * Output only. State of ProvisioningConfig. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. Location name of this ProvisioningConfig. + * It is optional only for Intake UI transition period. + * + * Generated from protobuf field string location = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $location = ''; + /** + * Output only. Last update timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. URI to Cloud Console UI view of this provisioning config. + * + * Generated from protobuf field string cloud_console_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $cloud_console_uri = ''; + /** + * If true, VPC SC is enabled for the cluster. + * + * Generated from protobuf field bool vpc_sc_enabled = 12; + */ + protected $vpc_sc_enabled = false; + /** + * Optional status messages associated with the FAILED state. + * + * Generated from protobuf field string status_message = 13; + */ + protected $status_message = ''; + /** + * Optional. The user-defined identifier of the provisioning config. + * + * Generated from protobuf field string custom_id = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $custom_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The system-generated name of the provisioning config. This + * follows the UUID format. + * @type array<\Google\Cloud\BareMetalSolution\V2\InstanceConfig>|\Google\Protobuf\Internal\RepeatedField $instances + * Instances to be created. + * @type array<\Google\Cloud\BareMetalSolution\V2\NetworkConfig>|\Google\Protobuf\Internal\RepeatedField $networks + * Networks to be created. + * @type array<\Google\Cloud\BareMetalSolution\V2\VolumeConfig>|\Google\Protobuf\Internal\RepeatedField $volumes + * Volumes to be created. + * @type string $ticket_id + * A generated ticket id to track provisioning request. + * @type string $handover_service_account + * A service account to enable customers to access instance credentials upon + * handover. + * @type string $email + * Email provided to send a confirmation with provisioning config to. + * Deprecated in favour of email field in request messages. + * @type int $state + * Output only. State of ProvisioningConfig. + * @type string $location + * Optional. Location name of this ProvisioningConfig. + * It is optional only for Intake UI transition period. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Last update timestamp. + * @type string $cloud_console_uri + * Output only. URI to Cloud Console UI view of this provisioning config. + * @type bool $vpc_sc_enabled + * If true, VPC SC is enabled for the cluster. + * @type string $status_message + * Optional status messages associated with the FAILED state. + * @type string $custom_id + * Optional. The user-defined identifier of the provisioning config. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The system-generated name of the provisioning config. This + * follows the UUID format. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The system-generated name of the provisioning config. This + * follows the UUID format. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Instances to be created. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.InstanceConfig instances = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Instances to be created. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.InstanceConfig instances = 2; + * @param array<\Google\Cloud\BareMetalSolution\V2\InstanceConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\InstanceConfig::class); + $this->instances = $arr; + + return $this; + } + + /** + * Networks to be created. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkConfig networks = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworks() + { + return $this->networks; + } + + /** + * Networks to be created. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.NetworkConfig networks = 3; + * @param array<\Google\Cloud\BareMetalSolution\V2\NetworkConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\NetworkConfig::class); + $this->networks = $arr; + + return $this; + } + + /** + * Volumes to be created. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeConfig volumes = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * Volumes to be created. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeConfig volumes = 4; + * @param array<\Google\Cloud\BareMetalSolution\V2\VolumeConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\VolumeConfig::class); + $this->volumes = $arr; + + return $this; + } + + /** + * A generated ticket id to track provisioning request. + * + * Generated from protobuf field string ticket_id = 5; + * @return string + */ + public function getTicketId() + { + return $this->ticket_id; + } + + /** + * A generated ticket id to track provisioning request. + * + * Generated from protobuf field string ticket_id = 5; + * @param string $var + * @return $this + */ + public function setTicketId($var) + { + GPBUtil::checkString($var, True); + $this->ticket_id = $var; + + return $this; + } + + /** + * A service account to enable customers to access instance credentials upon + * handover. + * + * Generated from protobuf field string handover_service_account = 6; + * @return string + */ + public function getHandoverServiceAccount() + { + return $this->handover_service_account; + } + + /** + * A service account to enable customers to access instance credentials upon + * handover. + * + * Generated from protobuf field string handover_service_account = 6; + * @param string $var + * @return $this + */ + public function setHandoverServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->handover_service_account = $var; + + return $this; + } + + /** + * Email provided to send a confirmation with provisioning config to. + * Deprecated in favour of email field in request messages. + * + * Generated from protobuf field string email = 7 [deprecated = true]; + * @return string + * @deprecated + */ + public function getEmail() + { + @trigger_error('email is deprecated.', E_USER_DEPRECATED); + return $this->email; + } + + /** + * Email provided to send a confirmation with provisioning config to. + * Deprecated in favour of email field in request messages. + * + * Generated from protobuf field string email = 7 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setEmail($var) + { + @trigger_error('email is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * Output only. State of ProvisioningConfig. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of ProvisioningConfig. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Location name of this ProvisioningConfig. + * It is optional only for Intake UI transition period. + * + * Generated from protobuf field string location = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Optional. Location name of this ProvisioningConfig. + * It is optional only for Intake UI transition period. + * + * Generated from protobuf field string location = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Output only. Last update timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Last update timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. URI to Cloud Console UI view of this provisioning config. + * + * Generated from protobuf field string cloud_console_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCloudConsoleUri() + { + return $this->cloud_console_uri; + } + + /** + * Output only. URI to Cloud Console UI view of this provisioning config. + * + * Generated from protobuf field string cloud_console_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCloudConsoleUri($var) + { + GPBUtil::checkString($var, True); + $this->cloud_console_uri = $var; + + return $this; + } + + /** + * If true, VPC SC is enabled for the cluster. + * + * Generated from protobuf field bool vpc_sc_enabled = 12; + * @return bool + */ + public function getVpcScEnabled() + { + return $this->vpc_sc_enabled; + } + + /** + * If true, VPC SC is enabled for the cluster. + * + * Generated from protobuf field bool vpc_sc_enabled = 12; + * @param bool $var + * @return $this + */ + public function setVpcScEnabled($var) + { + GPBUtil::checkBool($var); + $this->vpc_sc_enabled = $var; + + return $this; + } + + /** + * Optional status messages associated with the FAILED state. + * + * Generated from protobuf field string status_message = 13; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Optional status messages associated with the FAILED state. + * + * Generated from protobuf field string status_message = 13; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Optional. The user-defined identifier of the provisioning config. + * + * Generated from protobuf field string custom_id = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCustomId() + { + return $this->custom_id; + } + + /** + * Optional. The user-defined identifier of the provisioning config. + * + * Generated from protobuf field string custom_id = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCustomId($var) + { + GPBUtil::checkString($var, True); + $this->custom_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningConfig/State.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningConfig/State.php new file mode 100644 index 000000000000..227318e80823 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningConfig/State.php @@ -0,0 +1,102 @@ +google.cloud.baremetalsolution.v2.ProvisioningConfig.State + */ +class State +{ + /** + * State wasn't specified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * ProvisioningConfig is a draft and can be freely modified. + * + * Generated from protobuf enum DRAFT = 1; + */ + const DRAFT = 1; + /** + * ProvisioningConfig was already submitted and cannot be modified. + * + * Generated from protobuf enum SUBMITTED = 2; + */ + const SUBMITTED = 2; + /** + * ProvisioningConfig was in the provisioning state. Initially this state + * comes from the work order table in big query when SNOW is used. Later + * this field can be set by the work order API. + * + * Generated from protobuf enum PROVISIONING = 3; + */ + const PROVISIONING = 3; + /** + * ProvisioningConfig was provisioned, meaning the resources exist. + * + * Generated from protobuf enum PROVISIONED = 4; + */ + const PROVISIONED = 4; + /** + * ProvisioningConfig was validated. A validation tool will be run to + * set this state. + * + * Generated from protobuf enum VALIDATED = 5; + */ + const VALIDATED = 5; + /** + * ProvisioningConfig was canceled. + * + * Generated from protobuf enum CANCELLED = 6; + */ + const CANCELLED = 6; + /** + * The request is submitted for provisioning, with error return. + * + * Generated from protobuf enum FAILED = 7; + */ + const FAILED = 7; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::DRAFT => 'DRAFT', + self::SUBMITTED => 'SUBMITTED', + self::PROVISIONING => 'PROVISIONING', + self::PROVISIONED => 'PROVISIONED', + self::VALIDATED => 'VALIDATED', + self::CANCELLED => 'CANCELLED', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig_State::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningQuota.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningQuota.php new file mode 100644 index 000000000000..e93a6c0f70a2 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningQuota.php @@ -0,0 +1,353 @@ +google.cloud.baremetalsolution.v2.ProvisioningQuota + */ +class ProvisioningQuota extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the provisioning quota. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * The asset type of this provisioning quota. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningQuota.AssetType asset_type = 2; + */ + protected $asset_type = 0; + /** + * The gcp service of the provisioning quota. + * + * Generated from protobuf field string gcp_service = 3; + */ + protected $gcp_service = ''; + /** + * The specific location of the provisioining quota. + * + * Generated from protobuf field string location = 4; + */ + protected $location = ''; + /** + * The available count of the provisioning quota. + * + * Generated from protobuf field int32 available_count = 5; + */ + protected $available_count = 0; + protected $quota; + protected $availability; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the provisioning quota. + * @type int $asset_type + * The asset type of this provisioning quota. + * @type string $gcp_service + * The gcp service of the provisioning quota. + * @type string $location + * The specific location of the provisioining quota. + * @type int $available_count + * The available count of the provisioning quota. + * @type \Google\Cloud\BareMetalSolution\V2\InstanceQuota $instance_quota + * Instance quota. + * @type int|string $server_count + * Server count. + * @type int|string $network_bandwidth + * Network bandwidth, Gbps + * @type int|string $storage_gib + * Storage size (GB). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the provisioning quota. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the provisioning quota. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The asset type of this provisioning quota. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningQuota.AssetType asset_type = 2; + * @return int + */ + public function getAssetType() + { + return $this->asset_type; + } + + /** + * The asset type of this provisioning quota. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningQuota.AssetType asset_type = 2; + * @param int $var + * @return $this + */ + public function setAssetType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\ProvisioningQuota\AssetType::class); + $this->asset_type = $var; + + return $this; + } + + /** + * The gcp service of the provisioning quota. + * + * Generated from protobuf field string gcp_service = 3; + * @return string + */ + public function getGcpService() + { + return $this->gcp_service; + } + + /** + * The gcp service of the provisioning quota. + * + * Generated from protobuf field string gcp_service = 3; + * @param string $var + * @return $this + */ + public function setGcpService($var) + { + GPBUtil::checkString($var, True); + $this->gcp_service = $var; + + return $this; + } + + /** + * The specific location of the provisioining quota. + * + * Generated from protobuf field string location = 4; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * The specific location of the provisioining quota. + * + * Generated from protobuf field string location = 4; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * The available count of the provisioning quota. + * + * Generated from protobuf field int32 available_count = 5; + * @return int + */ + public function getAvailableCount() + { + return $this->available_count; + } + + /** + * The available count of the provisioning quota. + * + * Generated from protobuf field int32 available_count = 5; + * @param int $var + * @return $this + */ + public function setAvailableCount($var) + { + GPBUtil::checkInt32($var); + $this->available_count = $var; + + return $this; + } + + /** + * Instance quota. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.InstanceQuota instance_quota = 6; + * @return \Google\Cloud\BareMetalSolution\V2\InstanceQuota|null + */ + public function getInstanceQuota() + { + return $this->readOneof(6); + } + + public function hasInstanceQuota() + { + return $this->hasOneof(6); + } + + /** + * Instance quota. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.InstanceQuota instance_quota = 6; + * @param \Google\Cloud\BareMetalSolution\V2\InstanceQuota $var + * @return $this + */ + public function setInstanceQuota($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\InstanceQuota::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Server count. + * + * Generated from protobuf field int64 server_count = 7; + * @return int|string + */ + public function getServerCount() + { + return $this->readOneof(7); + } + + public function hasServerCount() + { + return $this->hasOneof(7); + } + + /** + * Server count. + * + * Generated from protobuf field int64 server_count = 7; + * @param int|string $var + * @return $this + */ + public function setServerCount($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Network bandwidth, Gbps + * + * Generated from protobuf field int64 network_bandwidth = 8; + * @return int|string + */ + public function getNetworkBandwidth() + { + return $this->readOneof(8); + } + + public function hasNetworkBandwidth() + { + return $this->hasOneof(8); + } + + /** + * Network bandwidth, Gbps + * + * Generated from protobuf field int64 network_bandwidth = 8; + * @param int|string $var + * @return $this + */ + public function setNetworkBandwidth($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Storage size (GB). + * + * Generated from protobuf field int64 storage_gib = 9; + * @return int|string + */ + public function getStorageGib() + { + return $this->readOneof(9); + } + + public function hasStorageGib() + { + return $this->hasOneof(9); + } + + /** + * Storage size (GB). + * + * Generated from protobuf field int64 storage_gib = 9; + * @param int|string $var + * @return $this + */ + public function setStorageGib($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * @return string + */ + public function getQuota() + { + return $this->whichOneof("quota"); + } + + /** + * @return string + */ + public function getAvailability() + { + return $this->whichOneof("availability"); + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningQuota/AssetType.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningQuota/AssetType.php new file mode 100644 index 000000000000..ed4619ec1e63 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ProvisioningQuota/AssetType.php @@ -0,0 +1,71 @@ +google.cloud.baremetalsolution.v2.ProvisioningQuota.AssetType + */ +class AssetType +{ + /** + * The unspecified type. + * + * Generated from protobuf enum ASSET_TYPE_UNSPECIFIED = 0; + */ + const ASSET_TYPE_UNSPECIFIED = 0; + /** + * The server asset type. + * + * Generated from protobuf enum ASSET_TYPE_SERVER = 1; + */ + const ASSET_TYPE_SERVER = 1; + /** + * The storage asset type. + * + * Generated from protobuf enum ASSET_TYPE_STORAGE = 2; + */ + const ASSET_TYPE_STORAGE = 2; + /** + * The network asset type. + * + * Generated from protobuf enum ASSET_TYPE_NETWORK = 3; + */ + const ASSET_TYPE_NETWORK = 3; + + private static $valueToName = [ + self::ASSET_TYPE_UNSPECIFIED => 'ASSET_TYPE_UNSPECIFIED', + self::ASSET_TYPE_SERVER => 'ASSET_TYPE_SERVER', + self::ASSET_TYPE_STORAGE => 'ASSET_TYPE_STORAGE', + self::ASSET_TYPE_NETWORK => 'ASSET_TYPE_NETWORK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AssetType::class, \Google\Cloud\BareMetalSolution\V2\ProvisioningQuota_AssetType::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameInstanceRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameInstanceRequest.php new file mode 100644 index 000000000000..168cff7da429 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameInstanceRequest.php @@ -0,0 +1,122 @@ +google.cloud.baremetalsolution.v2.RenameInstanceRequest + */ +class RenameInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `name` field is used to identify the instance. + * Format: projects/{project}/locations/{location}/instances/{instance} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The new `id` of the instance. + * + * Generated from protobuf field string new_instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $new_instance_id = ''; + + /** + * @param string $name Required. The `name` field is used to identify the instance. + * Format: projects/{project}/locations/{location}/instances/{instance} + * Please see {@see BareMetalSolutionClient::instanceName()} for help formatting this field. + * @param string $newInstanceId Required. The new `id` of the instance. + * + * @return \Google\Cloud\BareMetalSolution\V2\RenameInstanceRequest + * + * @experimental + */ + public static function build(string $name, string $newInstanceId): self + { + return (new self()) + ->setName($name) + ->setNewInstanceId($newInstanceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The `name` field is used to identify the instance. + * Format: projects/{project}/locations/{location}/instances/{instance} + * @type string $new_instance_id + * Required. The new `id` of the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `name` field is used to identify the instance. + * Format: projects/{project}/locations/{location}/instances/{instance} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The `name` field is used to identify the instance. + * Format: projects/{project}/locations/{location}/instances/{instance} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The new `id` of the instance. + * + * Generated from protobuf field string new_instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNewInstanceId() + { + return $this->new_instance_id; + } + + /** + * Required. The new `id` of the instance. + * + * Generated from protobuf field string new_instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNewInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->new_instance_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameNetworkRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameNetworkRequest.php new file mode 100644 index 000000000000..ee6b7a98640d --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameNetworkRequest.php @@ -0,0 +1,122 @@ +google.cloud.baremetalsolution.v2.RenameNetworkRequest + */ +class RenameNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `name` field is used to identify the network. + * Format: projects/{project}/locations/{location}/networks/{network} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The new `id` of the network. + * + * Generated from protobuf field string new_network_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $new_network_id = ''; + + /** + * @param string $name Required. The `name` field is used to identify the network. + * Format: projects/{project}/locations/{location}/networks/{network} + * Please see {@see BareMetalSolutionClient::networkName()} for help formatting this field. + * @param string $newNetworkId Required. The new `id` of the network. + * + * @return \Google\Cloud\BareMetalSolution\V2\RenameNetworkRequest + * + * @experimental + */ + public static function build(string $name, string $newNetworkId): self + { + return (new self()) + ->setName($name) + ->setNewNetworkId($newNetworkId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The `name` field is used to identify the network. + * Format: projects/{project}/locations/{location}/networks/{network} + * @type string $new_network_id + * Required. The new `id` of the network. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `name` field is used to identify the network. + * Format: projects/{project}/locations/{location}/networks/{network} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The `name` field is used to identify the network. + * Format: projects/{project}/locations/{location}/networks/{network} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The new `id` of the network. + * + * Generated from protobuf field string new_network_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNewNetworkId() + { + return $this->new_network_id; + } + + /** + * Required. The new `id` of the network. + * + * Generated from protobuf field string new_network_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNewNetworkId($var) + { + GPBUtil::checkString($var, True); + $this->new_network_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameNfsShareRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameNfsShareRequest.php new file mode 100644 index 000000000000..32c07a6d6213 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameNfsShareRequest.php @@ -0,0 +1,122 @@ +google.cloud.baremetalsolution.v2.RenameNfsShareRequest + */ +class RenameNfsShareRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `name` field is used to identify the nfsshare. + * Format: projects/{project}/locations/{location}/nfsshares/{nfsshare} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The new `id` of the nfsshare. + * + * Generated from protobuf field string new_nfsshare_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $new_nfsshare_id = ''; + + /** + * @param string $name Required. The `name` field is used to identify the nfsshare. + * Format: projects/{project}/locations/{location}/nfsshares/{nfsshare} + * Please see {@see BareMetalSolutionClient::nFSShareName()} for help formatting this field. + * @param string $newNfsshareId Required. The new `id` of the nfsshare. + * + * @return \Google\Cloud\BareMetalSolution\V2\RenameNfsShareRequest + * + * @experimental + */ + public static function build(string $name, string $newNfsshareId): self + { + return (new self()) + ->setName($name) + ->setNewNfsshareId($newNfsshareId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The `name` field is used to identify the nfsshare. + * Format: projects/{project}/locations/{location}/nfsshares/{nfsshare} + * @type string $new_nfsshare_id + * Required. The new `id` of the nfsshare. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\NfsShare::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `name` field is used to identify the nfsshare. + * Format: projects/{project}/locations/{location}/nfsshares/{nfsshare} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The `name` field is used to identify the nfsshare. + * Format: projects/{project}/locations/{location}/nfsshares/{nfsshare} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The new `id` of the nfsshare. + * + * Generated from protobuf field string new_nfsshare_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNewNfsshareId() + { + return $this->new_nfsshare_id; + } + + /** + * Required. The new `id` of the nfsshare. + * + * Generated from protobuf field string new_nfsshare_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNewNfsshareId($var) + { + GPBUtil::checkString($var, True); + $this->new_nfsshare_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameVolumeRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameVolumeRequest.php new file mode 100644 index 000000000000..c74a86a8d25b --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RenameVolumeRequest.php @@ -0,0 +1,122 @@ +google.cloud.baremetalsolution.v2.RenameVolumeRequest + */ +class RenameVolumeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `name` field is used to identify the volume. + * Format: projects/{project}/locations/{location}/volumes/{volume} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The new `id` of the volume. + * + * Generated from protobuf field string new_volume_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $new_volume_id = ''; + + /** + * @param string $name Required. The `name` field is used to identify the volume. + * Format: projects/{project}/locations/{location}/volumes/{volume} + * Please see {@see BareMetalSolutionClient::volumeName()} for help formatting this field. + * @param string $newVolumeId Required. The new `id` of the volume. + * + * @return \Google\Cloud\BareMetalSolution\V2\RenameVolumeRequest + * + * @experimental + */ + public static function build(string $name, string $newVolumeId): self + { + return (new self()) + ->setName($name) + ->setNewVolumeId($newVolumeId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The `name` field is used to identify the volume. + * Format: projects/{project}/locations/{location}/volumes/{volume} + * @type string $new_volume_id + * Required. The new `id` of the volume. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Volume::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `name` field is used to identify the volume. + * Format: projects/{project}/locations/{location}/volumes/{volume} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The `name` field is used to identify the volume. + * Format: projects/{project}/locations/{location}/volumes/{volume} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The new `id` of the volume. + * + * Generated from protobuf field string new_volume_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNewVolumeId() + { + return $this->new_volume_id; + } + + /** + * Required. The new `id` of the volume. + * + * Generated from protobuf field string new_volume_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNewVolumeId($var) + { + GPBUtil::checkString($var, True); + $this->new_volume_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ResetInstanceRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ResetInstanceRequest.php new file mode 100644 index 000000000000..fad5d2770386 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ResetInstanceRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.ResetInstanceRequest + */ +class ResetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BareMetalSolutionClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\ResetInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ResetInstanceResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ResetInstanceResponse.php new file mode 100644 index 000000000000..013bd1cf5868 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ResetInstanceResponse.php @@ -0,0 +1,33 @@ +google.cloud.baremetalsolution.v2.ResetInstanceResponse + */ +class ResetInstanceResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Baremetalsolution::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ResizeVolumeRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ResizeVolumeRequest.php new file mode 100644 index 000000000000..7cb2d386c502 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ResizeVolumeRequest.php @@ -0,0 +1,117 @@ +google.cloud.baremetalsolution.v2.ResizeVolumeRequest + */ +class ResizeVolumeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Volume to resize. + * + * Generated from protobuf field string volume = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $volume = ''; + /** + * New Volume size, in GiB. + * + * Generated from protobuf field int64 size_gib = 2; + */ + protected $size_gib = 0; + + /** + * @param string $volume Required. Volume to resize. Please see + * {@see BareMetalSolutionClient::volumeName()} for help formatting this field. + * @param int $sizeGib New Volume size, in GiB. + * + * @return \Google\Cloud\BareMetalSolution\V2\ResizeVolumeRequest + * + * @experimental + */ + public static function build(string $volume, int $sizeGib): self + { + return (new self()) + ->setVolume($volume) + ->setSizeGib($sizeGib); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $volume + * Required. Volume to resize. + * @type int|string $size_gib + * New Volume size, in GiB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Volume::initOnce(); + parent::__construct($data); + } + + /** + * Required. Volume to resize. + * + * Generated from protobuf field string volume = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getVolume() + { + return $this->volume; + } + + /** + * Required. Volume to resize. + * + * Generated from protobuf field string volume = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setVolume($var) + { + GPBUtil::checkString($var, True); + $this->volume = $var; + + return $this; + } + + /** + * New Volume size, in GiB. + * + * Generated from protobuf field int64 size_gib = 2; + * @return int|string + */ + public function getSizeGib() + { + return $this->size_gib; + } + + /** + * New Volume size, in GiB. + * + * Generated from protobuf field int64 size_gib = 2; + * @param int|string $var + * @return $this + */ + public function setSizeGib($var) + { + GPBUtil::checkInt64($var); + $this->size_gib = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RestoreVolumeSnapshotRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RestoreVolumeSnapshotRequest.php new file mode 100644 index 000000000000..2f0b9e7c7fff --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/RestoreVolumeSnapshotRequest.php @@ -0,0 +1,86 @@ +google.cloud.baremetalsolution.v2.RestoreVolumeSnapshotRequest + */ +class RestoreVolumeSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the snapshot which will be used to restore its parent + * volume. + * + * Generated from protobuf field string volume_snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $volume_snapshot = ''; + + /** + * @param string $volumeSnapshot Required. Name of the snapshot which will be used to restore its parent + * volume. Please see + * {@see BareMetalSolutionClient::volumeSnapshotName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\RestoreVolumeSnapshotRequest + * + * @experimental + */ + public static function build(string $volumeSnapshot): self + { + return (new self()) + ->setVolumeSnapshot($volumeSnapshot); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $volume_snapshot + * Required. Name of the snapshot which will be used to restore its parent + * volume. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\VolumeSnapshot::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the snapshot which will be used to restore its parent + * volume. + * + * Generated from protobuf field string volume_snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getVolumeSnapshot() + { + return $this->volume_snapshot; + } + + /** + * Required. Name of the snapshot which will be used to restore its parent + * volume. + * + * Generated from protobuf field string volume_snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setVolumeSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->volume_snapshot = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/SSHKey.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/SSHKey.php new file mode 100644 index 000000000000..f219549b1c98 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/SSHKey.php @@ -0,0 +1,105 @@ +google.cloud.baremetalsolution.v2.SSHKey + */ +class SSHKey extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of this SSH key. + * Currently, the only valid value for the location is "global". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * The public SSH key. This must be in OpenSSH .authorized_keys format. + * + * Generated from protobuf field string public_key = 2; + */ + protected $public_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of this SSH key. + * Currently, the only valid value for the location is "global". + * @type string $public_key + * The public SSH key. This must be in OpenSSH .authorized_keys format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\SshKey::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of this SSH key. + * Currently, the only valid value for the location is "global". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of this SSH key. + * Currently, the only valid value for the location is "global". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The public SSH key. This must be in OpenSSH .authorized_keys format. + * + * Generated from protobuf field string public_key = 2; + * @return string + */ + public function getPublicKey() + { + return $this->public_key; + } + + /** + * The public SSH key. This must be in OpenSSH .authorized_keys format. + * + * Generated from protobuf field string public_key = 2; + * @param string $var + * @return $this + */ + public function setPublicKey($var) + { + GPBUtil::checkString($var, True); + $this->public_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ServerNetworkTemplate.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ServerNetworkTemplate.php new file mode 100644 index 000000000000..9374bd6b1e69 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ServerNetworkTemplate.php @@ -0,0 +1,151 @@ +google.cloud.baremetalsolution.v2.ServerNetworkTemplate + */ +class ServerNetworkTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Template's unique name. The full resource name follows the + * pattern: + * `projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}` + * Generally, the {server_network_template} follows the syntax of + * "bond" or "nic". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Instance types this template is applicable to. + * + * Generated from protobuf field repeated string applicable_instance_types = 2; + */ + private $applicable_instance_types; + /** + * Logical interfaces. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.ServerNetworkTemplate.LogicalInterface logical_interfaces = 3; + */ + private $logical_interfaces; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Template's unique name. The full resource name follows the + * pattern: + * `projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}` + * Generally, the {server_network_template} follows the syntax of + * "bond" or "nic". + * @type array|\Google\Protobuf\Internal\RepeatedField $applicable_instance_types + * Instance types this template is applicable to. + * @type array<\Google\Cloud\BareMetalSolution\V2\ServerNetworkTemplate\LogicalInterface>|\Google\Protobuf\Internal\RepeatedField $logical_interfaces + * Logical interfaces. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Template's unique name. The full resource name follows the + * pattern: + * `projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}` + * Generally, the {server_network_template} follows the syntax of + * "bond" or "nic". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Template's unique name. The full resource name follows the + * pattern: + * `projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}` + * Generally, the {server_network_template} follows the syntax of + * "bond" or "nic". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Instance types this template is applicable to. + * + * Generated from protobuf field repeated string applicable_instance_types = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getApplicableInstanceTypes() + { + return $this->applicable_instance_types; + } + + /** + * Instance types this template is applicable to. + * + * Generated from protobuf field repeated string applicable_instance_types = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setApplicableInstanceTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->applicable_instance_types = $arr; + + return $this; + } + + /** + * Logical interfaces. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.ServerNetworkTemplate.LogicalInterface logical_interfaces = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogicalInterfaces() + { + return $this->logical_interfaces; + } + + /** + * Logical interfaces. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.ServerNetworkTemplate.LogicalInterface logical_interfaces = 3; + * @param array<\Google\Cloud\BareMetalSolution\V2\ServerNetworkTemplate\LogicalInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogicalInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\ServerNetworkTemplate\LogicalInterface::class); + $this->logical_interfaces = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ServerNetworkTemplate/LogicalInterface.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ServerNetworkTemplate/LogicalInterface.php new file mode 100644 index 000000000000..96085db3f668 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ServerNetworkTemplate/LogicalInterface.php @@ -0,0 +1,154 @@ +google.cloud.baremetalsolution.v2.ServerNetworkTemplate.LogicalInterface + */ +class LogicalInterface extends \Google\Protobuf\Internal\Message +{ + /** + * Interface name. + * This is not a globally unique identifier. + * Name is unique only inside the ServerNetworkTemplate. This is of syntax + * or + * and forms part of the network template name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Interface type. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ServerNetworkTemplate.LogicalInterface.InterfaceType type = 2; + */ + protected $type = 0; + /** + * If true, interface must have network connected. + * + * Generated from protobuf field bool required = 3; + */ + protected $required = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Interface name. + * This is not a globally unique identifier. + * Name is unique only inside the ServerNetworkTemplate. This is of syntax + * or + * and forms part of the network template name. + * @type int $type + * Interface type. + * @type bool $required + * If true, interface must have network connected. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Interface name. + * This is not a globally unique identifier. + * Name is unique only inside the ServerNetworkTemplate. This is of syntax + * or + * and forms part of the network template name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Interface name. + * This is not a globally unique identifier. + * Name is unique only inside the ServerNetworkTemplate. This is of syntax + * or + * and forms part of the network template name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Interface type. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ServerNetworkTemplate.LogicalInterface.InterfaceType type = 2; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Interface type. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ServerNetworkTemplate.LogicalInterface.InterfaceType type = 2; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\ServerNetworkTemplate\LogicalInterface\InterfaceType::class); + $this->type = $var; + + return $this; + } + + /** + * If true, interface must have network connected. + * + * Generated from protobuf field bool required = 3; + * @return bool + */ + public function getRequired() + { + return $this->required; + } + + /** + * If true, interface must have network connected. + * + * Generated from protobuf field bool required = 3; + * @param bool $var + * @return $this + */ + public function setRequired($var) + { + GPBUtil::checkBool($var); + $this->required = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LogicalInterface::class, \Google\Cloud\BareMetalSolution\V2\ServerNetworkTemplate_LogicalInterface::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ServerNetworkTemplate/LogicalInterface/InterfaceType.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ServerNetworkTemplate/LogicalInterface/InterfaceType.php new file mode 100644 index 000000000000..45e03a1e7723 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/ServerNetworkTemplate/LogicalInterface/InterfaceType.php @@ -0,0 +1,64 @@ +google.cloud.baremetalsolution.v2.ServerNetworkTemplate.LogicalInterface.InterfaceType + */ +class InterfaceType +{ + /** + * Unspecified value. + * + * Generated from protobuf enum INTERFACE_TYPE_UNSPECIFIED = 0; + */ + const INTERFACE_TYPE_UNSPECIFIED = 0; + /** + * Bond interface type. + * + * Generated from protobuf enum BOND = 1; + */ + const BOND = 1; + /** + * NIC interface type. + * + * Generated from protobuf enum NIC = 2; + */ + const NIC = 2; + + private static $valueToName = [ + self::INTERFACE_TYPE_UNSPECIFIED => 'INTERFACE_TYPE_UNSPECIFIED', + self::BOND => 'BOND', + self::NIC => 'NIC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InterfaceType::class, \Google\Cloud\BareMetalSolution\V2\ServerNetworkTemplate_LogicalInterface_InterfaceType::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StartInstanceRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StartInstanceRequest.php new file mode 100644 index 000000000000..11a471958fad --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StartInstanceRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.StartInstanceRequest + */ +class StartInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BareMetalSolutionClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\StartInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StartInstanceResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StartInstanceResponse.php new file mode 100644 index 000000000000..078df2aa2efa --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StartInstanceResponse.php @@ -0,0 +1,33 @@ +google.cloud.baremetalsolution.v2.StartInstanceResponse + */ +class StartInstanceResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StopInstanceRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StopInstanceRequest.php new file mode 100644 index 000000000000..c838273d1284 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StopInstanceRequest.php @@ -0,0 +1,81 @@ +google.cloud.baremetalsolution.v2.StopInstanceRequest + */ +class StopInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BareMetalSolutionClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\BareMetalSolution\V2\StopInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StopInstanceResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StopInstanceResponse.php new file mode 100644 index 000000000000..f481f45b43fe --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/StopInstanceResponse.php @@ -0,0 +1,33 @@ +google.cloud.baremetalsolution.v2.StopInstanceResponse + */ +class StopInstanceResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/SubmitProvisioningConfigRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/SubmitProvisioningConfigRequest.php new file mode 100644 index 000000000000..2def6642afc8 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/SubmitProvisioningConfigRequest.php @@ -0,0 +1,170 @@ +google.cloud.baremetalsolution.v2.SubmitProvisioningConfigRequest + */ +class SubmitProvisioningConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent project and location containing the + * ProvisioningConfig. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ProvisioningConfig to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $provisioning_config = null; + /** + * Optional. Email provided to send a confirmation with provisioning config + * to. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $email = ''; + + /** + * @param string $parent Required. The parent project and location containing the + * ProvisioningConfig. Please see + * {@see BareMetalSolutionClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $provisioningConfig Required. The ProvisioningConfig to create. + * + * @return \Google\Cloud\BareMetalSolution\V2\SubmitProvisioningConfigRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $provisioningConfig): self + { + return (new self()) + ->setParent($parent) + ->setProvisioningConfig($provisioningConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent project and location containing the + * ProvisioningConfig. + * @type \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $provisioning_config + * Required. The ProvisioningConfig to create. + * @type string $email + * Optional. Email provided to send a confirmation with provisioning config + * to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent project and location containing the + * ProvisioningConfig. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent project and location containing the + * ProvisioningConfig. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The ProvisioningConfig to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig|null + */ + public function getProvisioningConfig() + { + return $this->provisioning_config; + } + + public function hasProvisioningConfig() + { + return isset($this->provisioning_config); + } + + public function clearProvisioningConfig() + { + unset($this->provisioning_config); + } + + /** + * Required. The ProvisioningConfig to create. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $var + * @return $this + */ + public function setProvisioningConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig::class); + $this->provisioning_config = $var; + + return $this; + } + + /** + * Optional. Email provided to send a confirmation with provisioning config + * to. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Optional. Email provided to send a confirmation with provisioning config + * to. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/SubmitProvisioningConfigResponse.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/SubmitProvisioningConfigResponse.php new file mode 100644 index 000000000000..35a3c9651f5a --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/SubmitProvisioningConfigResponse.php @@ -0,0 +1,77 @@ +google.cloud.baremetalsolution.v2.SubmitProvisioningConfigResponse + */ +class SubmitProvisioningConfigResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The submitted provisioning config. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 1; + */ + protected $provisioning_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $provisioning_config + * The submitted provisioning config. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * The submitted provisioning config. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 1; + * @return \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig|null + */ + public function getProvisioningConfig() + { + return $this->provisioning_config; + } + + public function hasProvisioningConfig() + { + return isset($this->provisioning_config); + } + + public function clearProvisioningConfig() + { + unset($this->provisioning_config); + } + + /** + * The submitted provisioning config. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 1; + * @param \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $var + * @return $this + */ + public function setProvisioningConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig::class); + $this->provisioning_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateInstanceRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateInstanceRequest.php new file mode 100644 index 000000000000..60546eef353a --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateInstanceRequest.php @@ -0,0 +1,167 @@ +google.cloud.baremetalsolution.v2.UpdateInstanceRequest + */ +class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The server to update. + * The `name` field is used to identify the instance to update. + * Format: projects/{project}/locations/{location}/instances/{instance} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = null; + /** + * The list of fields to update. + * The currently supported fields are: + * `labels` + * `hyperthreading_enabled` + * `os_image` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\BareMetalSolution\V2\Instance $instance Required. The server to update. + * + * The `name` field is used to identify the instance to update. + * Format: projects/{project}/locations/{location}/instances/{instance} + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to update. + * The currently supported fields are: + * `labels` + * `hyperthreading_enabled` + * `os_image` + * + * @return \Google\Cloud\BareMetalSolution\V2\UpdateInstanceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BareMetalSolution\V2\Instance $instance, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setInstance($instance) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BareMetalSolution\V2\Instance $instance + * Required. The server to update. + * The `name` field is used to identify the instance to update. + * Format: projects/{project}/locations/{location}/instances/{instance} + * @type \Google\Protobuf\FieldMask $update_mask + * The list of fields to update. + * The currently supported fields are: + * `labels` + * `hyperthreading_enabled` + * `os_image` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. The server to update. + * The `name` field is used to identify the instance to update. + * Format: projects/{project}/locations/{location}/instances/{instance} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BareMetalSolution\V2\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The server to update. + * The `name` field is used to identify the instance to update. + * Format: projects/{project}/locations/{location}/instances/{instance} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BareMetalSolution\V2\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\Instance::class); + $this->instance = $var; + + return $this; + } + + /** + * The list of fields to update. + * The currently supported fields are: + * `labels` + * `hyperthreading_enabled` + * `os_image` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The list of fields to update. + * The currently supported fields are: + * `labels` + * `hyperthreading_enabled` + * `os_image` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateNetworkRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateNetworkRequest.php new file mode 100644 index 000000000000..87eeb260f62b --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateNetworkRequest.php @@ -0,0 +1,157 @@ +google.cloud.baremetalsolution.v2.UpdateNetworkRequest + */ +class UpdateNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The network to update. + * The `name` field is used to identify the instance to update. + * Format: projects/{project}/locations/{location}/networks/{network} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network network = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = null; + /** + * The list of fields to update. + * The only currently supported fields are: + * `labels`, `reservations`, `vrf.vlan_attachments` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\BareMetalSolution\V2\Network $network Required. The network to update. + * + * The `name` field is used to identify the instance to update. + * Format: projects/{project}/locations/{location}/networks/{network} + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to update. + * The only currently supported fields are: + * `labels`, `reservations`, `vrf.vlan_attachments` + * + * @return \Google\Cloud\BareMetalSolution\V2\UpdateNetworkRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BareMetalSolution\V2\Network $network, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setNetwork($network) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BareMetalSolution\V2\Network $network + * Required. The network to update. + * The `name` field is used to identify the instance to update. + * Format: projects/{project}/locations/{location}/networks/{network} + * @type \Google\Protobuf\FieldMask $update_mask + * The list of fields to update. + * The only currently supported fields are: + * `labels`, `reservations`, `vrf.vlan_attachments` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * Required. The network to update. + * The `name` field is used to identify the instance to update. + * Format: projects/{project}/locations/{location}/networks/{network} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network network = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BareMetalSolution\V2\Network|null + */ + public function getNetwork() + { + return $this->network; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * Required. The network to update. + * The `name` field is used to identify the instance to update. + * Format: projects/{project}/locations/{location}/networks/{network} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Network network = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BareMetalSolution\V2\Network $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\Network::class); + $this->network = $var; + + return $this; + } + + /** + * The list of fields to update. + * The only currently supported fields are: + * `labels`, `reservations`, `vrf.vlan_attachments` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The list of fields to update. + * The only currently supported fields are: + * `labels`, `reservations`, `vrf.vlan_attachments` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateNfsShareRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateNfsShareRequest.php new file mode 100644 index 000000000000..63a98b61ec2d --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateNfsShareRequest.php @@ -0,0 +1,162 @@ +google.cloud.baremetalsolution.v2.UpdateNfsShareRequest + */ +class UpdateNfsShareRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The NFS share to update. + * The `name` field is used to identify the NFS share to update. + * Format: projects/{project}/locations/{location}/nfsShares/{nfs_share} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare nfs_share = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $nfs_share = null; + /** + * The list of fields to update. + * The only currently supported fields are: + * `labels` + * `allowed_clients` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\BareMetalSolution\V2\NfsShare $nfsShare Required. The NFS share to update. + * + * The `name` field is used to identify the NFS share to update. + * Format: projects/{project}/locations/{location}/nfsShares/{nfs_share} + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to update. + * The only currently supported fields are: + * `labels` + * `allowed_clients` + * + * @return \Google\Cloud\BareMetalSolution\V2\UpdateNfsShareRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BareMetalSolution\V2\NfsShare $nfsShare, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setNfsShare($nfsShare) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BareMetalSolution\V2\NfsShare $nfs_share + * Required. The NFS share to update. + * The `name` field is used to identify the NFS share to update. + * Format: projects/{project}/locations/{location}/nfsShares/{nfs_share} + * @type \Google\Protobuf\FieldMask $update_mask + * The list of fields to update. + * The only currently supported fields are: + * `labels` + * `allowed_clients` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\NfsShare::initOnce(); + parent::__construct($data); + } + + /** + * Required. The NFS share to update. + * The `name` field is used to identify the NFS share to update. + * Format: projects/{project}/locations/{location}/nfsShares/{nfs_share} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare nfs_share = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BareMetalSolution\V2\NfsShare|null + */ + public function getNfsShare() + { + return $this->nfs_share; + } + + public function hasNfsShare() + { + return isset($this->nfs_share); + } + + public function clearNfsShare() + { + unset($this->nfs_share); + } + + /** + * Required. The NFS share to update. + * The `name` field is used to identify the NFS share to update. + * Format: projects/{project}/locations/{location}/nfsShares/{nfs_share} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.NfsShare nfs_share = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BareMetalSolution\V2\NfsShare $var + * @return $this + */ + public function setNfsShare($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\NfsShare::class); + $this->nfs_share = $var; + + return $this; + } + + /** + * The list of fields to update. + * The only currently supported fields are: + * `labels` + * `allowed_clients` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The list of fields to update. + * The only currently supported fields are: + * `labels` + * `allowed_clients` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateProvisioningConfigRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateProvisioningConfigRequest.php new file mode 100644 index 000000000000..d9f98f9de392 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateProvisioningConfigRequest.php @@ -0,0 +1,174 @@ +google.cloud.baremetalsolution.v2.UpdateProvisioningConfigRequest + */ +class UpdateProvisioningConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ProvisioningConfig to update. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $provisioning_config = null; + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Optional. Email provided to send a confirmation with provisioning config + * to. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $email = ''; + + /** + * @param \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $provisioningConfig Required. The ProvisioningConfig to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to update. + * + * @return \Google\Cloud\BareMetalSolution\V2\UpdateProvisioningConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $provisioningConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setProvisioningConfig($provisioningConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $provisioning_config + * Required. The ProvisioningConfig to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to update. + * @type string $email + * Optional. Email provided to send a confirmation with provisioning config + * to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ProvisioningConfig to update. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig|null + */ + public function getProvisioningConfig() + { + return $this->provisioning_config; + } + + public function hasProvisioningConfig() + { + return isset($this->provisioning_config); + } + + public function clearProvisioningConfig() + { + unset($this->provisioning_config); + } + + /** + * Required. The ProvisioningConfig to update. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.ProvisioningConfig provisioning_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig $var + * @return $this + */ + public function setProvisioningConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\ProvisioningConfig::class); + $this->provisioning_config = $var; + + return $this; + } + + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. Email provided to send a confirmation with provisioning config + * to. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Optional. Email provided to send a confirmation with provisioning config + * to. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateVolumeRequest.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateVolumeRequest.php new file mode 100644 index 000000000000..d4fa695d3f0b --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/UpdateVolumeRequest.php @@ -0,0 +1,157 @@ +google.cloud.baremetalsolution.v2.UpdateVolumeRequest + */ +class UpdateVolumeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The volume to update. + * The `name` field is used to identify the volume to update. + * Format: projects/{project}/locations/{location}/volumes/{volume} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume volume = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $volume = null; + /** + * The list of fields to update. + * The only currently supported fields are: + * 'labels' + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\BareMetalSolution\V2\Volume $volume Required. The volume to update. + * + * The `name` field is used to identify the volume to update. + * Format: projects/{project}/locations/{location}/volumes/{volume} + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to update. + * The only currently supported fields are: + * 'labels' + * + * @return \Google\Cloud\BareMetalSolution\V2\UpdateVolumeRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BareMetalSolution\V2\Volume $volume, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setVolume($volume) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BareMetalSolution\V2\Volume $volume + * Required. The volume to update. + * The `name` field is used to identify the volume to update. + * Format: projects/{project}/locations/{location}/volumes/{volume} + * @type \Google\Protobuf\FieldMask $update_mask + * The list of fields to update. + * The only currently supported fields are: + * 'labels' + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Volume::initOnce(); + parent::__construct($data); + } + + /** + * Required. The volume to update. + * The `name` field is used to identify the volume to update. + * Format: projects/{project}/locations/{location}/volumes/{volume} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume volume = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BareMetalSolution\V2\Volume|null + */ + public function getVolume() + { + return $this->volume; + } + + public function hasVolume() + { + return isset($this->volume); + } + + public function clearVolume() + { + unset($this->volume); + } + + /** + * Required. The volume to update. + * The `name` field is used to identify the volume to update. + * Format: projects/{project}/locations/{location}/volumes/{volume} + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume volume = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BareMetalSolution\V2\Volume $var + * @return $this + */ + public function setVolume($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\Volume::class); + $this->volume = $var; + + return $this; + } + + /** + * The list of fields to update. + * The only currently supported fields are: + * 'labels' + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The list of fields to update. + * The only currently supported fields are: + * 'labels' + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF.php new file mode 100644 index 000000000000..217c29708d74 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF.php @@ -0,0 +1,191 @@ +google.cloud.baremetalsolution.v2.VRF + */ +class VRF extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the VRF. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The possible state of VRF. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF.State state = 5; + */ + protected $state = 0; + /** + * The QOS policy applied to this VRF. + * The value is only meaningful when all the vlan attachments have the same + * QoS. This field should not be used for new integrations, use vlan + * attachment level qos instead. The field is left for backward-compatibility. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF.QosPolicy qos_policy = 6; + */ + protected $qos_policy = null; + /** + * The list of VLAN attachments for the VRF. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VRF.VlanAttachment vlan_attachments = 7; + */ + private $vlan_attachments; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the VRF. + * @type int $state + * The possible state of VRF. + * @type \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy $qos_policy + * The QOS policy applied to this VRF. + * The value is only meaningful when all the vlan attachments have the same + * QoS. This field should not be used for new integrations, use vlan + * attachment level qos instead. The field is left for backward-compatibility. + * @type array<\Google\Cloud\BareMetalSolution\V2\VRF\VlanAttachment>|\Google\Protobuf\Internal\RepeatedField $vlan_attachments + * The list of VLAN attachments for the VRF. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * The name of the VRF. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the VRF. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The possible state of VRF. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF.State state = 5; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The possible state of VRF. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF.State state = 5; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VRF\State::class); + $this->state = $var; + + return $this; + } + + /** + * The QOS policy applied to this VRF. + * The value is only meaningful when all the vlan attachments have the same + * QoS. This field should not be used for new integrations, use vlan + * attachment level qos instead. The field is left for backward-compatibility. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF.QosPolicy qos_policy = 6; + * @return \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy|null + */ + public function getQosPolicy() + { + return $this->qos_policy; + } + + public function hasQosPolicy() + { + return isset($this->qos_policy); + } + + public function clearQosPolicy() + { + unset($this->qos_policy); + } + + /** + * The QOS policy applied to this VRF. + * The value is only meaningful when all the vlan attachments have the same + * QoS. This field should not be used for new integrations, use vlan + * attachment level qos instead. The field is left for backward-compatibility. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF.QosPolicy qos_policy = 6; + * @param \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy $var + * @return $this + */ + public function setQosPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy::class); + $this->qos_policy = $var; + + return $this; + } + + /** + * The list of VLAN attachments for the VRF. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VRF.VlanAttachment vlan_attachments = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVlanAttachments() + { + return $this->vlan_attachments; + } + + /** + * The list of VLAN attachments for the VRF. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VRF.VlanAttachment vlan_attachments = 7; + * @param array<\Google\Cloud\BareMetalSolution\V2\VRF\VlanAttachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVlanAttachments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\VRF\VlanAttachment::class); + $this->vlan_attachments = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF/QosPolicy.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF/QosPolicy.php new file mode 100644 index 000000000000..155de6cc6ac3 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF/QosPolicy.php @@ -0,0 +1,70 @@ +google.cloud.baremetalsolution.v2.VRF.QosPolicy + */ +class QosPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The bandwidth permitted by the QOS policy, in gbps. + * + * Generated from protobuf field double bandwidth_gbps = 1; + */ + protected $bandwidth_gbps = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $bandwidth_gbps + * The bandwidth permitted by the QOS policy, in gbps. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * The bandwidth permitted by the QOS policy, in gbps. + * + * Generated from protobuf field double bandwidth_gbps = 1; + * @return float + */ + public function getBandwidthGbps() + { + return $this->bandwidth_gbps; + } + + /** + * The bandwidth permitted by the QOS policy, in gbps. + * + * Generated from protobuf field double bandwidth_gbps = 1; + * @param float $var + * @return $this + */ + public function setBandwidthGbps($var) + { + GPBUtil::checkDouble($var); + $this->bandwidth_gbps = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QosPolicy::class, \Google\Cloud\BareMetalSolution\V2\VRF_QosPolicy::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF/State.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF/State.php new file mode 100644 index 000000000000..77a76204cece --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF/State.php @@ -0,0 +1,64 @@ +google.cloud.baremetalsolution.v2.VRF.State + */ +class State +{ + /** + * The unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The vrf is provisioning. + * + * Generated from protobuf enum PROVISIONING = 1; + */ + const PROVISIONING = 1; + /** + * The vrf is provisioned. + * + * Generated from protobuf enum PROVISIONED = 2; + */ + const PROVISIONED = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PROVISIONING => 'PROVISIONING', + self::PROVISIONED => 'PROVISIONED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BareMetalSolution\V2\VRF_State::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF/VlanAttachment.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF/VlanAttachment.php new file mode 100644 index 000000000000..e0c067b66dad --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VRF/VlanAttachment.php @@ -0,0 +1,292 @@ +google.cloud.baremetalsolution.v2.VRF.VlanAttachment + */ +class VlanAttachment extends \Google\Protobuf\Internal\Message +{ + /** + * The peer vlan ID of the attachment. + * + * Generated from protobuf field int64 peer_vlan_id = 1; + */ + protected $peer_vlan_id = 0; + /** + * The peer IP of the attachment. + * + * Generated from protobuf field string peer_ip = 2; + */ + protected $peer_ip = ''; + /** + * The router IP of the attachment. + * + * Generated from protobuf field string router_ip = 3; + */ + protected $router_ip = ''; + /** + * Input only. Pairing key. + * + * Generated from protobuf field string pairing_key = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $pairing_key = ''; + /** + * The QOS policy applied to this VLAN attachment. + * This value should be preferred to using qos at vrf level. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF.QosPolicy qos_policy = 5; + */ + protected $qos_policy = null; + /** + * Immutable. The identifier of the attachment within vrf. + * + * Generated from protobuf field string id = 6 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $id = ''; + /** + * Optional. The name of the vlan attachment within vrf. This is of the form + * projects/{project_number}/regions/{region}/interconnectAttachments/{interconnect_attachment} + * + * Generated from protobuf field string interconnect_attachment = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $interconnect_attachment = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $peer_vlan_id + * The peer vlan ID of the attachment. + * @type string $peer_ip + * The peer IP of the attachment. + * @type string $router_ip + * The router IP of the attachment. + * @type string $pairing_key + * Input only. Pairing key. + * @type \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy $qos_policy + * The QOS policy applied to this VLAN attachment. + * This value should be preferred to using qos at vrf level. + * @type string $id + * Immutable. The identifier of the attachment within vrf. + * @type string $interconnect_attachment + * Optional. The name of the vlan attachment within vrf. This is of the form + * projects/{project_number}/regions/{region}/interconnectAttachments/{interconnect_attachment} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce(); + parent::__construct($data); + } + + /** + * The peer vlan ID of the attachment. + * + * Generated from protobuf field int64 peer_vlan_id = 1; + * @return int|string + */ + public function getPeerVlanId() + { + return $this->peer_vlan_id; + } + + /** + * The peer vlan ID of the attachment. + * + * Generated from protobuf field int64 peer_vlan_id = 1; + * @param int|string $var + * @return $this + */ + public function setPeerVlanId($var) + { + GPBUtil::checkInt64($var); + $this->peer_vlan_id = $var; + + return $this; + } + + /** + * The peer IP of the attachment. + * + * Generated from protobuf field string peer_ip = 2; + * @return string + */ + public function getPeerIp() + { + return $this->peer_ip; + } + + /** + * The peer IP of the attachment. + * + * Generated from protobuf field string peer_ip = 2; + * @param string $var + * @return $this + */ + public function setPeerIp($var) + { + GPBUtil::checkString($var, True); + $this->peer_ip = $var; + + return $this; + } + + /** + * The router IP of the attachment. + * + * Generated from protobuf field string router_ip = 3; + * @return string + */ + public function getRouterIp() + { + return $this->router_ip; + } + + /** + * The router IP of the attachment. + * + * Generated from protobuf field string router_ip = 3; + * @param string $var + * @return $this + */ + public function setRouterIp($var) + { + GPBUtil::checkString($var, True); + $this->router_ip = $var; + + return $this; + } + + /** + * Input only. Pairing key. + * + * Generated from protobuf field string pairing_key = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getPairingKey() + { + return $this->pairing_key; + } + + /** + * Input only. Pairing key. + * + * Generated from protobuf field string pairing_key = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPairingKey($var) + { + GPBUtil::checkString($var, True); + $this->pairing_key = $var; + + return $this; + } + + /** + * The QOS policy applied to this VLAN attachment. + * This value should be preferred to using qos at vrf level. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF.QosPolicy qos_policy = 5; + * @return \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy|null + */ + public function getQosPolicy() + { + return $this->qos_policy; + } + + public function hasQosPolicy() + { + return isset($this->qos_policy); + } + + public function clearQosPolicy() + { + unset($this->qos_policy); + } + + /** + * The QOS policy applied to this VLAN attachment. + * This value should be preferred to using qos at vrf level. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VRF.QosPolicy qos_policy = 5; + * @param \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy $var + * @return $this + */ + public function setQosPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy::class); + $this->qos_policy = $var; + + return $this; + } + + /** + * Immutable. The identifier of the attachment within vrf. + * + * Generated from protobuf field string id = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Immutable. The identifier of the attachment within vrf. + * + * Generated from protobuf field string id = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Optional. The name of the vlan attachment within vrf. This is of the form + * projects/{project_number}/regions/{region}/interconnectAttachments/{interconnect_attachment} + * + * Generated from protobuf field string interconnect_attachment = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getInterconnectAttachment() + { + return $this->interconnect_attachment; + } + + /** + * Optional. The name of the vlan attachment within vrf. This is of the form + * projects/{project_number}/regions/{region}/interconnectAttachments/{interconnect_attachment} + * + * Generated from protobuf field string interconnect_attachment = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setInterconnectAttachment($var) + { + GPBUtil::checkString($var, True); + $this->interconnect_attachment = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(VlanAttachment::class, \Google\Cloud\BareMetalSolution\V2\VRF_VlanAttachment::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume.php new file mode 100644 index 000000000000..47b35834e0a2 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume.php @@ -0,0 +1,933 @@ +google.cloud.baremetalsolution.v2.Volume + */ +class Volume extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of this `Volume`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/volumes/{volume}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * An identifier for the `Volume`, generated by the backend. + * + * Generated from protobuf field string id = 11; + */ + protected $id = ''; + /** + * The storage type for this volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.StorageType storage_type = 2; + */ + protected $storage_type = 0; + /** + * The state of this storage volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.State state = 3; + */ + protected $state = 0; + /** + * The requested size of this storage volume, in GiB. + * + * Generated from protobuf field int64 requested_size_gib = 4; + */ + protected $requested_size_gib = 0; + /** + * Originally requested size, in GiB. + * + * Generated from protobuf field int64 originally_requested_size_gib = 16; + */ + protected $originally_requested_size_gib = 0; + /** + * The current size of this storage volume, in GiB, including space reserved + * for snapshots. This size might be different than the requested size if the + * storage volume has been configured with auto grow or auto shrink. + * + * Generated from protobuf field int64 current_size_gib = 5; + */ + protected $current_size_gib = 0; + /** + * Additional emergency size that was requested for this Volume, in GiB. + * current_size_gib includes this value. + * + * Generated from protobuf field int64 emergency_size_gib = 14; + */ + protected $emergency_size_gib = 0; + /** + * Maximum size volume can be expanded to in case of evergency, in GiB. + * + * Generated from protobuf field int64 max_size_gib = 17; + */ + protected $max_size_gib = 0; + /** + * The size, in GiB, that this storage volume has expanded as a result of an + * auto grow policy. In the absence of auto-grow, the value is 0. + * + * Generated from protobuf field int64 auto_grown_size_gib = 6; + */ + protected $auto_grown_size_gib = 0; + /** + * The space remaining in the storage volume for new LUNs, in GiB, excluding + * space reserved for snapshots. + * + * Generated from protobuf field int64 remaining_space_gib = 7; + */ + protected $remaining_space_gib = 0; + /** + * Details about snapshot space reservation and usage on the storage volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.SnapshotReservationDetail snapshot_reservation_detail = 8; + */ + protected $snapshot_reservation_detail = null; + /** + * The behavior to use when snapshot reserved space is full. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.SnapshotAutoDeleteBehavior snapshot_auto_delete_behavior = 9; + */ + protected $snapshot_auto_delete_behavior = 0; + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 12; + */ + private $labels; + /** + * Whether snapshots are enabled. + * + * Generated from protobuf field bool snapshot_enabled = 13; + */ + protected $snapshot_enabled = false; + /** + * Immutable. Pod name. + * + * Generated from protobuf field string pod = 15 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $pod = ''; + /** + * Output only. Storage protocol for the Volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.Protocol protocol = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $protocol = 0; + /** + * Output only. Whether this volume is a boot volume. A boot volume is one + * which contains a boot LUN. + * + * Generated from protobuf field bool boot_volume = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $boot_volume = false; + /** + * Immutable. Performance tier of the Volume. + * Default is SHARED. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumePerformanceTier performance_tier = 20 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $performance_tier = 0; + /** + * Input only. User-specified notes for new Volume. + * Used to provision Volumes that require manual intervention. + * + * Generated from protobuf field string notes = 21 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $notes = ''; + /** + * The workload profile for the volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.WorkloadProfile workload_profile = 22; + */ + protected $workload_profile = 0; + /** + * Output only. Time after which volume will be fully deleted. + * It is filled only for volumes in COOLOFF state. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Output only. Instances this Volume is attached to. + * This field is set only in Get requests. + * + * Generated from protobuf field repeated string instances = 25 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $instances; + /** + * Output only. Is the Volume attached at at least one instance. + * This field is a lightweight counterpart of `instances` field. + * It is filled in List responses as well. + * + * Generated from protobuf field bool attached = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $attached = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of this `Volume`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/volumes/{volume}` + * @type string $id + * An identifier for the `Volume`, generated by the backend. + * @type int $storage_type + * The storage type for this volume. + * @type int $state + * The state of this storage volume. + * @type int|string $requested_size_gib + * The requested size of this storage volume, in GiB. + * @type int|string $originally_requested_size_gib + * Originally requested size, in GiB. + * @type int|string $current_size_gib + * The current size of this storage volume, in GiB, including space reserved + * for snapshots. This size might be different than the requested size if the + * storage volume has been configured with auto grow or auto shrink. + * @type int|string $emergency_size_gib + * Additional emergency size that was requested for this Volume, in GiB. + * current_size_gib includes this value. + * @type int|string $max_size_gib + * Maximum size volume can be expanded to in case of evergency, in GiB. + * @type int|string $auto_grown_size_gib + * The size, in GiB, that this storage volume has expanded as a result of an + * auto grow policy. In the absence of auto-grow, the value is 0. + * @type int|string $remaining_space_gib + * The space remaining in the storage volume for new LUNs, in GiB, excluding + * space reserved for snapshots. + * @type \Google\Cloud\BareMetalSolution\V2\Volume\SnapshotReservationDetail $snapshot_reservation_detail + * Details about snapshot space reservation and usage on the storage volume. + * @type int $snapshot_auto_delete_behavior + * The behavior to use when snapshot reserved space is full. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs. + * @type bool $snapshot_enabled + * Whether snapshots are enabled. + * @type string $pod + * Immutable. Pod name. + * @type int $protocol + * Output only. Storage protocol for the Volume. + * @type bool $boot_volume + * Output only. Whether this volume is a boot volume. A boot volume is one + * which contains a boot LUN. + * @type int $performance_tier + * Immutable. Performance tier of the Volume. + * Default is SHARED. + * @type string $notes + * Input only. User-specified notes for new Volume. + * Used to provision Volumes that require manual intervention. + * @type int $workload_profile + * The workload profile for the volume. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. Time after which volume will be fully deleted. + * It is filled only for volumes in COOLOFF state. + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * Output only. Instances this Volume is attached to. + * This field is set only in Get requests. + * @type bool $attached + * Output only. Is the Volume attached at at least one instance. + * This field is a lightweight counterpart of `instances` field. + * It is filled in List responses as well. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Volume::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of this `Volume`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/volumes/{volume}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of this `Volume`. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * Format: + * `projects/{project}/locations/{location}/volumes/{volume}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * An identifier for the `Volume`, generated by the backend. + * + * Generated from protobuf field string id = 11; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * An identifier for the `Volume`, generated by the backend. + * + * Generated from protobuf field string id = 11; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The storage type for this volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.StorageType storage_type = 2; + * @return int + */ + public function getStorageType() + { + return $this->storage_type; + } + + /** + * The storage type for this volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.StorageType storage_type = 2; + * @param int $var + * @return $this + */ + public function setStorageType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Volume\StorageType::class); + $this->storage_type = $var; + + return $this; + } + + /** + * The state of this storage volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.State state = 3; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of this storage volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.State state = 3; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Volume\State::class); + $this->state = $var; + + return $this; + } + + /** + * The requested size of this storage volume, in GiB. + * + * Generated from protobuf field int64 requested_size_gib = 4; + * @return int|string + */ + public function getRequestedSizeGib() + { + return $this->requested_size_gib; + } + + /** + * The requested size of this storage volume, in GiB. + * + * Generated from protobuf field int64 requested_size_gib = 4; + * @param int|string $var + * @return $this + */ + public function setRequestedSizeGib($var) + { + GPBUtil::checkInt64($var); + $this->requested_size_gib = $var; + + return $this; + } + + /** + * Originally requested size, in GiB. + * + * Generated from protobuf field int64 originally_requested_size_gib = 16; + * @return int|string + */ + public function getOriginallyRequestedSizeGib() + { + return $this->originally_requested_size_gib; + } + + /** + * Originally requested size, in GiB. + * + * Generated from protobuf field int64 originally_requested_size_gib = 16; + * @param int|string $var + * @return $this + */ + public function setOriginallyRequestedSizeGib($var) + { + GPBUtil::checkInt64($var); + $this->originally_requested_size_gib = $var; + + return $this; + } + + /** + * The current size of this storage volume, in GiB, including space reserved + * for snapshots. This size might be different than the requested size if the + * storage volume has been configured with auto grow or auto shrink. + * + * Generated from protobuf field int64 current_size_gib = 5; + * @return int|string + */ + public function getCurrentSizeGib() + { + return $this->current_size_gib; + } + + /** + * The current size of this storage volume, in GiB, including space reserved + * for snapshots. This size might be different than the requested size if the + * storage volume has been configured with auto grow or auto shrink. + * + * Generated from protobuf field int64 current_size_gib = 5; + * @param int|string $var + * @return $this + */ + public function setCurrentSizeGib($var) + { + GPBUtil::checkInt64($var); + $this->current_size_gib = $var; + + return $this; + } + + /** + * Additional emergency size that was requested for this Volume, in GiB. + * current_size_gib includes this value. + * + * Generated from protobuf field int64 emergency_size_gib = 14; + * @return int|string + */ + public function getEmergencySizeGib() + { + return $this->emergency_size_gib; + } + + /** + * Additional emergency size that was requested for this Volume, in GiB. + * current_size_gib includes this value. + * + * Generated from protobuf field int64 emergency_size_gib = 14; + * @param int|string $var + * @return $this + */ + public function setEmergencySizeGib($var) + { + GPBUtil::checkInt64($var); + $this->emergency_size_gib = $var; + + return $this; + } + + /** + * Maximum size volume can be expanded to in case of evergency, in GiB. + * + * Generated from protobuf field int64 max_size_gib = 17; + * @return int|string + */ + public function getMaxSizeGib() + { + return $this->max_size_gib; + } + + /** + * Maximum size volume can be expanded to in case of evergency, in GiB. + * + * Generated from protobuf field int64 max_size_gib = 17; + * @param int|string $var + * @return $this + */ + public function setMaxSizeGib($var) + { + GPBUtil::checkInt64($var); + $this->max_size_gib = $var; + + return $this; + } + + /** + * The size, in GiB, that this storage volume has expanded as a result of an + * auto grow policy. In the absence of auto-grow, the value is 0. + * + * Generated from protobuf field int64 auto_grown_size_gib = 6; + * @return int|string + */ + public function getAutoGrownSizeGib() + { + return $this->auto_grown_size_gib; + } + + /** + * The size, in GiB, that this storage volume has expanded as a result of an + * auto grow policy. In the absence of auto-grow, the value is 0. + * + * Generated from protobuf field int64 auto_grown_size_gib = 6; + * @param int|string $var + * @return $this + */ + public function setAutoGrownSizeGib($var) + { + GPBUtil::checkInt64($var); + $this->auto_grown_size_gib = $var; + + return $this; + } + + /** + * The space remaining in the storage volume for new LUNs, in GiB, excluding + * space reserved for snapshots. + * + * Generated from protobuf field int64 remaining_space_gib = 7; + * @return int|string + */ + public function getRemainingSpaceGib() + { + return $this->remaining_space_gib; + } + + /** + * The space remaining in the storage volume for new LUNs, in GiB, excluding + * space reserved for snapshots. + * + * Generated from protobuf field int64 remaining_space_gib = 7; + * @param int|string $var + * @return $this + */ + public function setRemainingSpaceGib($var) + { + GPBUtil::checkInt64($var); + $this->remaining_space_gib = $var; + + return $this; + } + + /** + * Details about snapshot space reservation and usage on the storage volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.SnapshotReservationDetail snapshot_reservation_detail = 8; + * @return \Google\Cloud\BareMetalSolution\V2\Volume\SnapshotReservationDetail|null + */ + public function getSnapshotReservationDetail() + { + return $this->snapshot_reservation_detail; + } + + public function hasSnapshotReservationDetail() + { + return isset($this->snapshot_reservation_detail); + } + + public function clearSnapshotReservationDetail() + { + unset($this->snapshot_reservation_detail); + } + + /** + * Details about snapshot space reservation and usage on the storage volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.SnapshotReservationDetail snapshot_reservation_detail = 8; + * @param \Google\Cloud\BareMetalSolution\V2\Volume\SnapshotReservationDetail $var + * @return $this + */ + public function setSnapshotReservationDetail($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\Volume\SnapshotReservationDetail::class); + $this->snapshot_reservation_detail = $var; + + return $this; + } + + /** + * The behavior to use when snapshot reserved space is full. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.SnapshotAutoDeleteBehavior snapshot_auto_delete_behavior = 9; + * @return int + */ + public function getSnapshotAutoDeleteBehavior() + { + return $this->snapshot_auto_delete_behavior; + } + + /** + * The behavior to use when snapshot reserved space is full. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.SnapshotAutoDeleteBehavior snapshot_auto_delete_behavior = 9; + * @param int $var + * @return $this + */ + public function setSnapshotAutoDeleteBehavior($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Volume\SnapshotAutoDeleteBehavior::class); + $this->snapshot_auto_delete_behavior = $var; + + return $this; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 12; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs. + * + * Generated from protobuf field map labels = 12; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Whether snapshots are enabled. + * + * Generated from protobuf field bool snapshot_enabled = 13; + * @return bool + */ + public function getSnapshotEnabled() + { + return $this->snapshot_enabled; + } + + /** + * Whether snapshots are enabled. + * + * Generated from protobuf field bool snapshot_enabled = 13; + * @param bool $var + * @return $this + */ + public function setSnapshotEnabled($var) + { + GPBUtil::checkBool($var); + $this->snapshot_enabled = $var; + + return $this; + } + + /** + * Immutable. Pod name. + * + * Generated from protobuf field string pod = 15 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getPod() + { + return $this->pod; + } + + /** + * Immutable. Pod name. + * + * Generated from protobuf field string pod = 15 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setPod($var) + { + GPBUtil::checkString($var, True); + $this->pod = $var; + + return $this; + } + + /** + * Output only. Storage protocol for the Volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.Protocol protocol = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getProtocol() + { + return $this->protocol; + } + + /** + * Output only. Storage protocol for the Volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.Protocol protocol = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setProtocol($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Volume\Protocol::class); + $this->protocol = $var; + + return $this; + } + + /** + * Output only. Whether this volume is a boot volume. A boot volume is one + * which contains a boot LUN. + * + * Generated from protobuf field bool boot_volume = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getBootVolume() + { + return $this->boot_volume; + } + + /** + * Output only. Whether this volume is a boot volume. A boot volume is one + * which contains a boot LUN. + * + * Generated from protobuf field bool boot_volume = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setBootVolume($var) + { + GPBUtil::checkBool($var); + $this->boot_volume = $var; + + return $this; + } + + /** + * Immutable. Performance tier of the Volume. + * Default is SHARED. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumePerformanceTier performance_tier = 20 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getPerformanceTier() + { + return $this->performance_tier; + } + + /** + * Immutable. Performance tier of the Volume. + * Default is SHARED. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumePerformanceTier performance_tier = 20 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setPerformanceTier($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VolumePerformanceTier::class); + $this->performance_tier = $var; + + return $this; + } + + /** + * Input only. User-specified notes for new Volume. + * Used to provision Volumes that require manual intervention. + * + * Generated from protobuf field string notes = 21 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getNotes() + { + return $this->notes; + } + + /** + * Input only. User-specified notes for new Volume. + * Used to provision Volumes that require manual intervention. + * + * Generated from protobuf field string notes = 21 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNotes($var) + { + GPBUtil::checkString($var, True); + $this->notes = $var; + + return $this; + } + + /** + * The workload profile for the volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.WorkloadProfile workload_profile = 22; + * @return int + */ + public function getWorkloadProfile() + { + return $this->workload_profile; + } + + /** + * The workload profile for the volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.Volume.WorkloadProfile workload_profile = 22; + * @param int $var + * @return $this + */ + public function setWorkloadProfile($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Volume\WorkloadProfile::class); + $this->workload_profile = $var; + + return $this; + } + + /** + * Output only. Time after which volume will be fully deleted. + * It is filled only for volumes in COOLOFF state. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. Time after which volume will be fully deleted. + * It is filled only for volumes in COOLOFF state. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. Instances this Volume is attached to. + * This field is set only in Get requests. + * + * Generated from protobuf field repeated string instances = 25 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Output only. Instances this Volume is attached to. + * This field is set only in Get requests. + * + * Generated from protobuf field repeated string instances = 25 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + + /** + * Output only. Is the Volume attached at at least one instance. + * This field is a lightweight counterpart of `instances` field. + * It is filled in List responses as well. + * + * Generated from protobuf field bool attached = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getAttached() + { + return $this->attached; + } + + /** + * Output only. Is the Volume attached at at least one instance. + * This field is a lightweight counterpart of `instances` field. + * It is filled in List responses as well. + * + * Generated from protobuf field bool attached = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setAttached($var) + { + GPBUtil::checkBool($var); + $this->attached = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/Protocol.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/Protocol.php new file mode 100644 index 000000000000..4fa04cff8958 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/Protocol.php @@ -0,0 +1,65 @@ +google.cloud.baremetalsolution.v2.Volume.Protocol + */ +class Protocol +{ + /** + * Value is not specified. + * + * Generated from protobuf enum PROTOCOL_UNSPECIFIED = 0; + */ + const PROTOCOL_UNSPECIFIED = 0; + /** + * Fibre Channel protocol. + * + * Generated from protobuf enum FIBRE_CHANNEL = 1; + */ + const FIBRE_CHANNEL = 1; + /** + * NFS protocol means Volume is a NFS Share volume. + * Such volumes cannot be manipulated via Volumes API. + * + * Generated from protobuf enum NFS = 2; + */ + const NFS = 2; + + private static $valueToName = [ + self::PROTOCOL_UNSPECIFIED => 'PROTOCOL_UNSPECIFIED', + self::FIBRE_CHANNEL => 'FIBRE_CHANNEL', + self::NFS => 'NFS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Protocol::class, \Google\Cloud\BareMetalSolution\V2\Volume_Protocol::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/SnapshotAutoDeleteBehavior.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/SnapshotAutoDeleteBehavior.php new file mode 100644 index 000000000000..c00ae75623da --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/SnapshotAutoDeleteBehavior.php @@ -0,0 +1,73 @@ +google.cloud.baremetalsolution.v2.Volume.SnapshotAutoDeleteBehavior + */ +class SnapshotAutoDeleteBehavior +{ + /** + * The unspecified behavior. + * + * Generated from protobuf enum SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED = 0; + */ + const SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED = 0; + /** + * Don't delete any snapshots. This disables new snapshot creation, as + * long as the snapshot reserved space is full. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * Delete the oldest snapshots first. + * + * Generated from protobuf enum OLDEST_FIRST = 2; + */ + const OLDEST_FIRST = 2; + /** + * Delete the newest snapshots first. + * + * Generated from protobuf enum NEWEST_FIRST = 3; + */ + const NEWEST_FIRST = 3; + + private static $valueToName = [ + self::SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED => 'SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::OLDEST_FIRST => 'OLDEST_FIRST', + self::NEWEST_FIRST => 'NEWEST_FIRST', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SnapshotAutoDeleteBehavior::class, \Google\Cloud\BareMetalSolution\V2\Volume_SnapshotAutoDeleteBehavior::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/SnapshotReservationDetail.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/SnapshotReservationDetail.php new file mode 100644 index 000000000000..16739fe08920 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/SnapshotReservationDetail.php @@ -0,0 +1,204 @@ +google.cloud.baremetalsolution.v2.Volume.SnapshotReservationDetail + */ +class SnapshotReservationDetail extends \Google\Protobuf\Internal\Message +{ + /** + * The space on this storage volume reserved for snapshots, shown in GiB. + * + * Generated from protobuf field int64 reserved_space_gib = 1; + */ + protected $reserved_space_gib = 0; + /** + * The percent of snapshot space on this storage volume actually being used + * by the snapshot copies. This value might be higher than 100% if the + * snapshot copies have overflowed into the data portion of the storage + * volume. + * + * Generated from protobuf field int32 reserved_space_used_percent = 2; + */ + protected $reserved_space_used_percent = 0; + /** + * The amount, in GiB, of available space in this storage volume's reserved + * snapshot space. + * + * Generated from protobuf field int64 reserved_space_remaining_gib = 3; + */ + protected $reserved_space_remaining_gib = 0; + /** + * Percent of the total Volume size reserved for snapshot copies. + * Enabling snapshots requires reserving 20% or more of + * the storage volume space for snapshots. Maximum reserved space for + * snapshots is 40%. + * Setting this field will effectively set snapshot_enabled to true. + * + * Generated from protobuf field int32 reserved_space_percent = 4; + */ + protected $reserved_space_percent = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $reserved_space_gib + * The space on this storage volume reserved for snapshots, shown in GiB. + * @type int $reserved_space_used_percent + * The percent of snapshot space on this storage volume actually being used + * by the snapshot copies. This value might be higher than 100% if the + * snapshot copies have overflowed into the data portion of the storage + * volume. + * @type int|string $reserved_space_remaining_gib + * The amount, in GiB, of available space in this storage volume's reserved + * snapshot space. + * @type int $reserved_space_percent + * Percent of the total Volume size reserved for snapshot copies. + * Enabling snapshots requires reserving 20% or more of + * the storage volume space for snapshots. Maximum reserved space for + * snapshots is 40%. + * Setting this field will effectively set snapshot_enabled to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Volume::initOnce(); + parent::__construct($data); + } + + /** + * The space on this storage volume reserved for snapshots, shown in GiB. + * + * Generated from protobuf field int64 reserved_space_gib = 1; + * @return int|string + */ + public function getReservedSpaceGib() + { + return $this->reserved_space_gib; + } + + /** + * The space on this storage volume reserved for snapshots, shown in GiB. + * + * Generated from protobuf field int64 reserved_space_gib = 1; + * @param int|string $var + * @return $this + */ + public function setReservedSpaceGib($var) + { + GPBUtil::checkInt64($var); + $this->reserved_space_gib = $var; + + return $this; + } + + /** + * The percent of snapshot space on this storage volume actually being used + * by the snapshot copies. This value might be higher than 100% if the + * snapshot copies have overflowed into the data portion of the storage + * volume. + * + * Generated from protobuf field int32 reserved_space_used_percent = 2; + * @return int + */ + public function getReservedSpaceUsedPercent() + { + return $this->reserved_space_used_percent; + } + + /** + * The percent of snapshot space on this storage volume actually being used + * by the snapshot copies. This value might be higher than 100% if the + * snapshot copies have overflowed into the data portion of the storage + * volume. + * + * Generated from protobuf field int32 reserved_space_used_percent = 2; + * @param int $var + * @return $this + */ + public function setReservedSpaceUsedPercent($var) + { + GPBUtil::checkInt32($var); + $this->reserved_space_used_percent = $var; + + return $this; + } + + /** + * The amount, in GiB, of available space in this storage volume's reserved + * snapshot space. + * + * Generated from protobuf field int64 reserved_space_remaining_gib = 3; + * @return int|string + */ + public function getReservedSpaceRemainingGib() + { + return $this->reserved_space_remaining_gib; + } + + /** + * The amount, in GiB, of available space in this storage volume's reserved + * snapshot space. + * + * Generated from protobuf field int64 reserved_space_remaining_gib = 3; + * @param int|string $var + * @return $this + */ + public function setReservedSpaceRemainingGib($var) + { + GPBUtil::checkInt64($var); + $this->reserved_space_remaining_gib = $var; + + return $this; + } + + /** + * Percent of the total Volume size reserved for snapshot copies. + * Enabling snapshots requires reserving 20% or more of + * the storage volume space for snapshots. Maximum reserved space for + * snapshots is 40%. + * Setting this field will effectively set snapshot_enabled to true. + * + * Generated from protobuf field int32 reserved_space_percent = 4; + * @return int + */ + public function getReservedSpacePercent() + { + return $this->reserved_space_percent; + } + + /** + * Percent of the total Volume size reserved for snapshot copies. + * Enabling snapshots requires reserving 20% or more of + * the storage volume space for snapshots. Maximum reserved space for + * snapshots is 40%. + * Setting this field will effectively set snapshot_enabled to true. + * + * Generated from protobuf field int32 reserved_space_percent = 4; + * @param int $var + * @return $this + */ + public function setReservedSpacePercent($var) + { + GPBUtil::checkInt32($var); + $this->reserved_space_percent = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SnapshotReservationDetail::class, \Google\Cloud\BareMetalSolution\V2\Volume_SnapshotReservationDetail::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/State.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/State.php new file mode 100644 index 000000000000..6f0294162c29 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/State.php @@ -0,0 +1,86 @@ +google.cloud.baremetalsolution.v2.Volume.State + */ +class State +{ + /** + * The storage volume is in an unknown state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The storage volume is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The storage volume is ready for use. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The storage volume has been requested to be deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The storage volume is being updated. + * + * Generated from protobuf enum UPDATING = 4; + */ + const UPDATING = 4; + /** + * The storage volume is in cool off state. It will be deleted after + * `expire_time`. + * + * Generated from protobuf enum COOL_OFF = 5; + */ + const COOL_OFF = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::DELETING => 'DELETING', + self::UPDATING => 'UPDATING', + self::COOL_OFF => 'COOL_OFF', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BareMetalSolution\V2\Volume_State::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/StorageType.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/StorageType.php new file mode 100644 index 000000000000..2ccb93087f78 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/StorageType.php @@ -0,0 +1,64 @@ +google.cloud.baremetalsolution.v2.Volume.StorageType + */ +class StorageType +{ + /** + * The storage type for this volume is unknown. + * + * Generated from protobuf enum STORAGE_TYPE_UNSPECIFIED = 0; + */ + const STORAGE_TYPE_UNSPECIFIED = 0; + /** + * The storage type for this volume is SSD. + * + * Generated from protobuf enum SSD = 1; + */ + const SSD = 1; + /** + * This storage type for this volume is HDD. + * + * Generated from protobuf enum HDD = 2; + */ + const HDD = 2; + + private static $valueToName = [ + self::STORAGE_TYPE_UNSPECIFIED => 'STORAGE_TYPE_UNSPECIFIED', + self::SSD => 'SSD', + self::HDD => 'HDD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StorageType::class, \Google\Cloud\BareMetalSolution\V2\Volume_StorageType::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/WorkloadProfile.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/WorkloadProfile.php new file mode 100644 index 000000000000..dc4e299c0d91 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/Volume/WorkloadProfile.php @@ -0,0 +1,64 @@ +google.cloud.baremetalsolution.v2.Volume.WorkloadProfile + */ +class WorkloadProfile +{ + /** + * The workload profile is in an unknown state. + * + * Generated from protobuf enum WORKLOAD_PROFILE_UNSPECIFIED = 0; + */ + const WORKLOAD_PROFILE_UNSPECIFIED = 0; + /** + * The workload profile is generic. + * + * Generated from protobuf enum GENERIC = 1; + */ + const GENERIC = 1; + /** + * The workload profile is hana. + * + * Generated from protobuf enum HANA = 2; + */ + const HANA = 2; + + private static $valueToName = [ + self::WORKLOAD_PROFILE_UNSPECIFIED => 'WORKLOAD_PROFILE_UNSPECIFIED', + self::GENERIC => 'GENERIC', + self::HANA => 'HANA', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(WorkloadProfile::class, \Google\Cloud\BareMetalSolution\V2\Volume_WorkloadProfile::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig.php new file mode 100644 index 000000000000..7778d4373a6d --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig.php @@ -0,0 +1,461 @@ +google.cloud.baremetalsolution.v2.VolumeConfig + */ +class VolumeConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the volume config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * A transient unique identifier to identify a volume within an + * ProvisioningConfig request. + * + * Generated from protobuf field string id = 2; + */ + protected $id = ''; + /** + * Whether snapshots should be enabled. + * + * Generated from protobuf field bool snapshots_enabled = 3; + */ + protected $snapshots_enabled = false; + /** + * The type of this Volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeConfig.Type type = 4; + */ + protected $type = 0; + /** + * Volume protocol. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeConfig.Protocol protocol = 5; + */ + protected $protocol = 0; + /** + * The requested size of this volume, in GB. + * + * Generated from protobuf field int32 size_gb = 6; + */ + protected $size_gb = 0; + /** + * LUN ranges to be configured. Set only when protocol is PROTOCOL_FC. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeConfig.LunRange lun_ranges = 7; + */ + private $lun_ranges; + /** + * Machine ids connected to this volume. Set only when protocol is + * PROTOCOL_FC. + * + * Generated from protobuf field repeated string machine_ids = 8; + */ + private $machine_ids; + /** + * NFS exports. Set only when protocol is PROTOCOL_NFS. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport nfs_exports = 9; + */ + private $nfs_exports; + /** + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * + * Generated from protobuf field string user_note = 10; + */ + protected $user_note = ''; + /** + * The GCP service of the storage volume. Available gcp_service are in + * https://cloud.google.com/bare-metal/docs/bms-planning. + * + * Generated from protobuf field string gcp_service = 11; + */ + protected $gcp_service = ''; + /** + * Performance tier of the Volume. + * Default is SHARED. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumePerformanceTier performance_tier = 12; + */ + protected $performance_tier = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the volume config. + * @type string $id + * A transient unique identifier to identify a volume within an + * ProvisioningConfig request. + * @type bool $snapshots_enabled + * Whether snapshots should be enabled. + * @type int $type + * The type of this Volume. + * @type int $protocol + * Volume protocol. + * @type int $size_gb + * The requested size of this volume, in GB. + * @type array<\Google\Cloud\BareMetalSolution\V2\VolumeConfig\LunRange>|\Google\Protobuf\Internal\RepeatedField $lun_ranges + * LUN ranges to be configured. Set only when protocol is PROTOCOL_FC. + * @type array|\Google\Protobuf\Internal\RepeatedField $machine_ids + * Machine ids connected to this volume. Set only when protocol is + * PROTOCOL_FC. + * @type array<\Google\Cloud\BareMetalSolution\V2\VolumeConfig\NfsExport>|\Google\Protobuf\Internal\RepeatedField $nfs_exports + * NFS exports. Set only when protocol is PROTOCOL_NFS. + * @type string $user_note + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * @type string $gcp_service + * The GCP service of the storage volume. Available gcp_service are in + * https://cloud.google.com/bare-metal/docs/bms-planning. + * @type int $performance_tier + * Performance tier of the Volume. + * Default is SHARED. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the volume config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the volume config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A transient unique identifier to identify a volume within an + * ProvisioningConfig request. + * + * Generated from protobuf field string id = 2; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * A transient unique identifier to identify a volume within an + * ProvisioningConfig request. + * + * Generated from protobuf field string id = 2; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Whether snapshots should be enabled. + * + * Generated from protobuf field bool snapshots_enabled = 3; + * @return bool + */ + public function getSnapshotsEnabled() + { + return $this->snapshots_enabled; + } + + /** + * Whether snapshots should be enabled. + * + * Generated from protobuf field bool snapshots_enabled = 3; + * @param bool $var + * @return $this + */ + public function setSnapshotsEnabled($var) + { + GPBUtil::checkBool($var); + $this->snapshots_enabled = $var; + + return $this; + } + + /** + * The type of this Volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeConfig.Type type = 4; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of this Volume. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeConfig.Type type = 4; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VolumeConfig\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Volume protocol. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeConfig.Protocol protocol = 5; + * @return int + */ + public function getProtocol() + { + return $this->protocol; + } + + /** + * Volume protocol. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeConfig.Protocol protocol = 5; + * @param int $var + * @return $this + */ + public function setProtocol($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VolumeConfig\Protocol::class); + $this->protocol = $var; + + return $this; + } + + /** + * The requested size of this volume, in GB. + * + * Generated from protobuf field int32 size_gb = 6; + * @return int + */ + public function getSizeGb() + { + return $this->size_gb; + } + + /** + * The requested size of this volume, in GB. + * + * Generated from protobuf field int32 size_gb = 6; + * @param int $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt32($var); + $this->size_gb = $var; + + return $this; + } + + /** + * LUN ranges to be configured. Set only when protocol is PROTOCOL_FC. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeConfig.LunRange lun_ranges = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLunRanges() + { + return $this->lun_ranges; + } + + /** + * LUN ranges to be configured. Set only when protocol is PROTOCOL_FC. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeConfig.LunRange lun_ranges = 7; + * @param array<\Google\Cloud\BareMetalSolution\V2\VolumeConfig\LunRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLunRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\VolumeConfig\LunRange::class); + $this->lun_ranges = $arr; + + return $this; + } + + /** + * Machine ids connected to this volume. Set only when protocol is + * PROTOCOL_FC. + * + * Generated from protobuf field repeated string machine_ids = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMachineIds() + { + return $this->machine_ids; + } + + /** + * Machine ids connected to this volume. Set only when protocol is + * PROTOCOL_FC. + * + * Generated from protobuf field repeated string machine_ids = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMachineIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->machine_ids = $arr; + + return $this; + } + + /** + * NFS exports. Set only when protocol is PROTOCOL_NFS. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport nfs_exports = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNfsExports() + { + return $this->nfs_exports; + } + + /** + * NFS exports. Set only when protocol is PROTOCOL_NFS. + * + * Generated from protobuf field repeated .google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport nfs_exports = 9; + * @param array<\Google\Cloud\BareMetalSolution\V2\VolumeConfig\NfsExport>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNfsExports($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\VolumeConfig\NfsExport::class); + $this->nfs_exports = $arr; + + return $this; + } + + /** + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * + * Generated from protobuf field string user_note = 10; + * @return string + */ + public function getUserNote() + { + return $this->user_note; + } + + /** + * User note field, it can be used by customers to add additional information + * for the BMS Ops team . + * + * Generated from protobuf field string user_note = 10; + * @param string $var + * @return $this + */ + public function setUserNote($var) + { + GPBUtil::checkString($var, True); + $this->user_note = $var; + + return $this; + } + + /** + * The GCP service of the storage volume. Available gcp_service are in + * https://cloud.google.com/bare-metal/docs/bms-planning. + * + * Generated from protobuf field string gcp_service = 11; + * @return string + */ + public function getGcpService() + { + return $this->gcp_service; + } + + /** + * The GCP service of the storage volume. Available gcp_service are in + * https://cloud.google.com/bare-metal/docs/bms-planning. + * + * Generated from protobuf field string gcp_service = 11; + * @param string $var + * @return $this + */ + public function setGcpService($var) + { + GPBUtil::checkString($var, True); + $this->gcp_service = $var; + + return $this; + } + + /** + * Performance tier of the Volume. + * Default is SHARED. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumePerformanceTier performance_tier = 12; + * @return int + */ + public function getPerformanceTier() + { + return $this->performance_tier; + } + + /** + * Performance tier of the Volume. + * Default is SHARED. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumePerformanceTier performance_tier = 12; + * @param int $var + * @return $this + */ + public function setPerformanceTier($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VolumePerformanceTier::class); + $this->performance_tier = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/LunRange.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/LunRange.php new file mode 100644 index 000000000000..eb66277f0448 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/LunRange.php @@ -0,0 +1,104 @@ +google.cloud.baremetalsolution.v2.VolumeConfig.LunRange + */ +class LunRange extends \Google\Protobuf\Internal\Message +{ + /** + * Number of LUNs to create. + * + * Generated from protobuf field int32 quantity = 1; + */ + protected $quantity = 0; + /** + * The requested size of each LUN, in GB. + * + * Generated from protobuf field int32 size_gb = 2; + */ + protected $size_gb = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $quantity + * Number of LUNs to create. + * @type int $size_gb + * The requested size of each LUN, in GB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Number of LUNs to create. + * + * Generated from protobuf field int32 quantity = 1; + * @return int + */ + public function getQuantity() + { + return $this->quantity; + } + + /** + * Number of LUNs to create. + * + * Generated from protobuf field int32 quantity = 1; + * @param int $var + * @return $this + */ + public function setQuantity($var) + { + GPBUtil::checkInt32($var); + $this->quantity = $var; + + return $this; + } + + /** + * The requested size of each LUN, in GB. + * + * Generated from protobuf field int32 size_gb = 2; + * @return int + */ + public function getSizeGb() + { + return $this->size_gb; + } + + /** + * The requested size of each LUN, in GB. + * + * Generated from protobuf field int32 size_gb = 2; + * @param int $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt32($var); + $this->size_gb = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LunRange::class, \Google\Cloud\BareMetalSolution\V2\VolumeConfig_LunRange::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/NfsExport.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/NfsExport.php new file mode 100644 index 000000000000..532d11d7a61f --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/NfsExport.php @@ -0,0 +1,292 @@ +google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport + */ +class NfsExport extends \Google\Protobuf\Internal\Message +{ + /** + * Network to use to publish the export. + * + * Generated from protobuf field string network_id = 1; + */ + protected $network_id = ''; + /** + * Export permissions. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport.Permissions permissions = 4; + */ + protected $permissions = 0; + /** + * Disable root squashing, which is a feature of NFS. + * Root squash is a special mapping of the remote superuser (root) identity + * when using identity authentication. + * + * Generated from protobuf field bool no_root_squash = 5; + */ + protected $no_root_squash = false; + /** + * Allow the setuid flag. + * + * Generated from protobuf field bool allow_suid = 6; + */ + protected $allow_suid = false; + /** + * Allow dev flag in NfsShare AllowedClientsRequest. + * + * Generated from protobuf field bool allow_dev = 7; + */ + protected $allow_dev = false; + protected $client; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_id + * Network to use to publish the export. + * @type string $machine_id + * Either a single machine, identified by an ID, or a comma-separated + * list of machine IDs. + * @type string $cidr + * A CIDR range. + * @type int $permissions + * Export permissions. + * @type bool $no_root_squash + * Disable root squashing, which is a feature of NFS. + * Root squash is a special mapping of the remote superuser (root) identity + * when using identity authentication. + * @type bool $allow_suid + * Allow the setuid flag. + * @type bool $allow_dev + * Allow dev flag in NfsShare AllowedClientsRequest. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce(); + parent::__construct($data); + } + + /** + * Network to use to publish the export. + * + * Generated from protobuf field string network_id = 1; + * @return string + */ + public function getNetworkId() + { + return $this->network_id; + } + + /** + * Network to use to publish the export. + * + * Generated from protobuf field string network_id = 1; + * @param string $var + * @return $this + */ + public function setNetworkId($var) + { + GPBUtil::checkString($var, True); + $this->network_id = $var; + + return $this; + } + + /** + * Either a single machine, identified by an ID, or a comma-separated + * list of machine IDs. + * + * Generated from protobuf field string machine_id = 2; + * @return string + */ + public function getMachineId() + { + return $this->readOneof(2); + } + + public function hasMachineId() + { + return $this->hasOneof(2); + } + + /** + * Either a single machine, identified by an ID, or a comma-separated + * list of machine IDs. + * + * Generated from protobuf field string machine_id = 2; + * @param string $var + * @return $this + */ + public function setMachineId($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A CIDR range. + * + * Generated from protobuf field string cidr = 3; + * @return string + */ + public function getCidr() + { + return $this->readOneof(3); + } + + public function hasCidr() + { + return $this->hasOneof(3); + } + + /** + * A CIDR range. + * + * Generated from protobuf field string cidr = 3; + * @param string $var + * @return $this + */ + public function setCidr($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Export permissions. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport.Permissions permissions = 4; + * @return int + */ + public function getPermissions() + { + return $this->permissions; + } + + /** + * Export permissions. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport.Permissions permissions = 4; + * @param int $var + * @return $this + */ + public function setPermissions($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VolumeConfig\NfsExport\Permissions::class); + $this->permissions = $var; + + return $this; + } + + /** + * Disable root squashing, which is a feature of NFS. + * Root squash is a special mapping of the remote superuser (root) identity + * when using identity authentication. + * + * Generated from protobuf field bool no_root_squash = 5; + * @return bool + */ + public function getNoRootSquash() + { + return $this->no_root_squash; + } + + /** + * Disable root squashing, which is a feature of NFS. + * Root squash is a special mapping of the remote superuser (root) identity + * when using identity authentication. + * + * Generated from protobuf field bool no_root_squash = 5; + * @param bool $var + * @return $this + */ + public function setNoRootSquash($var) + { + GPBUtil::checkBool($var); + $this->no_root_squash = $var; + + return $this; + } + + /** + * Allow the setuid flag. + * + * Generated from protobuf field bool allow_suid = 6; + * @return bool + */ + public function getAllowSuid() + { + return $this->allow_suid; + } + + /** + * Allow the setuid flag. + * + * Generated from protobuf field bool allow_suid = 6; + * @param bool $var + * @return $this + */ + public function setAllowSuid($var) + { + GPBUtil::checkBool($var); + $this->allow_suid = $var; + + return $this; + } + + /** + * Allow dev flag in NfsShare AllowedClientsRequest. + * + * Generated from protobuf field bool allow_dev = 7; + * @return bool + */ + public function getAllowDev() + { + return $this->allow_dev; + } + + /** + * Allow dev flag in NfsShare AllowedClientsRequest. + * + * Generated from protobuf field bool allow_dev = 7; + * @param bool $var + * @return $this + */ + public function setAllowDev($var) + { + GPBUtil::checkBool($var); + $this->allow_dev = $var; + + return $this; + } + + /** + * @return string + */ + public function getClient() + { + return $this->whichOneof("client"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NfsExport::class, \Google\Cloud\BareMetalSolution\V2\VolumeConfig_NfsExport::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/NfsExport/Permissions.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/NfsExport/Permissions.php new file mode 100644 index 000000000000..3df23bfc1717 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/NfsExport/Permissions.php @@ -0,0 +1,64 @@ +google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport.Permissions + */ +class Permissions +{ + /** + * Unspecified value. + * + * Generated from protobuf enum PERMISSIONS_UNSPECIFIED = 0; + */ + const PERMISSIONS_UNSPECIFIED = 0; + /** + * Read-only permission. + * + * Generated from protobuf enum READ_ONLY = 1; + */ + const READ_ONLY = 1; + /** + * Read-write permission. + * + * Generated from protobuf enum READ_WRITE = 2; + */ + const READ_WRITE = 2; + + private static $valueToName = [ + self::PERMISSIONS_UNSPECIFIED => 'PERMISSIONS_UNSPECIFIED', + self::READ_ONLY => 'READ_ONLY', + self::READ_WRITE => 'READ_WRITE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Permissions::class, \Google\Cloud\BareMetalSolution\V2\VolumeConfig_NfsExport_Permissions::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/Protocol.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/Protocol.php new file mode 100644 index 000000000000..65bef81f7778 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/Protocol.php @@ -0,0 +1,64 @@ +google.cloud.baremetalsolution.v2.VolumeConfig.Protocol + */ +class Protocol +{ + /** + * Unspecified value. + * + * Generated from protobuf enum PROTOCOL_UNSPECIFIED = 0; + */ + const PROTOCOL_UNSPECIFIED = 0; + /** + * Fibre channel. + * + * Generated from protobuf enum PROTOCOL_FC = 1; + */ + const PROTOCOL_FC = 1; + /** + * Network file system. + * + * Generated from protobuf enum PROTOCOL_NFS = 2; + */ + const PROTOCOL_NFS = 2; + + private static $valueToName = [ + self::PROTOCOL_UNSPECIFIED => 'PROTOCOL_UNSPECIFIED', + self::PROTOCOL_FC => 'PROTOCOL_FC', + self::PROTOCOL_NFS => 'PROTOCOL_NFS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Protocol::class, \Google\Cloud\BareMetalSolution\V2\VolumeConfig_Protocol::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/Type.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/Type.php new file mode 100644 index 000000000000..625c45b1595a --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeConfig/Type.php @@ -0,0 +1,64 @@ +google.cloud.baremetalsolution.v2.VolumeConfig.Type + */ +class Type +{ + /** + * The unspecified type. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * This Volume is on flash. + * + * Generated from protobuf enum FLASH = 1; + */ + const FLASH = 1; + /** + * This Volume is on disk. + * + * Generated from protobuf enum DISK = 2; + */ + const DISK = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::FLASH => 'FLASH', + self::DISK => 'DISK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\BareMetalSolution\V2\VolumeConfig_Type::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumePerformanceTier.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumePerformanceTier.php new file mode 100644 index 000000000000..7297104a7429 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumePerformanceTier.php @@ -0,0 +1,68 @@ +google.cloud.baremetalsolution.v2.VolumePerformanceTier + */ +class VolumePerformanceTier +{ + /** + * Value is not specified. + * + * Generated from protobuf enum VOLUME_PERFORMANCE_TIER_UNSPECIFIED = 0; + */ + const VOLUME_PERFORMANCE_TIER_UNSPECIFIED = 0; + /** + * Regular volumes, shared aggregates. + * + * Generated from protobuf enum VOLUME_PERFORMANCE_TIER_SHARED = 1; + */ + const VOLUME_PERFORMANCE_TIER_SHARED = 1; + /** + * Assigned aggregates. + * + * Generated from protobuf enum VOLUME_PERFORMANCE_TIER_ASSIGNED = 2; + */ + const VOLUME_PERFORMANCE_TIER_ASSIGNED = 2; + /** + * High throughput aggregates. + * + * Generated from protobuf enum VOLUME_PERFORMANCE_TIER_HT = 3; + */ + const VOLUME_PERFORMANCE_TIER_HT = 3; + + private static $valueToName = [ + self::VOLUME_PERFORMANCE_TIER_UNSPECIFIED => 'VOLUME_PERFORMANCE_TIER_UNSPECIFIED', + self::VOLUME_PERFORMANCE_TIER_SHARED => 'VOLUME_PERFORMANCE_TIER_SHARED', + self::VOLUME_PERFORMANCE_TIER_ASSIGNED => 'VOLUME_PERFORMANCE_TIER_ASSIGNED', + self::VOLUME_PERFORMANCE_TIER_HT => 'VOLUME_PERFORMANCE_TIER_HT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeSnapshot.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeSnapshot.php new file mode 100644 index 000000000000..0f373073648f --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeSnapshot.php @@ -0,0 +1,251 @@ +google.cloud.baremetalsolution.v2.VolumeSnapshot + */ +class VolumeSnapshot extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the snapshot. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. An identifier for the snapshot, generated by the backend. + * + * Generated from protobuf field string id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $id = ''; + /** + * The description of the snapshot. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Output only. The creation time of the snapshot. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The name of the volume which this snapshot belongs to. + * + * Generated from protobuf field string storage_volume = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $storage_volume = ''; + /** + * Output only. The type of the snapshot which indicates whether it was + * scheduled or manual/ad-hoc. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeSnapshot.SnapshotType type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the snapshot. + * @type string $id + * Output only. An identifier for the snapshot, generated by the backend. + * @type string $description + * The description of the snapshot. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time of the snapshot. + * @type string $storage_volume + * Output only. The name of the volume which this snapshot belongs to. + * @type int $type + * Output only. The type of the snapshot which indicates whether it was + * scheduled or manual/ad-hoc. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Baremetalsolution\V2\VolumeSnapshot::initOnce(); + parent::__construct($data); + } + + /** + * The name of the snapshot. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the snapshot. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. An identifier for the snapshot, generated by the backend. + * + * Generated from protobuf field string id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Output only. An identifier for the snapshot, generated by the backend. + * + * Generated from protobuf field string id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The description of the snapshot. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * The description of the snapshot. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The creation time of the snapshot. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The creation time of the snapshot. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The name of the volume which this snapshot belongs to. + * + * Generated from protobuf field string storage_volume = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getStorageVolume() + { + return $this->storage_volume; + } + + /** + * Output only. The name of the volume which this snapshot belongs to. + * + * Generated from protobuf field string storage_volume = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setStorageVolume($var) + { + GPBUtil::checkString($var, True); + $this->storage_volume = $var; + + return $this; + } + + /** + * Output only. The type of the snapshot which indicates whether it was + * scheduled or manual/ad-hoc. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeSnapshot.SnapshotType type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Output only. The type of the snapshot which indicates whether it was + * scheduled or manual/ad-hoc. + * + * Generated from protobuf field .google.cloud.baremetalsolution.v2.VolumeSnapshot.SnapshotType type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VolumeSnapshot\SnapshotType::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeSnapshot/SnapshotType.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeSnapshot/SnapshotType.php new file mode 100644 index 000000000000..cb33991c9af7 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/VolumeSnapshot/SnapshotType.php @@ -0,0 +1,64 @@ +google.cloud.baremetalsolution.v2.VolumeSnapshot.SnapshotType + */ +class SnapshotType +{ + /** + * Type is not specified. + * + * Generated from protobuf enum SNAPSHOT_TYPE_UNSPECIFIED = 0; + */ + const SNAPSHOT_TYPE_UNSPECIFIED = 0; + /** + * Snapshot was taken manually by user. + * + * Generated from protobuf enum AD_HOC = 1; + */ + const AD_HOC = 1; + /** + * Snapshot was taken automatically as a part of a snapshot schedule. + * + * Generated from protobuf enum SCHEDULED = 2; + */ + const SCHEDULED = 2; + + private static $valueToName = [ + self::SNAPSHOT_TYPE_UNSPECIFIED => 'SNAPSHOT_TYPE_UNSPECIFIED', + self::AD_HOC => 'AD_HOC', + self::SCHEDULED => 'SCHEDULED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SnapshotType::class, \Google\Cloud\BareMetalSolution\V2\VolumeSnapshot_SnapshotType::class); + diff --git a/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/WorkloadProfile.php b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/WorkloadProfile.php new file mode 100644 index 000000000000..fc772fed0a51 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/proto/src/Google/Cloud/BareMetalSolution/V2/WorkloadProfile.php @@ -0,0 +1,61 @@ +google.cloud.baremetalsolution.v2.WorkloadProfile + */ +class WorkloadProfile +{ + /** + * The workload profile is in an unknown state. + * + * Generated from protobuf enum WORKLOAD_PROFILE_UNSPECIFIED = 0; + */ + const WORKLOAD_PROFILE_UNSPECIFIED = 0; + /** + * The workload profile is generic. + * + * Generated from protobuf enum WORKLOAD_PROFILE_GENERIC = 1; + */ + const WORKLOAD_PROFILE_GENERIC = 1; + /** + * The workload profile is hana. + * + * Generated from protobuf enum WORKLOAD_PROFILE_HANA = 2; + */ + const WORKLOAD_PROFILE_HANA = 2; + + private static $valueToName = [ + self::WORKLOAD_PROFILE_UNSPECIFIED => 'WORKLOAD_PROFILE_UNSPECIFIED', + self::WORKLOAD_PROFILE_GENERIC => 'WORKLOAD_PROFILE_GENERIC', + self::WORKLOAD_PROFILE_HANA => 'WORKLOAD_PROFILE_HANA', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_nfs_share.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_nfs_share.php new file mode 100644 index 000000000000..ed4d0a74f15e --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_nfs_share.php @@ -0,0 +1,85 @@ +setParent($formattedParent) + ->setNfsShare($nfsShare); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->createNfsShare($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var NfsShare $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + + create_nfs_share_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_CreateNfsShare_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_provisioning_config.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_provisioning_config.php new file mode 100644 index 000000000000..9bc3a6586138 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_provisioning_config.php @@ -0,0 +1,74 @@ +setParent($formattedParent) + ->setProvisioningConfig($provisioningConfig); + + // Call the API and handle any network failures. + try { + /** @var ProvisioningConfig $response */ + $response = $bareMetalSolutionClient->createProvisioningConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + + create_provisioning_config_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_CreateProvisioningConfig_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_ssh_key.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_ssh_key.php new file mode 100644 index 000000000000..41135bb514d1 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_ssh_key.php @@ -0,0 +1,81 @@ +setParent($formattedParent) + ->setSshKey($sshKey) + ->setSshKeyId($sshKeyId); + + // Call the API and handle any network failures. + try { + /** @var SSHKey $response */ + $response = $bareMetalSolutionClient->createSSHKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + $sshKeyId = '[SSH_KEY_ID]'; + + create_ssh_key_sample($formattedParent, $sshKeyId); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_CreateSSHKey_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_volume_snapshot.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_volume_snapshot.php new file mode 100644 index 000000000000..28173c28bd82 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/create_volume_snapshot.php @@ -0,0 +1,74 @@ +setParent($formattedParent) + ->setVolumeSnapshot($volumeSnapshot); + + // Call the API and handle any network failures. + try { + /** @var VolumeSnapshot $response */ + $response = $bareMetalSolutionClient->createVolumeSnapshot($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + + create_volume_snapshot_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_CreateVolumeSnapshot_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/delete_nfs_share.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/delete_nfs_share.php new file mode 100644 index 000000000000..e2dce3818dce --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/delete_nfs_share.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->deleteNfsShare($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::nFSShareName('[PROJECT]', '[LOCATION]', '[NFS_SHARE]'); + + delete_nfs_share_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_DeleteNfsShare_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/delete_ssh_key.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/delete_ssh_key.php new file mode 100644 index 000000000000..6f0600e1afa2 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/delete_ssh_key.php @@ -0,0 +1,70 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $bareMetalSolutionClient->deleteSSHKey($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::sshKeyName('[PROJECT]', '[LOCATION]', '[SSH_KEY]'); + + delete_ssh_key_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_DeleteSSHKey_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/delete_volume_snapshot.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/delete_volume_snapshot.php new file mode 100644 index 000000000000..a2efad4389bd --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/delete_volume_snapshot.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $bareMetalSolutionClient->deleteVolumeSnapshot($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::volumeSnapshotName( + '[PROJECT]', + '[LOCATION]', + '[VOLUME]', + '[SNAPSHOT]' + ); + + delete_volume_snapshot_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_DeleteVolumeSnapshot_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/detach_lun.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/detach_lun.php new file mode 100644 index 000000000000..b9eaca3c7003 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/detach_lun.php @@ -0,0 +1,87 @@ +setInstance($formattedInstance) + ->setLun($formattedLun); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->detachLun($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedInstance = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $formattedLun = BareMetalSolutionClient::lunName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[LUN]'); + + detach_lun_sample($formattedInstance, $formattedLun); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_DetachLun_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/disable_interactive_serial_console.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/disable_interactive_serial_console.php new file mode 100644 index 000000000000..179a72f1910e --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/disable_interactive_serial_console.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->disableInteractiveSerialConsole($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var DisableInteractiveSerialConsoleResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + disable_interactive_serial_console_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_DisableInteractiveSerialConsole_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/enable_interactive_serial_console.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/enable_interactive_serial_console.php new file mode 100644 index 000000000000..9861ffcaddea --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/enable_interactive_serial_console.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->enableInteractiveSerialConsole($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var EnableInteractiveSerialConsoleResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + enable_interactive_serial_console_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_EnableInteractiveSerialConsole_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/evict_lun.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/evict_lun.php new file mode 100644 index 000000000000..05f1470156bf --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/evict_lun.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->evictLun($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::lunName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[LUN]'); + + evict_lun_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_EvictLun_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/evict_volume.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/evict_volume.php new file mode 100644 index 000000000000..0d7f59bd5e2d --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/evict_volume.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->evictVolume($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + + evict_volume_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_EvictVolume_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_instance.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_instance.php new file mode 100644 index 000000000000..7816e83709e2 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_instance.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Instance $response */ + $response = $bareMetalSolutionClient->getInstance($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + get_instance_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_GetInstance_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_location.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_location.php new file mode 100644 index 000000000000..baadc6bed0c9 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END baremetalsolution_v2_generated_BareMetalSolution_GetLocation_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_lun.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_lun.php new file mode 100644 index 000000000000..d249f64d398f --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_lun.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Lun $response */ + $response = $bareMetalSolutionClient->getLun($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::lunName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[LUN]'); + + get_lun_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_GetLun_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_network.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_network.php new file mode 100644 index 000000000000..6f1fb0c3f793 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_network.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Network $response */ + $response = $bareMetalSolutionClient->getNetwork($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::networkName('[PROJECT]', '[LOCATION]', '[NETWORK]'); + + get_network_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_GetNetwork_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_nfs_share.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_nfs_share.php new file mode 100644 index 000000000000..88188b923791 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_nfs_share.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var NfsShare $response */ + $response = $bareMetalSolutionClient->getNfsShare($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::nFSShareName('[PROJECT]', '[LOCATION]', '[NFS_SHARE]'); + + get_nfs_share_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_GetNfsShare_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_provisioning_config.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_provisioning_config.php new file mode 100644 index 000000000000..59411c40cdf4 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_provisioning_config.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ProvisioningConfig $response */ + $response = $bareMetalSolutionClient->getProvisioningConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::provisioningConfigName( + '[PROJECT]', + '[LOCATION]', + '[PROVISIONING_CONFIG]' + ); + + get_provisioning_config_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_GetProvisioningConfig_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_volume.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_volume.php new file mode 100644 index 000000000000..185a81d1cc7c --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_volume.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Volume $response */ + $response = $bareMetalSolutionClient->getVolume($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + + get_volume_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_GetVolume_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_volume_snapshot.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_volume_snapshot.php new file mode 100644 index 000000000000..0ff4ff5ca193 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/get_volume_snapshot.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var VolumeSnapshot $response */ + $response = $bareMetalSolutionClient->getVolumeSnapshot($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::volumeSnapshotName( + '[PROJECT]', + '[LOCATION]', + '[VOLUME]', + '[SNAPSHOT]' + ); + + get_volume_snapshot_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_GetVolumeSnapshot_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_instances.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_instances.php new file mode 100644 index 000000000000..ebbe9c0fb0d4 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_instances.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bareMetalSolutionClient->listInstances($request); + + /** @var Instance $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + + list_instances_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ListInstances_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_locations.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_locations.php new file mode 100644 index 000000000000..c0182ac269c0 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ListLocations_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_luns.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_luns.php new file mode 100644 index 000000000000..04c6ec4f4e83 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_luns.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bareMetalSolutionClient->listLuns($request); + + /** @var Lun $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + + list_luns_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ListLuns_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_network_usage.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_network_usage.php new file mode 100644 index 000000000000..50c7b4987643 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_network_usage.php @@ -0,0 +1,72 @@ +setLocation($formattedLocation); + + // Call the API and handle any network failures. + try { + /** @var ListNetworkUsageResponse $response */ + $response = $bareMetalSolutionClient->listNetworkUsage($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedLocation = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + + list_network_usage_sample($formattedLocation); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ListNetworkUsage_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_networks.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_networks.php new file mode 100644 index 000000000000..b08ac94895c3 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_networks.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bareMetalSolutionClient->listNetworks($request); + + /** @var Network $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + + list_networks_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ListNetworks_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_nfs_shares.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_nfs_shares.php new file mode 100644 index 000000000000..58724afd9e66 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_nfs_shares.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bareMetalSolutionClient->listNfsShares($request); + + /** @var NfsShare $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + + list_nfs_shares_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ListNfsShares_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_os_images.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_os_images.php new file mode 100644 index 000000000000..73a9f72ba49c --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_os_images.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bareMetalSolutionClient->listOSImages($request); + + /** @var OSImage $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + + list_os_images_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ListOSImages_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_provisioning_quotas.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_provisioning_quotas.php new file mode 100644 index 000000000000..d20ebcac0d81 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_provisioning_quotas.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bareMetalSolutionClient->listProvisioningQuotas($request); + + /** @var ProvisioningQuota $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + + list_provisioning_quotas_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ListProvisioningQuotas_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_ssh_keys.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_ssh_keys.php new file mode 100644 index 000000000000..05d9976d2d4a --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_ssh_keys.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bareMetalSolutionClient->listSSHKeys($request); + + /** @var SSHKey $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + + list_ssh_keys_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ListSSHKeys_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_volume_snapshots.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_volume_snapshots.php new file mode 100644 index 000000000000..ec6187beb2d3 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_volume_snapshots.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bareMetalSolutionClient->listVolumeSnapshots($request); + + /** @var VolumeSnapshot $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + + list_volume_snapshots_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ListVolumeSnapshots_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_volumes.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_volumes.php new file mode 100644 index 000000000000..d5ee384a4368 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/list_volumes.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bareMetalSolutionClient->listVolumes($request); + + /** @var Volume $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + + list_volumes_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ListVolumes_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_instance.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_instance.php new file mode 100644 index 000000000000..e3626707d59e --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_instance.php @@ -0,0 +1,76 @@ +setName($formattedName) + ->setNewInstanceId($newInstanceId); + + // Call the API and handle any network failures. + try { + /** @var Instance $response */ + $response = $bareMetalSolutionClient->renameInstance($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $newInstanceId = '[NEW_INSTANCE_ID]'; + + rename_instance_sample($formattedName, $newInstanceId); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_RenameInstance_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_network.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_network.php new file mode 100644 index 000000000000..b57757e6efd4 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_network.php @@ -0,0 +1,76 @@ +setName($formattedName) + ->setNewNetworkId($newNetworkId); + + // Call the API and handle any network failures. + try { + /** @var Network $response */ + $response = $bareMetalSolutionClient->renameNetwork($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::networkName('[PROJECT]', '[LOCATION]', '[NETWORK]'); + $newNetworkId = '[NEW_NETWORK_ID]'; + + rename_network_sample($formattedName, $newNetworkId); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_RenameNetwork_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_nfs_share.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_nfs_share.php new file mode 100644 index 000000000000..1dd1547c1a6b --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_nfs_share.php @@ -0,0 +1,76 @@ +setName($formattedName) + ->setNewNfsshareId($newNfsshareId); + + // Call the API and handle any network failures. + try { + /** @var NfsShare $response */ + $response = $bareMetalSolutionClient->renameNfsShare($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::nFSShareName('[PROJECT]', '[LOCATION]', '[NFS_SHARE]'); + $newNfsshareId = '[NEW_NFSSHARE_ID]'; + + rename_nfs_share_sample($formattedName, $newNfsshareId); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_RenameNfsShare_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_volume.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_volume.php new file mode 100644 index 000000000000..22257d66071e --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/rename_volume.php @@ -0,0 +1,76 @@ +setName($formattedName) + ->setNewVolumeId($newVolumeId); + + // Call the API and handle any network failures. + try { + /** @var Volume $response */ + $response = $bareMetalSolutionClient->renameVolume($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $newVolumeId = '[NEW_VOLUME_ID]'; + + rename_volume_sample($formattedName, $newVolumeId); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_RenameVolume_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/reset_instance.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/reset_instance.php new file mode 100644 index 000000000000..0757737dd1bb --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/reset_instance.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->resetInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ResetInstanceResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + reset_instance_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ResetInstance_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/resize_volume.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/resize_volume.php new file mode 100644 index 000000000000..e71be72e3fab --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/resize_volume.php @@ -0,0 +1,83 @@ +setVolume($formattedVolume); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->resizeVolume($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Volume $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedVolume = BareMetalSolutionClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + + resize_volume_sample($formattedVolume); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_ResizeVolume_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/restore_volume_snapshot.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/restore_volume_snapshot.php new file mode 100644 index 000000000000..0c6dba96a751 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/restore_volume_snapshot.php @@ -0,0 +1,90 @@ +setVolumeSnapshot($formattedVolumeSnapshot); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->restoreVolumeSnapshot($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var VolumeSnapshot $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedVolumeSnapshot = BareMetalSolutionClient::volumeSnapshotName( + '[PROJECT]', + '[LOCATION]', + '[VOLUME]', + '[SNAPSHOT]' + ); + + restore_volume_snapshot_sample($formattedVolumeSnapshot); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_RestoreVolumeSnapshot_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/start_instance.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/start_instance.php new file mode 100644 index 000000000000..e1edfde7a964 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/start_instance.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->startInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var StartInstanceResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + start_instance_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_StartInstance_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/stop_instance.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/stop_instance.php new file mode 100644 index 000000000000..56e08ba240bd --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/stop_instance.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->stopInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var StopInstanceResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + stop_instance_sample($formattedName); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_StopInstance_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/submit_provisioning_config.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/submit_provisioning_config.php new file mode 100644 index 000000000000..4fc592a83cc5 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/submit_provisioning_config.php @@ -0,0 +1,75 @@ +setParent($formattedParent) + ->setProvisioningConfig($provisioningConfig); + + // Call the API and handle any network failures. + try { + /** @var SubmitProvisioningConfigResponse $response */ + $response = $bareMetalSolutionClient->submitProvisioningConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]'); + + submit_provisioning_config_sample($formattedParent); +} +// [END baremetalsolution_v2_generated_BareMetalSolution_SubmitProvisioningConfig_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_instance.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_instance.php new file mode 100644 index 000000000000..75a782c8fb99 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_instance.php @@ -0,0 +1,71 @@ +setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->updateInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END baremetalsolution_v2_generated_BareMetalSolution_UpdateInstance_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_network.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_network.php new file mode 100644 index 000000000000..bd16181fe008 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_network.php @@ -0,0 +1,71 @@ +setNetwork($network); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->updateNetwork($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Network $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END baremetalsolution_v2_generated_BareMetalSolution_UpdateNetwork_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_nfs_share.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_nfs_share.php new file mode 100644 index 000000000000..8d56c47b34ca --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_nfs_share.php @@ -0,0 +1,71 @@ +setNfsShare($nfsShare); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->updateNfsShare($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var NfsShare $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END baremetalsolution_v2_generated_BareMetalSolution_UpdateNfsShare_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_provisioning_config.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_provisioning_config.php new file mode 100644 index 000000000000..3d07d4d712d2 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_provisioning_config.php @@ -0,0 +1,62 @@ +setProvisioningConfig($provisioningConfig) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var ProvisioningConfig $response */ + $response = $bareMetalSolutionClient->updateProvisioningConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END baremetalsolution_v2_generated_BareMetalSolution_UpdateProvisioningConfig_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_volume.php b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_volume.php new file mode 100644 index 000000000000..705fcc7c9cdd --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/samples/V2/BareMetalSolutionClient/update_volume.php @@ -0,0 +1,71 @@ +setVolume($volume); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bareMetalSolutionClient->updateVolume($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Volume $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END baremetalsolution_v2_generated_BareMetalSolution_UpdateVolume_sync] diff --git a/owl-bot-staging/BareMetalSolution/v2/src/V2/Client/BareMetalSolutionClient.php b/owl-bot-staging/BareMetalSolution/v2/src/V2/Client/BareMetalSolutionClient.php new file mode 100644 index 000000000000..7d06d68ffa71 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/src/V2/Client/BareMetalSolutionClient.php @@ -0,0 +1,1860 @@ + createNfsShareAsync(CreateNfsShareRequest $request, array $optionalArgs = []) + * @method PromiseInterface createProvisioningConfigAsync(CreateProvisioningConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface createSSHKeyAsync(CreateSSHKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface createVolumeSnapshotAsync(CreateVolumeSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteNfsShareAsync(DeleteNfsShareRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSSHKeyAsync(DeleteSSHKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteVolumeSnapshotAsync(DeleteVolumeSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface detachLunAsync(DetachLunRequest $request, array $optionalArgs = []) + * @method PromiseInterface disableInteractiveSerialConsoleAsync(DisableInteractiveSerialConsoleRequest $request, array $optionalArgs = []) + * @method PromiseInterface enableInteractiveSerialConsoleAsync(EnableInteractiveSerialConsoleRequest $request, array $optionalArgs = []) + * @method PromiseInterface evictLunAsync(EvictLunRequest $request, array $optionalArgs = []) + * @method PromiseInterface evictVolumeAsync(EvictVolumeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getInstanceAsync(GetInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLunAsync(GetLunRequest $request, array $optionalArgs = []) + * @method PromiseInterface getNetworkAsync(GetNetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface getNfsShareAsync(GetNfsShareRequest $request, array $optionalArgs = []) + * @method PromiseInterface getProvisioningConfigAsync(GetProvisioningConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface getVolumeAsync(GetVolumeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getVolumeSnapshotAsync(GetVolumeSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLunsAsync(ListLunsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listNetworkUsageAsync(ListNetworkUsageRequest $request, array $optionalArgs = []) + * @method PromiseInterface listNetworksAsync(ListNetworksRequest $request, array $optionalArgs = []) + * @method PromiseInterface listNfsSharesAsync(ListNfsSharesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listOSImagesAsync(ListOSImagesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listProvisioningQuotasAsync(ListProvisioningQuotasRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSSHKeysAsync(ListSSHKeysRequest $request, array $optionalArgs = []) + * @method PromiseInterface listVolumeSnapshotsAsync(ListVolumeSnapshotsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listVolumesAsync(ListVolumesRequest $request, array $optionalArgs = []) + * @method PromiseInterface renameInstanceAsync(RenameInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface renameNetworkAsync(RenameNetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface renameNfsShareAsync(RenameNfsShareRequest $request, array $optionalArgs = []) + * @method PromiseInterface renameVolumeAsync(RenameVolumeRequest $request, array $optionalArgs = []) + * @method PromiseInterface resetInstanceAsync(ResetInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface resizeVolumeAsync(ResizeVolumeRequest $request, array $optionalArgs = []) + * @method PromiseInterface restoreVolumeSnapshotAsync(RestoreVolumeSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface startInstanceAsync(StartInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface stopInstanceAsync(StopInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface submitProvisioningConfigAsync(SubmitProvisioningConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateInstanceAsync(UpdateInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateNetworkAsync(UpdateNetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateNfsShareAsync(UpdateNfsShareRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateProvisioningConfigAsync(UpdateProvisioningConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateVolumeAsync(UpdateVolumeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class BareMetalSolutionClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.baremetalsolution.v2.BareMetalSolution'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'baremetalsolution.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'baremetalsolution.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/bare_metal_solution_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/bare_metal_solution_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/bare_metal_solution_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/bare_metal_solution_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $location + * @param string $instance + * + * @return string The formatted instance resource. + */ + public static function instanceName(string $project, string $location, string $instance): string + { + return self::getPathTemplate('instance')->render([ + 'project' => $project, + 'location' => $location, + 'instance' => $instance, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * instance_config resource. + * + * @param string $project + * @param string $location + * @param string $instanceConfig + * + * @return string The formatted instance_config resource. + */ + public static function instanceConfigName(string $project, string $location, string $instanceConfig): string + { + return self::getPathTemplate('instanceConfig')->render([ + 'project' => $project, + 'location' => $location, + 'instance_config' => $instanceConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * interconnect_attachment resource. + * + * @param string $project + * @param string $region + * @param string $interconnectAttachment + * + * @return string The formatted interconnect_attachment resource. + */ + public static function interconnectAttachmentName(string $project, string $region, string $interconnectAttachment): string + { + return self::getPathTemplate('interconnectAttachment')->render([ + 'project' => $project, + 'region' => $region, + 'interconnect_attachment' => $interconnectAttachment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a lun + * resource. + * + * @param string $project + * @param string $location + * @param string $volume + * @param string $lun + * + * @return string The formatted lun resource. + */ + public static function lunName(string $project, string $location, string $volume, string $lun): string + { + return self::getPathTemplate('lun')->render([ + 'project' => $project, + 'location' => $location, + 'volume' => $volume, + 'lun' => $lun, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a nfs_share + * resource. + * + * @param string $project + * @param string $location + * @param string $nfsShare + * + * @return string The formatted nfs_share resource. + */ + public static function nFSShareName(string $project, string $location, string $nfsShare): string + { + return self::getPathTemplate('nFSShare')->render([ + 'project' => $project, + 'location' => $location, + 'nfs_share' => $nfsShare, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $location + * @param string $network + * + * @return string The formatted network resource. + */ + public static function networkName(string $project, string $location, string $network): string + { + return self::getPathTemplate('network')->render([ + 'project' => $project, + 'location' => $location, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * network_config resource. + * + * @param string $project + * @param string $location + * @param string $networkConfig + * + * @return string The formatted network_config resource. + */ + public static function networkConfigName(string $project, string $location, string $networkConfig): string + { + return self::getPathTemplate('networkConfig')->render([ + 'project' => $project, + 'location' => $location, + 'network_config' => $networkConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * provisioning_config resource. + * + * @param string $project + * @param string $location + * @param string $provisioningConfig + * + * @return string The formatted provisioning_config resource. + */ + public static function provisioningConfigName(string $project, string $location, string $provisioningConfig): string + { + return self::getPathTemplate('provisioningConfig')->render([ + 'project' => $project, + 'location' => $location, + 'provisioning_config' => $provisioningConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * server_network_template resource. + * + * @param string $project + * @param string $location + * @param string $serverNetworkTemplate + * + * @return string The formatted server_network_template resource. + */ + public static function serverNetworkTemplateName(string $project, string $location, string $serverNetworkTemplate): string + { + return self::getPathTemplate('serverNetworkTemplate')->render([ + 'project' => $project, + 'location' => $location, + 'server_network_template' => $serverNetworkTemplate, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a ssh_key + * resource. + * + * @param string $project + * @param string $location + * @param string $sshKey + * + * @return string The formatted ssh_key resource. + */ + public static function sshKeyName(string $project, string $location, string $sshKey): string + { + return self::getPathTemplate('sshKey')->render([ + 'project' => $project, + 'location' => $location, + 'ssh_key' => $sshKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a volume + * resource. + * + * @param string $project + * @param string $location + * @param string $volume + * + * @return string The formatted volume resource. + */ + public static function volumeName(string $project, string $location, string $volume): string + { + return self::getPathTemplate('volume')->render([ + 'project' => $project, + 'location' => $location, + 'volume' => $volume, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * volume_config resource. + * + * @param string $project + * @param string $location + * @param string $volumeConfig + * + * @return string The formatted volume_config resource. + */ + public static function volumeConfigName(string $project, string $location, string $volumeConfig): string + { + return self::getPathTemplate('volumeConfig')->render([ + 'project' => $project, + 'location' => $location, + 'volume_config' => $volumeConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * volume_snapshot resource. + * + * @param string $project + * @param string $location + * @param string $volume + * @param string $snapshot + * + * @return string The formatted volume_snapshot resource. + */ + public static function volumeSnapshotName(string $project, string $location, string $volume, string $snapshot): string + { + return self::getPathTemplate('volumeSnapshot')->render([ + 'project' => $project, + 'location' => $location, + 'volume' => $volume, + 'snapshot' => $snapshot, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - instance: projects/{project}/locations/{location}/instances/{instance} + * - instanceConfig: projects/{project}/locations/{location}/instanceConfigs/{instance_config} + * - interconnectAttachment: projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment} + * - location: projects/{project}/locations/{location} + * - lun: projects/{project}/locations/{location}/volumes/{volume}/luns/{lun} + * - nFSShare: projects/{project}/locations/{location}/nfsShares/{nfs_share} + * - network: projects/{project}/locations/{location}/networks/{network} + * - networkConfig: projects/{project}/locations/{location}/networkConfigs/{network_config} + * - provisioningConfig: projects/{project}/locations/{location}/provisioningConfigs/{provisioning_config} + * - serverNetworkTemplate: projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template} + * - sshKey: projects/{project}/locations/{location}/sshKeys/{ssh_key} + * - volume: projects/{project}/locations/{location}/volumes/{volume} + * - volumeConfig: projects/{project}/locations/{location}/volumeConfigs/{volume_config} + * - volumeSnapshot: projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'baremetalsolution.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Create an NFS share. + * + * The async variant is {@see BareMetalSolutionClient::createNfsShareAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/create_nfs_share.php + * + * @param CreateNfsShareRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createNfsShare(CreateNfsShareRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateNfsShare', $request, $callOptions)->wait(); + } + + /** + * Create new ProvisioningConfig. + * + * The async variant is + * {@see BareMetalSolutionClient::createProvisioningConfigAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/create_provisioning_config.php + * + * @param CreateProvisioningConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ProvisioningConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function createProvisioningConfig(CreateProvisioningConfigRequest $request, array $callOptions = []): ProvisioningConfig + { + return $this->startApiCall('CreateProvisioningConfig', $request, $callOptions)->wait(); + } + + /** + * Register a public SSH key in the specified project for use with the + * interactive serial console feature. + * + * The async variant is {@see BareMetalSolutionClient::createSSHKeyAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/create_ssh_key.php + * + * @param CreateSSHKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SSHKey + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSSHKey(CreateSSHKeyRequest $request, array $callOptions = []): SSHKey + { + return $this->startApiCall('CreateSSHKey', $request, $callOptions)->wait(); + } + + /** + * Takes a snapshot of a boot volume. + * Returns INVALID_ARGUMENT if called for a non-boot volume. + * + * The async variant is {@see BareMetalSolutionClient::createVolumeSnapshotAsync()} + * . + * + * @example samples/V2/BareMetalSolutionClient/create_volume_snapshot.php + * + * @param CreateVolumeSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return VolumeSnapshot + * + * @throws ApiException Thrown if the API call fails. + */ + public function createVolumeSnapshot(CreateVolumeSnapshotRequest $request, array $callOptions = []): VolumeSnapshot + { + return $this->startApiCall('CreateVolumeSnapshot', $request, $callOptions)->wait(); + } + + /** + * Delete an NFS share. The underlying volume is automatically deleted. + * + * The async variant is {@see BareMetalSolutionClient::deleteNfsShareAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/delete_nfs_share.php + * + * @param DeleteNfsShareRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteNfsShare(DeleteNfsShareRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteNfsShare', $request, $callOptions)->wait(); + } + + /** + * Deletes a public SSH key registered in the specified project. + * + * The async variant is {@see BareMetalSolutionClient::deleteSSHKeyAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/delete_ssh_key.php + * + * @param DeleteSSHKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSSHKey(DeleteSSHKeyRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSSHKey', $request, $callOptions)->wait(); + } + + /** + * Deletes a volume snapshot. + * Returns INVALID_ARGUMENT if called for a non-boot volume. + * + * The async variant is {@see BareMetalSolutionClient::deleteVolumeSnapshotAsync()} + * . + * + * @example samples/V2/BareMetalSolutionClient/delete_volume_snapshot.php + * + * @param DeleteVolumeSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteVolumeSnapshot(DeleteVolumeSnapshotRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteVolumeSnapshot', $request, $callOptions)->wait(); + } + + /** + * Detach LUN from Instance. + * + * The async variant is {@see BareMetalSolutionClient::detachLunAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/detach_lun.php + * + * @param DetachLunRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function detachLun(DetachLunRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DetachLun', $request, $callOptions)->wait(); + } + + /** + * Disable the interactive serial console feature on an instance. + * + * The async variant is + * {@see BareMetalSolutionClient::disableInteractiveSerialConsoleAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/disable_interactive_serial_console.php + * + * @param DisableInteractiveSerialConsoleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function disableInteractiveSerialConsole(DisableInteractiveSerialConsoleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DisableInteractiveSerialConsole', $request, $callOptions)->wait(); + } + + /** + * Enable the interactive serial console feature on an instance. + * + * The async variant is + * {@see BareMetalSolutionClient::enableInteractiveSerialConsoleAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/enable_interactive_serial_console.php + * + * @param EnableInteractiveSerialConsoleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function enableInteractiveSerialConsole(EnableInteractiveSerialConsoleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('EnableInteractiveSerialConsole', $request, $callOptions)->wait(); + } + + /** + * Skips lun's cooloff and deletes it now. + * Lun must be in cooloff state. + * + * The async variant is {@see BareMetalSolutionClient::evictLunAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/evict_lun.php + * + * @param EvictLunRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function evictLun(EvictLunRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('EvictLun', $request, $callOptions)->wait(); + } + + /** + * Skips volume's cooloff and deletes it now. + * Volume must be in cooloff state. + * + * The async variant is {@see BareMetalSolutionClient::evictVolumeAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/evict_volume.php + * + * @param EvictVolumeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function evictVolume(EvictVolumeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('EvictVolume', $request, $callOptions)->wait(); + } + + /** + * Get details about a single server. + * + * The async variant is {@see BareMetalSolutionClient::getInstanceAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/get_instance.php + * + * @param GetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Instance + * + * @throws ApiException Thrown if the API call fails. + */ + public function getInstance(GetInstanceRequest $request, array $callOptions = []): Instance + { + return $this->startApiCall('GetInstance', $request, $callOptions)->wait(); + } + + /** + * Get details of a single storage logical unit number(LUN). + * + * The async variant is {@see BareMetalSolutionClient::getLunAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/get_lun.php + * + * @param GetLunRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Lun + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLun(GetLunRequest $request, array $callOptions = []): Lun + { + return $this->startApiCall('GetLun', $request, $callOptions)->wait(); + } + + /** + * Get details of a single network. + * + * The async variant is {@see BareMetalSolutionClient::getNetworkAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/get_network.php + * + * @param GetNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Network + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNetwork(GetNetworkRequest $request, array $callOptions = []): Network + { + return $this->startApiCall('GetNetwork', $request, $callOptions)->wait(); + } + + /** + * Get details of a single NFS share. + * + * The async variant is {@see BareMetalSolutionClient::getNfsShareAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/get_nfs_share.php + * + * @param GetNfsShareRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NfsShare + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNfsShare(GetNfsShareRequest $request, array $callOptions = []): NfsShare + { + return $this->startApiCall('GetNfsShare', $request, $callOptions)->wait(); + } + + /** + * Get ProvisioningConfig by name. + * + * The async variant is + * {@see BareMetalSolutionClient::getProvisioningConfigAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/get_provisioning_config.php + * + * @param GetProvisioningConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ProvisioningConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getProvisioningConfig(GetProvisioningConfigRequest $request, array $callOptions = []): ProvisioningConfig + { + return $this->startApiCall('GetProvisioningConfig', $request, $callOptions)->wait(); + } + + /** + * Get details of a single storage volume. + * + * The async variant is {@see BareMetalSolutionClient::getVolumeAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/get_volume.php + * + * @param GetVolumeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Volume + * + * @throws ApiException Thrown if the API call fails. + */ + public function getVolume(GetVolumeRequest $request, array $callOptions = []): Volume + { + return $this->startApiCall('GetVolume', $request, $callOptions)->wait(); + } + + /** + * Returns the specified snapshot resource. + * Returns INVALID_ARGUMENT if called for a non-boot volume. + * + * The async variant is {@see BareMetalSolutionClient::getVolumeSnapshotAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/get_volume_snapshot.php + * + * @param GetVolumeSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return VolumeSnapshot + * + * @throws ApiException Thrown if the API call fails. + */ + public function getVolumeSnapshot(GetVolumeSnapshotRequest $request, array $callOptions = []): VolumeSnapshot + { + return $this->startApiCall('GetVolumeSnapshot', $request, $callOptions)->wait(); + } + + /** + * List servers in a given project and location. + * + * The async variant is {@see BareMetalSolutionClient::listInstancesAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/list_instances.php + * + * @param ListInstancesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listInstances(ListInstancesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListInstances', $request, $callOptions); + } + + /** + * List storage volume luns for given storage volume. + * + * The async variant is {@see BareMetalSolutionClient::listLunsAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/list_luns.php + * + * @param ListLunsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLuns(ListLunsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLuns', $request, $callOptions); + } + + /** + * List all Networks (and used IPs for each Network) in the vendor account + * associated with the specified project. + * + * The async variant is {@see BareMetalSolutionClient::listNetworkUsageAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/list_network_usage.php + * + * @param ListNetworkUsageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ListNetworkUsageResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNetworkUsage(ListNetworkUsageRequest $request, array $callOptions = []): ListNetworkUsageResponse + { + return $this->startApiCall('ListNetworkUsage', $request, $callOptions)->wait(); + } + + /** + * List network in a given project and location. + * + * The async variant is {@see BareMetalSolutionClient::listNetworksAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/list_networks.php + * + * @param ListNetworksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNetworks(ListNetworksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNetworks', $request, $callOptions); + } + + /** + * List NFS shares. + * + * The async variant is {@see BareMetalSolutionClient::listNfsSharesAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/list_nfs_shares.php + * + * @param ListNfsSharesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNfsShares(ListNfsSharesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNfsShares', $request, $callOptions); + } + + /** + * Retrieves the list of OS images which are currently approved. + * + * The async variant is {@see BareMetalSolutionClient::listOSImagesAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/list_os_images.php + * + * @param ListOSImagesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listOSImages(ListOSImagesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListOSImages', $request, $callOptions); + } + + /** + * List the budget details to provision resources on a given project. + * + * The async variant is + * {@see BareMetalSolutionClient::listProvisioningQuotasAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/list_provisioning_quotas.php + * + * @param ListProvisioningQuotasRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listProvisioningQuotas(ListProvisioningQuotasRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListProvisioningQuotas', $request, $callOptions); + } + + /** + * Lists the public SSH keys registered for the specified project. + * These SSH keys are used only for the interactive serial console feature. + * + * The async variant is {@see BareMetalSolutionClient::listSSHKeysAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/list_ssh_keys.php + * + * @param ListSSHKeysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSSHKeys(ListSSHKeysRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSSHKeys', $request, $callOptions); + } + + /** + * Retrieves the list of snapshots for the specified volume. + * Returns a response with an empty list of snapshots if called + * for a non-boot volume. + * + * The async variant is {@see BareMetalSolutionClient::listVolumeSnapshotsAsync()} + * . + * + * @example samples/V2/BareMetalSolutionClient/list_volume_snapshots.php + * + * @param ListVolumeSnapshotsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listVolumeSnapshots(ListVolumeSnapshotsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListVolumeSnapshots', $request, $callOptions); + } + + /** + * List storage volumes in a given project and location. + * + * The async variant is {@see BareMetalSolutionClient::listVolumesAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/list_volumes.php + * + * @param ListVolumesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listVolumes(ListVolumesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListVolumes', $request, $callOptions); + } + + /** + * RenameInstance sets a new name for an instance. + * Use with caution, previous names become immediately invalidated. + * + * The async variant is {@see BareMetalSolutionClient::renameInstanceAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/rename_instance.php + * + * @param RenameInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Instance + * + * @throws ApiException Thrown if the API call fails. + */ + public function renameInstance(RenameInstanceRequest $request, array $callOptions = []): Instance + { + return $this->startApiCall('RenameInstance', $request, $callOptions)->wait(); + } + + /** + * RenameNetwork sets a new name for a network. + * Use with caution, previous names become immediately invalidated. + * + * The async variant is {@see BareMetalSolutionClient::renameNetworkAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/rename_network.php + * + * @param RenameNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Network + * + * @throws ApiException Thrown if the API call fails. + */ + public function renameNetwork(RenameNetworkRequest $request, array $callOptions = []): Network + { + return $this->startApiCall('RenameNetwork', $request, $callOptions)->wait(); + } + + /** + * RenameNfsShare sets a new name for an nfsshare. + * Use with caution, previous names become immediately invalidated. + * + * The async variant is {@see BareMetalSolutionClient::renameNfsShareAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/rename_nfs_share.php + * + * @param RenameNfsShareRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NfsShare + * + * @throws ApiException Thrown if the API call fails. + */ + public function renameNfsShare(RenameNfsShareRequest $request, array $callOptions = []): NfsShare + { + return $this->startApiCall('RenameNfsShare', $request, $callOptions)->wait(); + } + + /** + * RenameVolume sets a new name for a volume. + * Use with caution, previous names become immediately invalidated. + * + * The async variant is {@see BareMetalSolutionClient::renameVolumeAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/rename_volume.php + * + * @param RenameVolumeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Volume + * + * @throws ApiException Thrown if the API call fails. + */ + public function renameVolume(RenameVolumeRequest $request, array $callOptions = []): Volume + { + return $this->startApiCall('RenameVolume', $request, $callOptions)->wait(); + } + + /** + * Perform an ungraceful, hard reset on a server. Equivalent to shutting the + * power off and then turning it back on. + * + * The async variant is {@see BareMetalSolutionClient::resetInstanceAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/reset_instance.php + * + * @param ResetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resetInstance(ResetInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ResetInstance', $request, $callOptions)->wait(); + } + + /** + * Emergency Volume resize. + * + * The async variant is {@see BareMetalSolutionClient::resizeVolumeAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/resize_volume.php + * + * @param ResizeVolumeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resizeVolume(ResizeVolumeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ResizeVolume', $request, $callOptions)->wait(); + } + + /** + * Uses the specified snapshot to restore its parent volume. + * Returns INVALID_ARGUMENT if called for a non-boot volume. + * + * The async variant is + * {@see BareMetalSolutionClient::restoreVolumeSnapshotAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/restore_volume_snapshot.php + * + * @param RestoreVolumeSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function restoreVolumeSnapshot(RestoreVolumeSnapshotRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RestoreVolumeSnapshot', $request, $callOptions)->wait(); + } + + /** + * Starts a server that was shutdown. + * + * The async variant is {@see BareMetalSolutionClient::startInstanceAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/start_instance.php + * + * @param StartInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function startInstance(StartInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StartInstance', $request, $callOptions)->wait(); + } + + /** + * Stop a running server. + * + * The async variant is {@see BareMetalSolutionClient::stopInstanceAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/stop_instance.php + * + * @param StopInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function stopInstance(StopInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StopInstance', $request, $callOptions)->wait(); + } + + /** + * Submit a provisiong configuration for a given project. + * + * The async variant is + * {@see BareMetalSolutionClient::submitProvisioningConfigAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/submit_provisioning_config.php + * + * @param SubmitProvisioningConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SubmitProvisioningConfigResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function submitProvisioningConfig(SubmitProvisioningConfigRequest $request, array $callOptions = []): SubmitProvisioningConfigResponse + { + return $this->startApiCall('SubmitProvisioningConfig', $request, $callOptions)->wait(); + } + + /** + * Update details of a single server. + * + * The async variant is {@see BareMetalSolutionClient::updateInstanceAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/update_instance.php + * + * @param UpdateInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateInstance(UpdateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); + } + + /** + * Update details of a single network. + * + * The async variant is {@see BareMetalSolutionClient::updateNetworkAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/update_network.php + * + * @param UpdateNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateNetwork(UpdateNetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateNetwork', $request, $callOptions)->wait(); + } + + /** + * Update details of a single NFS share. + * + * The async variant is {@see BareMetalSolutionClient::updateNfsShareAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/update_nfs_share.php + * + * @param UpdateNfsShareRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateNfsShare(UpdateNfsShareRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateNfsShare', $request, $callOptions)->wait(); + } + + /** + * Update existing ProvisioningConfig. + * + * The async variant is + * {@see BareMetalSolutionClient::updateProvisioningConfigAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/update_provisioning_config.php + * + * @param UpdateProvisioningConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ProvisioningConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateProvisioningConfig(UpdateProvisioningConfigRequest $request, array $callOptions = []): ProvisioningConfig + { + return $this->startApiCall('UpdateProvisioningConfig', $request, $callOptions)->wait(); + } + + /** + * Update details of a single storage volume. + * + * The async variant is {@see BareMetalSolutionClient::updateVolumeAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/update_volume.php + * + * @param UpdateVolumeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateVolume(UpdateVolumeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateVolume', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see BareMetalSolutionClient::getLocationAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see BareMetalSolutionClient::listLocationsAsync()} . + * + * @example samples/V2/BareMetalSolutionClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/BareMetalSolution/v2/src/V2/gapic_metadata.json b/owl-bot-staging/BareMetalSolution/v2/src/V2/gapic_metadata.json new file mode 100644 index 000000000000..330d34ae54a4 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/src/V2/gapic_metadata.json @@ -0,0 +1,248 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.baremetalsolution.v2", + "libraryPackage": "Google\\Cloud\\BareMetalSolution\\V2", + "services": { + "BareMetalSolution": { + "clients": { + "grpc": { + "libraryClient": "BareMetalSolutionGapicClient", + "rpcs": { + "CreateNfsShare": { + "methods": [ + "createNfsShare" + ] + }, + "CreateProvisioningConfig": { + "methods": [ + "createProvisioningConfig" + ] + }, + "CreateSSHKey": { + "methods": [ + "createSSHKey" + ] + }, + "CreateVolumeSnapshot": { + "methods": [ + "createVolumeSnapshot" + ] + }, + "DeleteNfsShare": { + "methods": [ + "deleteNfsShare" + ] + }, + "DeleteSSHKey": { + "methods": [ + "deleteSSHKey" + ] + }, + "DeleteVolumeSnapshot": { + "methods": [ + "deleteVolumeSnapshot" + ] + }, + "DetachLun": { + "methods": [ + "detachLun" + ] + }, + "DisableInteractiveSerialConsole": { + "methods": [ + "disableInteractiveSerialConsole" + ] + }, + "EnableInteractiveSerialConsole": { + "methods": [ + "enableInteractiveSerialConsole" + ] + }, + "EvictLun": { + "methods": [ + "evictLun" + ] + }, + "EvictVolume": { + "methods": [ + "evictVolume" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "GetLun": { + "methods": [ + "getLun" + ] + }, + "GetNetwork": { + "methods": [ + "getNetwork" + ] + }, + "GetNfsShare": { + "methods": [ + "getNfsShare" + ] + }, + "GetProvisioningConfig": { + "methods": [ + "getProvisioningConfig" + ] + }, + "GetVolume": { + "methods": [ + "getVolume" + ] + }, + "GetVolumeSnapshot": { + "methods": [ + "getVolumeSnapshot" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "ListLuns": { + "methods": [ + "listLuns" + ] + }, + "ListNetworkUsage": { + "methods": [ + "listNetworkUsage" + ] + }, + "ListNetworks": { + "methods": [ + "listNetworks" + ] + }, + "ListNfsShares": { + "methods": [ + "listNfsShares" + ] + }, + "ListOSImages": { + "methods": [ + "listOSImages" + ] + }, + "ListProvisioningQuotas": { + "methods": [ + "listProvisioningQuotas" + ] + }, + "ListSSHKeys": { + "methods": [ + "listSSHKeys" + ] + }, + "ListVolumeSnapshots": { + "methods": [ + "listVolumeSnapshots" + ] + }, + "ListVolumes": { + "methods": [ + "listVolumes" + ] + }, + "RenameInstance": { + "methods": [ + "renameInstance" + ] + }, + "RenameNetwork": { + "methods": [ + "renameNetwork" + ] + }, + "RenameNfsShare": { + "methods": [ + "renameNfsShare" + ] + }, + "RenameVolume": { + "methods": [ + "renameVolume" + ] + }, + "ResetInstance": { + "methods": [ + "resetInstance" + ] + }, + "ResizeVolume": { + "methods": [ + "resizeVolume" + ] + }, + "RestoreVolumeSnapshot": { + "methods": [ + "restoreVolumeSnapshot" + ] + }, + "StartInstance": { + "methods": [ + "startInstance" + ] + }, + "StopInstance": { + "methods": [ + "stopInstance" + ] + }, + "SubmitProvisioningConfig": { + "methods": [ + "submitProvisioningConfig" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateNetwork": { + "methods": [ + "updateNetwork" + ] + }, + "UpdateNfsShare": { + "methods": [ + "updateNfsShare" + ] + }, + "UpdateProvisioningConfig": { + "methods": [ + "updateProvisioningConfig" + ] + }, + "UpdateVolume": { + "methods": [ + "updateVolume" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BareMetalSolution/v2/src/V2/resources/bare_metal_solution_client_config.json b/owl-bot-staging/BareMetalSolution/v2/src/V2/resources/bare_metal_solution_client_config.json new file mode 100644 index 000000000000..65c1fe7f2687 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/src/V2/resources/bare_metal_solution_client_config.json @@ -0,0 +1,262 @@ +{ + "interfaces": { + "google.cloud.baremetalsolution.v2.BareMetalSolution": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateNfsShare": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateProvisioningConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSSHKey": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateVolumeSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteNfsShare": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteSSHKey": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteVolumeSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DetachLun": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DisableInteractiveSerialConsole": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "EnableInteractiveSerialConsole": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "EvictLun": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "EvictVolume": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLun": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetNetwork": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetNfsShare": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetProvisioningConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetVolume": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetVolumeSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListLuns": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListNetworkUsage": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListNetworks": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListNfsShares": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListOSImages": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListProvisioningQuotas": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListSSHKeys": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListVolumeSnapshots": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListVolumes": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RenameInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RenameNetwork": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RenameNfsShare": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RenameVolume": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ResetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ResizeVolume": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RestoreVolumeSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StartInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StopInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SubmitProvisioningConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateNetwork": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateNfsShare": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateProvisioningConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateVolume": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/BareMetalSolution/v2/src/V2/resources/bare_metal_solution_descriptor_config.php b/owl-bot-staging/BareMetalSolution/v2/src/V2/resources/bare_metal_solution_descriptor_config.php new file mode 100644 index 000000000000..343411549094 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/src/V2/resources/bare_metal_solution_descriptor_config.php @@ -0,0 +1,795 @@ + [ + 'google.cloud.baremetalsolution.v2.BareMetalSolution' => [ + 'CreateNfsShare' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\NfsShare', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteNfsShare' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DetachLun' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\Instance', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'DisableInteractiveSerialConsole' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\DisableInteractiveSerialConsoleResponse', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'EnableInteractiveSerialConsole' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\EnableInteractiveSerialConsoleResponse', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'EvictLun' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'EvictVolume' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ResetInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\ResetInstanceResponse', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ResizeVolume' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\Volume', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'volume', + 'fieldAccessors' => [ + 'getVolume', + ], + ], + ], + ], + 'RestoreVolumeSnapshot' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\VolumeSnapshot', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'volume_snapshot', + 'fieldAccessors' => [ + 'getVolumeSnapshot', + ], + ], + ], + ], + 'StartInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\StartInstanceResponse', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'StopInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\StopInstanceResponse', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\Instance', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'instance.name', + 'fieldAccessors' => [ + 'getInstance', + 'getName', + ], + ], + ], + ], + 'UpdateNetwork' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\Network', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'network.name', + 'fieldAccessors' => [ + 'getNetwork', + 'getName', + ], + ], + ], + ], + 'UpdateNfsShare' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\NfsShare', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'nfs_share.name', + 'fieldAccessors' => [ + 'getNfsShare', + 'getName', + ], + ], + ], + ], + 'UpdateVolume' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BareMetalSolution\V2\Volume', + 'metadataReturnType' => '\Google\Cloud\BareMetalSolution\V2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'volume.name', + 'fieldAccessors' => [ + 'getVolume', + 'getName', + ], + ], + ], + ], + 'CreateProvisioningConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ProvisioningConfig', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSSHKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\SSHKey', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateVolumeSnapshot' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\VolumeSnapshot', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSSHKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteVolumeSnapshot' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetInstance' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\Instance', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetLun' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\Lun', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetNetwork' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\Network', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetNfsShare' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\NfsShare', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetProvisioningConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ProvisioningConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetVolume' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\Volume', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetVolumeSnapshot' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\VolumeSnapshot', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getInstances', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ListInstancesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListLuns' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLuns', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ListLunsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListNetworkUsage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ListNetworkUsageResponse', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getLocation', + ], + ], + ], + ], + 'ListNetworks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getNetworks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ListNetworksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListNfsShares' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getNfsShares', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ListNfsSharesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListOSImages' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getOsImages', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ListOSImagesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListProvisioningQuotas' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProvisioningQuotas', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ListProvisioningQuotasResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListSSHKeys' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSshKeys', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ListSSHKeysResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListVolumeSnapshots' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getVolumeSnapshots', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ListVolumeSnapshotsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListVolumes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getVolumes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ListVolumesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RenameInstance' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\Instance', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RenameNetwork' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\Network', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RenameNfsShare' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\NfsShare', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RenameVolume' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\Volume', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SubmitProvisioningConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\SubmitProvisioningConfigResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateProvisioningConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BareMetalSolution\V2\ProvisioningConfig', + 'headerParams' => [ + [ + 'keyName' => 'provisioning_config.name', + 'fieldAccessors' => [ + 'getProvisioningConfig', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'instance' => 'projects/{project}/locations/{location}/instances/{instance}', + 'instanceConfig' => 'projects/{project}/locations/{location}/instanceConfigs/{instance_config}', + 'interconnectAttachment' => 'projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}', + 'location' => 'projects/{project}/locations/{location}', + 'lun' => 'projects/{project}/locations/{location}/volumes/{volume}/luns/{lun}', + 'nFSShare' => 'projects/{project}/locations/{location}/nfsShares/{nfs_share}', + 'network' => 'projects/{project}/locations/{location}/networks/{network}', + 'networkConfig' => 'projects/{project}/locations/{location}/networkConfigs/{network_config}', + 'provisioningConfig' => 'projects/{project}/locations/{location}/provisioningConfigs/{provisioning_config}', + 'serverNetworkTemplate' => 'projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}', + 'sshKey' => 'projects/{project}/locations/{location}/sshKeys/{ssh_key}', + 'volume' => 'projects/{project}/locations/{location}/volumes/{volume}', + 'volumeConfig' => 'projects/{project}/locations/{location}/volumeConfigs/{volume_config}', + 'volumeSnapshot' => 'projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BareMetalSolution/v2/src/V2/resources/bare_metal_solution_rest_client_config.php b/owl-bot-staging/BareMetalSolution/v2/src/V2/resources/bare_metal_solution_rest_client_config.php new file mode 100644 index 000000000000..38b7716b99b6 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/src/V2/resources/bare_metal_solution_rest_client_config.php @@ -0,0 +1,572 @@ + [ + 'google.cloud.baremetalsolution.v2.BareMetalSolution' => [ + 'CreateNfsShare' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/nfsShares', + 'body' => 'nfs_share', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateProvisioningConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/provisioningConfigs', + 'body' => 'provisioning_config', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSSHKey' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/sshKeys', + 'body' => 'ssh_key', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'ssh_key_id', + ], + ], + 'CreateVolumeSnapshot' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/volumes/*}/snapshots', + 'body' => 'volume_snapshot', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteNfsShare' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/nfsShares/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSSHKey' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/sshKeys/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteVolumeSnapshot' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/volumes/*/snapshots/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DetachLun' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{instance=projects/*/locations/*/instances/*}:detachLun', + 'body' => '*', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + ], + ], + 'DisableInteractiveSerialConsole' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/instances/*}:disableInteractiveSerialConsole', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'EnableInteractiveSerialConsole' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/instances/*}:enableInteractiveSerialConsole', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'EvictLun' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/volumes/*/luns/*}:evict', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'EvictVolume' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/volumes/*}:evict', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetInstance' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetLun' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/volumes/*/luns/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetNetwork' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/networks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetNfsShare' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/nfsShares/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetProvisioningConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/provisioningConfigs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetVolume' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/volumes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetVolumeSnapshot' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/volumes/*/snapshots/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListInstances' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/instances', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListLuns' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/volumes/*}/luns', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListNetworkUsage' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{location=projects/*/locations/*}/networks:listNetworkUsage', + 'placeholders' => [ + 'location' => [ + 'getters' => [ + 'getLocation', + ], + ], + ], + ], + 'ListNetworks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/networks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListNfsShares' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/nfsShares', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListOSImages' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/osImages', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListProvisioningQuotas' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/provisioningQuotas', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSSHKeys' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/sshKeys', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListVolumeSnapshots' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/volumes/*}/snapshots', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListVolumes' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/volumes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RenameInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/instances/*}:rename', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RenameNetwork' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/networks/*}:rename', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RenameNfsShare' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/nfsShares/*}:rename', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RenameVolume' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/volumes/*}:rename', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ResetInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/instances/*}:reset', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ResizeVolume' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{volume=projects/*/locations/*/volumes/*}:resize', + 'body' => '*', + 'placeholders' => [ + 'volume' => [ + 'getters' => [ + 'getVolume', + ], + ], + ], + ], + 'RestoreVolumeSnapshot' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{volume_snapshot=projects/*/locations/*/volumes/*/snapshots/*}:restoreVolumeSnapshot', + 'body' => '*', + 'placeholders' => [ + 'volume_snapshot' => [ + 'getters' => [ + 'getVolumeSnapshot', + ], + ], + ], + ], + 'StartInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/instances/*}:start', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'StopInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/instances/*}:stop', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SubmitProvisioningConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/provisioningConfigs:submit', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{instance.name=projects/*/locations/*/instances/*}', + 'body' => 'instance', + 'placeholders' => [ + 'instance.name' => [ + 'getters' => [ + 'getInstance', + 'getName', + ], + ], + ], + ], + 'UpdateNetwork' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{network.name=projects/*/locations/*/networks/*}', + 'body' => 'network', + 'placeholders' => [ + 'network.name' => [ + 'getters' => [ + 'getNetwork', + 'getName', + ], + ], + ], + ], + 'UpdateNfsShare' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{nfs_share.name=projects/*/locations/*/nfsShares/*}', + 'body' => 'nfs_share', + 'placeholders' => [ + 'nfs_share.name' => [ + 'getters' => [ + 'getNfsShare', + 'getName', + ], + ], + ], + ], + 'UpdateProvisioningConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{provisioning_config.name=projects/*/locations/*/provisioningConfigs/*}', + 'body' => 'provisioning_config', + 'placeholders' => [ + 'provisioning_config.name' => [ + 'getters' => [ + 'getProvisioningConfig', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateVolume' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{volume.name=projects/*/locations/*/volumes/*}', + 'body' => 'volume', + 'placeholders' => [ + 'volume.name' => [ + 'getters' => [ + 'getVolume', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/BareMetalSolution/v2/tests/Unit/V2/Client/BareMetalSolutionClientTest.php b/owl-bot-staging/BareMetalSolution/v2/tests/Unit/V2/Client/BareMetalSolutionClientTest.php new file mode 100644 index 000000000000..a662316a7970 --- /dev/null +++ b/owl-bot-staging/BareMetalSolution/v2/tests/Unit/V2/Client/BareMetalSolutionClientTest.php @@ -0,0 +1,4556 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BareMetalSolutionClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BareMetalSolutionClient($options); + } + + /** @test */ + public function createNfsShareTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createNfsShareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $nfsShareId = 'nfsShareId931294079'; + $id = 'id3355'; + $volume = 'volume-810883302'; + $requestedSizeGib = 525454387; + $expectedResponse = new NfsShare(); + $expectedResponse->setName($name); + $expectedResponse->setNfsShareId($nfsShareId); + $expectedResponse->setId($id); + $expectedResponse->setVolume($volume); + $expectedResponse->setRequestedSizeGib($requestedSizeGib); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createNfsShareTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $nfsShare = new NfsShare(); + $request = (new CreateNfsShareRequest()) + ->setParent($formattedParent) + ->setNfsShare($nfsShare); + $response = $gapicClient->createNfsShare($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/CreateNfsShare', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getNfsShare(); + $this->assertProtobufEquals($nfsShare, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createNfsShareTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createNfsShareExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createNfsShareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $nfsShare = new NfsShare(); + $request = (new CreateNfsShareRequest()) + ->setParent($formattedParent) + ->setNfsShare($nfsShare); + $response = $gapicClient->createNfsShare($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createNfsShareTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createProvisioningConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $ticketId = 'ticketId-71132370'; + $handoverServiceAccount = 'handoverServiceAccount747638823'; + $email2 = 'email2-1638014897'; + $location = 'location1901043637'; + $cloudConsoleUri = 'cloudConsoleUri529066874'; + $vpcScEnabled = true; + $statusMessage = 'statusMessage-239442758'; + $customId = 'customId1611556009'; + $expectedResponse = new ProvisioningConfig(); + $expectedResponse->setName($name); + $expectedResponse->setTicketId($ticketId); + $expectedResponse->setHandoverServiceAccount($handoverServiceAccount); + $expectedResponse->setEmail($email2); + $expectedResponse->setLocation($location); + $expectedResponse->setCloudConsoleUri($cloudConsoleUri); + $expectedResponse->setVpcScEnabled($vpcScEnabled); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setCustomId($customId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $provisioningConfig = new ProvisioningConfig(); + $request = (new CreateProvisioningConfigRequest()) + ->setParent($formattedParent) + ->setProvisioningConfig($provisioningConfig); + $response = $gapicClient->createProvisioningConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/CreateProvisioningConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getProvisioningConfig(); + $this->assertProtobufEquals($provisioningConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createProvisioningConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $provisioningConfig = new ProvisioningConfig(); + $request = (new CreateProvisioningConfigRequest()) + ->setParent($formattedParent) + ->setProvisioningConfig($provisioningConfig); + try { + $gapicClient->createProvisioningConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSSHKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $publicKey = 'publicKey1904812937'; + $expectedResponse = new SSHKey(); + $expectedResponse->setName($name); + $expectedResponse->setPublicKey($publicKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $sshKey = new SSHKey(); + $sshKeyId = 'sshKeyId-385603310'; + $request = (new CreateSSHKeyRequest()) + ->setParent($formattedParent) + ->setSshKey($sshKey) + ->setSshKeyId($sshKeyId); + $response = $gapicClient->createSSHKey($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/CreateSSHKey', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSshKey(); + $this->assertProtobufEquals($sshKey, $actualValue); + $actualValue = $actualRequestObject->getSshKeyId(); + $this->assertProtobufEquals($sshKeyId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSSHKeyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $sshKey = new SSHKey(); + $sshKeyId = 'sshKeyId-385603310'; + $request = (new CreateSSHKeyRequest()) + ->setParent($formattedParent) + ->setSshKey($sshKey) + ->setSshKeyId($sshKeyId); + try { + $gapicClient->createSSHKey($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createVolumeSnapshotTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $id = 'id3355'; + $description = 'description-1724546052'; + $storageVolume = 'storageVolume-768806562'; + $expectedResponse = new VolumeSnapshot(); + $expectedResponse->setName($name); + $expectedResponse->setId($id); + $expectedResponse->setDescription($description); + $expectedResponse->setStorageVolume($storageVolume); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $volumeSnapshot = new VolumeSnapshot(); + $request = (new CreateVolumeSnapshotRequest()) + ->setParent($formattedParent) + ->setVolumeSnapshot($volumeSnapshot); + $response = $gapicClient->createVolumeSnapshot($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/CreateVolumeSnapshot', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getVolumeSnapshot(); + $this->assertProtobufEquals($volumeSnapshot, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createVolumeSnapshotExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $volumeSnapshot = new VolumeSnapshot(); + $request = (new CreateVolumeSnapshotRequest()) + ->setParent($formattedParent) + ->setVolumeSnapshot($volumeSnapshot); + try { + $gapicClient->createVolumeSnapshot($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteNfsShareTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteNfsShareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteNfsShareTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->nFSShareName('[PROJECT]', '[LOCATION]', '[NFS_SHARE]'); + $request = (new DeleteNfsShareRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteNfsShare($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/DeleteNfsShare', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteNfsShareTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteNfsShareExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteNfsShareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->nFSShareName('[PROJECT]', '[LOCATION]', '[NFS_SHARE]'); + $request = (new DeleteNfsShareRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteNfsShare($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteNfsShareTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteSSHKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->sshKeyName('[PROJECT]', '[LOCATION]', '[SSH_KEY]'); + $request = (new DeleteSSHKeyRequest()) + ->setName($formattedName); + $gapicClient->deleteSSHKey($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/DeleteSSHKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSSHKeyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->sshKeyName('[PROJECT]', '[LOCATION]', '[SSH_KEY]'); + $request = (new DeleteSSHKeyRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteSSHKey($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteVolumeSnapshotTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->volumeSnapshotName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[SNAPSHOT]'); + $request = (new DeleteVolumeSnapshotRequest()) + ->setName($formattedName); + $gapicClient->deleteVolumeSnapshot($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/DeleteVolumeSnapshot', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteVolumeSnapshotExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->volumeSnapshotName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[SNAPSHOT]'); + $request = (new DeleteVolumeSnapshotRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteVolumeSnapshot($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function detachLunTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/detachLunTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $id = 'id3355'; + $machineType = 'machineType1838323762'; + $hyperthreadingEnabled = true; + $interactiveSerialConsoleEnabled = false; + $osImage = 'osImage1982209856'; + $pod = 'pod111173'; + $networkTemplate = 'networkTemplate215365483'; + $loginInfo = 'loginInfo-1747949628'; + $firmwareVersion = 'firmwareVersion-987819436'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setId($id); + $expectedResponse->setMachineType($machineType); + $expectedResponse->setHyperthreadingEnabled($hyperthreadingEnabled); + $expectedResponse->setInteractiveSerialConsoleEnabled($interactiveSerialConsoleEnabled); + $expectedResponse->setOsImage($osImage); + $expectedResponse->setPod($pod); + $expectedResponse->setNetworkTemplate($networkTemplate); + $expectedResponse->setLoginInfo($loginInfo); + $expectedResponse->setFirmwareVersion($firmwareVersion); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/detachLunTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedInstance = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $formattedLun = $gapicClient->lunName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[LUN]'); + $request = (new DetachLunRequest()) + ->setInstance($formattedInstance) + ->setLun($formattedLun); + $response = $gapicClient->detachLun($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/DetachLun', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($formattedInstance, $actualValue); + $actualValue = $actualApiRequestObject->getLun(); + $this->assertProtobufEquals($formattedLun, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/detachLunTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function detachLunExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/detachLunTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedInstance = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $formattedLun = $gapicClient->lunName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[LUN]'); + $request = (new DetachLunRequest()) + ->setInstance($formattedInstance) + ->setLun($formattedLun); + $response = $gapicClient->detachLun($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/detachLunTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function disableInteractiveSerialConsoleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/disableInteractiveSerialConsoleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new DisableInteractiveSerialConsoleResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/disableInteractiveSerialConsoleTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new DisableInteractiveSerialConsoleRequest()) + ->setName($formattedName); + $response = $gapicClient->disableInteractiveSerialConsole($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/DisableInteractiveSerialConsole', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/disableInteractiveSerialConsoleTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function disableInteractiveSerialConsoleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/disableInteractiveSerialConsoleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new DisableInteractiveSerialConsoleRequest()) + ->setName($formattedName); + $response = $gapicClient->disableInteractiveSerialConsole($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/disableInteractiveSerialConsoleTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function enableInteractiveSerialConsoleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/enableInteractiveSerialConsoleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new EnableInteractiveSerialConsoleResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/enableInteractiveSerialConsoleTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new EnableInteractiveSerialConsoleRequest()) + ->setName($formattedName); + $response = $gapicClient->enableInteractiveSerialConsole($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/EnableInteractiveSerialConsole', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/enableInteractiveSerialConsoleTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function enableInteractiveSerialConsoleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/enableInteractiveSerialConsoleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new EnableInteractiveSerialConsoleRequest()) + ->setName($formattedName); + $response = $gapicClient->enableInteractiveSerialConsole($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/enableInteractiveSerialConsoleTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function evictLunTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/evictLunTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/evictLunTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->lunName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[LUN]'); + $request = (new EvictLunRequest()) + ->setName($formattedName); + $response = $gapicClient->evictLun($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/EvictLun', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/evictLunTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function evictLunExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/evictLunTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lunName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[LUN]'); + $request = (new EvictLunRequest()) + ->setName($formattedName); + $response = $gapicClient->evictLun($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/evictLunTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function evictVolumeTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/evictVolumeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/evictVolumeTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $request = (new EvictVolumeRequest()) + ->setName($formattedName); + $response = $gapicClient->evictVolume($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/EvictVolume', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/evictVolumeTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function evictVolumeExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/evictVolumeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $request = (new EvictVolumeRequest()) + ->setName($formattedName); + $response = $gapicClient->evictVolume($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/evictVolumeTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $id = 'id3355'; + $machineType = 'machineType1838323762'; + $hyperthreadingEnabled = true; + $interactiveSerialConsoleEnabled = false; + $osImage = 'osImage1982209856'; + $pod = 'pod111173'; + $networkTemplate = 'networkTemplate215365483'; + $loginInfo = 'loginInfo-1747949628'; + $firmwareVersion = 'firmwareVersion-987819436'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setId($id); + $expectedResponse->setMachineType($machineType); + $expectedResponse->setHyperthreadingEnabled($hyperthreadingEnabled); + $expectedResponse->setInteractiveSerialConsoleEnabled($interactiveSerialConsoleEnabled); + $expectedResponse->setOsImage($osImage); + $expectedResponse->setPod($pod); + $expectedResponse->setNetworkTemplate($networkTemplate); + $expectedResponse->setLoginInfo($loginInfo); + $expectedResponse->setFirmwareVersion($firmwareVersion); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->getInstance($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/GetInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + try { + $gapicClient->getInstance($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $id = 'id3355'; + $sizeGb = 2105542105; + $storageVolume = 'storageVolume-768806562'; + $shareable = false; + $bootLun = true; + $wwid = 'wwid3662843'; + $expectedResponse = new Lun(); + $expectedResponse->setName($name2); + $expectedResponse->setId($id); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setStorageVolume($storageVolume); + $expectedResponse->setShareable($shareable); + $expectedResponse->setBootLun($bootLun); + $expectedResponse->setWwid($wwid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->lunName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[LUN]'); + $request = (new GetLunRequest()) + ->setName($formattedName); + $response = $gapicClient->getLun($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/GetLun', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLunExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lunName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[LUN]'); + $request = (new GetLunRequest()) + ->setName($formattedName); + try { + $gapicClient->getLun($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNetworkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $id = 'id3355'; + $ipAddress = 'ipAddress1480014044'; + $vlanId = 'vlanId536153463'; + $cidr = 'cidr3053428'; + $servicesCidr = 'servicesCidr-1169831243'; + $pod = 'pod111173'; + $jumboFramesEnabled = true; + $gatewayIp = 'gatewayIp955798786'; + $expectedResponse = new Network(); + $expectedResponse->setName($name2); + $expectedResponse->setId($id); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setVlanId($vlanId); + $expectedResponse->setCidr($cidr); + $expectedResponse->setServicesCidr($servicesCidr); + $expectedResponse->setPod($pod); + $expectedResponse->setJumboFramesEnabled($jumboFramesEnabled); + $expectedResponse->setGatewayIp($gatewayIp); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[NETWORK]'); + $request = (new GetNetworkRequest()) + ->setName($formattedName); + $response = $gapicClient->getNetwork($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/GetNetwork', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNetworkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[NETWORK]'); + $request = (new GetNetworkRequest()) + ->setName($formattedName); + try { + $gapicClient->getNetwork($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNfsShareTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $nfsShareId = 'nfsShareId931294079'; + $id = 'id3355'; + $volume = 'volume-810883302'; + $requestedSizeGib = 525454387; + $expectedResponse = new NfsShare(); + $expectedResponse->setName($name2); + $expectedResponse->setNfsShareId($nfsShareId); + $expectedResponse->setId($id); + $expectedResponse->setVolume($volume); + $expectedResponse->setRequestedSizeGib($requestedSizeGib); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->nFSShareName('[PROJECT]', '[LOCATION]', '[NFS_SHARE]'); + $request = (new GetNfsShareRequest()) + ->setName($formattedName); + $response = $gapicClient->getNfsShare($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/GetNfsShare', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNfsShareExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->nFSShareName('[PROJECT]', '[LOCATION]', '[NFS_SHARE]'); + $request = (new GetNfsShareRequest()) + ->setName($formattedName); + try { + $gapicClient->getNfsShare($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProvisioningConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $ticketId = 'ticketId-71132370'; + $handoverServiceAccount = 'handoverServiceAccount747638823'; + $email = 'email96619420'; + $location = 'location1901043637'; + $cloudConsoleUri = 'cloudConsoleUri529066874'; + $vpcScEnabled = true; + $statusMessage = 'statusMessage-239442758'; + $customId = 'customId1611556009'; + $expectedResponse = new ProvisioningConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setTicketId($ticketId); + $expectedResponse->setHandoverServiceAccount($handoverServiceAccount); + $expectedResponse->setEmail($email); + $expectedResponse->setLocation($location); + $expectedResponse->setCloudConsoleUri($cloudConsoleUri); + $expectedResponse->setVpcScEnabled($vpcScEnabled); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setCustomId($customId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->provisioningConfigName('[PROJECT]', '[LOCATION]', '[PROVISIONING_CONFIG]'); + $request = (new GetProvisioningConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getProvisioningConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/GetProvisioningConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProvisioningConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->provisioningConfigName('[PROJECT]', '[LOCATION]', '[PROVISIONING_CONFIG]'); + $request = (new GetProvisioningConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->getProvisioningConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getVolumeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $id = 'id3355'; + $requestedSizeGib = 525454387; + $originallyRequestedSizeGib = 44854004; + $currentSizeGib = 72696456; + $emergencySizeGib = 1936971120; + $maxSizeGib = 1805521661; + $autoGrownSizeGib = 1245638678; + $remainingSpaceGib = 1423108606; + $snapshotEnabled = true; + $pod = 'pod111173'; + $bootVolume = false; + $notes = 'notes105008833'; + $attached = true; + $expectedResponse = new Volume(); + $expectedResponse->setName($name2); + $expectedResponse->setId($id); + $expectedResponse->setRequestedSizeGib($requestedSizeGib); + $expectedResponse->setOriginallyRequestedSizeGib($originallyRequestedSizeGib); + $expectedResponse->setCurrentSizeGib($currentSizeGib); + $expectedResponse->setEmergencySizeGib($emergencySizeGib); + $expectedResponse->setMaxSizeGib($maxSizeGib); + $expectedResponse->setAutoGrownSizeGib($autoGrownSizeGib); + $expectedResponse->setRemainingSpaceGib($remainingSpaceGib); + $expectedResponse->setSnapshotEnabled($snapshotEnabled); + $expectedResponse->setPod($pod); + $expectedResponse->setBootVolume($bootVolume); + $expectedResponse->setNotes($notes); + $expectedResponse->setAttached($attached); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $request = (new GetVolumeRequest()) + ->setName($formattedName); + $response = $gapicClient->getVolume($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/GetVolume', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getVolumeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $request = (new GetVolumeRequest()) + ->setName($formattedName); + try { + $gapicClient->getVolume($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getVolumeSnapshotTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $id = 'id3355'; + $description = 'description-1724546052'; + $storageVolume = 'storageVolume-768806562'; + $expectedResponse = new VolumeSnapshot(); + $expectedResponse->setName($name2); + $expectedResponse->setId($id); + $expectedResponse->setDescription($description); + $expectedResponse->setStorageVolume($storageVolume); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->volumeSnapshotName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[SNAPSHOT]'); + $request = (new GetVolumeSnapshotRequest()) + ->setName($formattedName); + $response = $gapicClient->getVolumeSnapshot($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/GetVolumeSnapshot', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getVolumeSnapshotExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->volumeSnapshotName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[SNAPSHOT]'); + $request = (new GetVolumeSnapshotRequest()) + ->setName($formattedName); + try { + $gapicClient->getVolumeSnapshot($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $instancesElement = new Instance(); + $instances = [ + $instancesElement, + ]; + $expectedResponse = new ListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInstances($instances); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listInstances($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listInstances($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLunsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $lunsElement = new Lun(); + $luns = [ + $lunsElement, + ]; + $expectedResponse = new ListLunsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLuns($luns); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $request = (new ListLunsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listLuns($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLuns()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ListLuns', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLunsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $request = (new ListLunsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listLuns($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworkUsageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListNetworkUsageResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedLocation = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListNetworkUsageRequest()) + ->setLocation($formattedLocation); + $response = $gapicClient->listNetworkUsage($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ListNetworkUsage', $actualFuncCall); + $actualValue = $actualRequestObject->getLocation(); + $this->assertProtobufEquals($formattedLocation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworkUsageExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedLocation = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListNetworkUsageRequest()) + ->setLocation($formattedLocation); + try { + $gapicClient->listNetworkUsage($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $networksElement = new Network(); + $networks = [ + $networksElement, + ]; + $expectedResponse = new ListNetworksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setNetworks($networks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListNetworksRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listNetworks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getNetworks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ListNetworks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListNetworksRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listNetworks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNfsSharesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $nfsSharesElement = new NfsShare(); + $nfsShares = [ + $nfsSharesElement, + ]; + $expectedResponse = new ListNfsSharesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setNfsShares($nfsShares); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListNfsSharesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listNfsShares($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getNfsShares()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ListNfsShares', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNfsSharesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListNfsSharesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listNfsShares($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOSImagesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $osImagesElement = new OSImage(); + $osImages = [ + $osImagesElement, + ]; + $expectedResponse = new ListOSImagesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setOsImages($osImages); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListOSImagesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listOSImages($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getOsImages()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ListOSImages', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOSImagesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListOSImagesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listOSImages($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProvisioningQuotasTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $provisioningQuotasElement = new ProvisioningQuota(); + $provisioningQuotas = [ + $provisioningQuotasElement, + ]; + $expectedResponse = new ListProvisioningQuotasResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProvisioningQuotas($provisioningQuotas); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListProvisioningQuotasRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listProvisioningQuotas($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProvisioningQuotas()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ListProvisioningQuotas', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProvisioningQuotasExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListProvisioningQuotasRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listProvisioningQuotas($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSSHKeysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $sshKeysElement = new SSHKey(); + $sshKeys = [ + $sshKeysElement, + ]; + $expectedResponse = new ListSSHKeysResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSshKeys($sshKeys); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSSHKeysRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listSSHKeys($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSshKeys()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ListSSHKeys', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSSHKeysExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSSHKeysRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listSSHKeys($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVolumeSnapshotsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $volumeSnapshotsElement = new VolumeSnapshot(); + $volumeSnapshots = [ + $volumeSnapshotsElement, + ]; + $expectedResponse = new ListVolumeSnapshotsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setVolumeSnapshots($volumeSnapshots); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $request = (new ListVolumeSnapshotsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listVolumeSnapshots($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getVolumeSnapshots()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ListVolumeSnapshots', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVolumeSnapshotsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $request = (new ListVolumeSnapshotsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listVolumeSnapshots($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVolumesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $volumesElement = new Volume(); + $volumes = [ + $volumesElement, + ]; + $expectedResponse = new ListVolumesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setVolumes($volumes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListVolumesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listVolumes($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getVolumes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ListVolumes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVolumesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListVolumesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listVolumes($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renameInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $id = 'id3355'; + $machineType = 'machineType1838323762'; + $hyperthreadingEnabled = true; + $interactiveSerialConsoleEnabled = false; + $osImage = 'osImage1982209856'; + $pod = 'pod111173'; + $networkTemplate = 'networkTemplate215365483'; + $loginInfo = 'loginInfo-1747949628'; + $firmwareVersion = 'firmwareVersion-987819436'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setId($id); + $expectedResponse->setMachineType($machineType); + $expectedResponse->setHyperthreadingEnabled($hyperthreadingEnabled); + $expectedResponse->setInteractiveSerialConsoleEnabled($interactiveSerialConsoleEnabled); + $expectedResponse->setOsImage($osImage); + $expectedResponse->setPod($pod); + $expectedResponse->setNetworkTemplate($networkTemplate); + $expectedResponse->setLoginInfo($loginInfo); + $expectedResponse->setFirmwareVersion($firmwareVersion); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $newInstanceId = 'newInstanceId-179130138'; + $request = (new RenameInstanceRequest()) + ->setName($formattedName) + ->setNewInstanceId($newInstanceId); + $response = $gapicClient->renameInstance($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/RenameInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getNewInstanceId(); + $this->assertProtobufEquals($newInstanceId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renameInstanceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $newInstanceId = 'newInstanceId-179130138'; + $request = (new RenameInstanceRequest()) + ->setName($formattedName) + ->setNewInstanceId($newInstanceId); + try { + $gapicClient->renameInstance($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renameNetworkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $id = 'id3355'; + $ipAddress = 'ipAddress1480014044'; + $vlanId = 'vlanId536153463'; + $cidr = 'cidr3053428'; + $servicesCidr = 'servicesCidr-1169831243'; + $pod = 'pod111173'; + $jumboFramesEnabled = true; + $gatewayIp = 'gatewayIp955798786'; + $expectedResponse = new Network(); + $expectedResponse->setName($name2); + $expectedResponse->setId($id); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setVlanId($vlanId); + $expectedResponse->setCidr($cidr); + $expectedResponse->setServicesCidr($servicesCidr); + $expectedResponse->setPod($pod); + $expectedResponse->setJumboFramesEnabled($jumboFramesEnabled); + $expectedResponse->setGatewayIp($gatewayIp); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[NETWORK]'); + $newNetworkId = 'newNetworkId-554751797'; + $request = (new RenameNetworkRequest()) + ->setName($formattedName) + ->setNewNetworkId($newNetworkId); + $response = $gapicClient->renameNetwork($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/RenameNetwork', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getNewNetworkId(); + $this->assertProtobufEquals($newNetworkId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renameNetworkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[NETWORK]'); + $newNetworkId = 'newNetworkId-554751797'; + $request = (new RenameNetworkRequest()) + ->setName($formattedName) + ->setNewNetworkId($newNetworkId); + try { + $gapicClient->renameNetwork($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renameNfsShareTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $nfsShareId = 'nfsShareId931294079'; + $id = 'id3355'; + $volume = 'volume-810883302'; + $requestedSizeGib = 525454387; + $expectedResponse = new NfsShare(); + $expectedResponse->setName($name2); + $expectedResponse->setNfsShareId($nfsShareId); + $expectedResponse->setId($id); + $expectedResponse->setVolume($volume); + $expectedResponse->setRequestedSizeGib($requestedSizeGib); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->nFSShareName('[PROJECT]', '[LOCATION]', '[NFS_SHARE]'); + $newNfsshareId = 'newNfsshareId814577687'; + $request = (new RenameNfsShareRequest()) + ->setName($formattedName) + ->setNewNfsshareId($newNfsshareId); + $response = $gapicClient->renameNfsShare($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/RenameNfsShare', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getNewNfsshareId(); + $this->assertProtobufEquals($newNfsshareId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renameNfsShareExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->nFSShareName('[PROJECT]', '[LOCATION]', '[NFS_SHARE]'); + $newNfsshareId = 'newNfsshareId814577687'; + $request = (new RenameNfsShareRequest()) + ->setName($formattedName) + ->setNewNfsshareId($newNfsshareId); + try { + $gapicClient->renameNfsShare($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renameVolumeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $id = 'id3355'; + $requestedSizeGib = 525454387; + $originallyRequestedSizeGib = 44854004; + $currentSizeGib = 72696456; + $emergencySizeGib = 1936971120; + $maxSizeGib = 1805521661; + $autoGrownSizeGib = 1245638678; + $remainingSpaceGib = 1423108606; + $snapshotEnabled = true; + $pod = 'pod111173'; + $bootVolume = false; + $notes = 'notes105008833'; + $attached = true; + $expectedResponse = new Volume(); + $expectedResponse->setName($name2); + $expectedResponse->setId($id); + $expectedResponse->setRequestedSizeGib($requestedSizeGib); + $expectedResponse->setOriginallyRequestedSizeGib($originallyRequestedSizeGib); + $expectedResponse->setCurrentSizeGib($currentSizeGib); + $expectedResponse->setEmergencySizeGib($emergencySizeGib); + $expectedResponse->setMaxSizeGib($maxSizeGib); + $expectedResponse->setAutoGrownSizeGib($autoGrownSizeGib); + $expectedResponse->setRemainingSpaceGib($remainingSpaceGib); + $expectedResponse->setSnapshotEnabled($snapshotEnabled); + $expectedResponse->setPod($pod); + $expectedResponse->setBootVolume($bootVolume); + $expectedResponse->setNotes($notes); + $expectedResponse->setAttached($attached); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $newVolumeId = 'newVolumeId-468182911'; + $request = (new RenameVolumeRequest()) + ->setName($formattedName) + ->setNewVolumeId($newVolumeId); + $response = $gapicClient->renameVolume($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/RenameVolume', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getNewVolumeId(); + $this->assertProtobufEquals($newVolumeId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renameVolumeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $newVolumeId = 'newVolumeId-468182911'; + $request = (new RenameVolumeRequest()) + ->setName($formattedName) + ->setNewVolumeId($newVolumeId); + try { + $gapicClient->renameVolume($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resetInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/resetInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ResetInstanceResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/resetInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ResetInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->resetInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ResetInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/resetInstanceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function resetInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/resetInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ResetInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->resetInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/resetInstanceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function resizeVolumeTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/resizeVolumeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $id = 'id3355'; + $requestedSizeGib = 525454387; + $originallyRequestedSizeGib = 44854004; + $currentSizeGib = 72696456; + $emergencySizeGib = 1936971120; + $maxSizeGib = 1805521661; + $autoGrownSizeGib = 1245638678; + $remainingSpaceGib = 1423108606; + $snapshotEnabled = true; + $pod = 'pod111173'; + $bootVolume = false; + $notes = 'notes105008833'; + $attached = true; + $expectedResponse = new Volume(); + $expectedResponse->setName($name); + $expectedResponse->setId($id); + $expectedResponse->setRequestedSizeGib($requestedSizeGib); + $expectedResponse->setOriginallyRequestedSizeGib($originallyRequestedSizeGib); + $expectedResponse->setCurrentSizeGib($currentSizeGib); + $expectedResponse->setEmergencySizeGib($emergencySizeGib); + $expectedResponse->setMaxSizeGib($maxSizeGib); + $expectedResponse->setAutoGrownSizeGib($autoGrownSizeGib); + $expectedResponse->setRemainingSpaceGib($remainingSpaceGib); + $expectedResponse->setSnapshotEnabled($snapshotEnabled); + $expectedResponse->setPod($pod); + $expectedResponse->setBootVolume($bootVolume); + $expectedResponse->setNotes($notes); + $expectedResponse->setAttached($attached); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/resizeVolumeTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedVolume = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $request = (new ResizeVolumeRequest()) + ->setVolume($formattedVolume); + $response = $gapicClient->resizeVolume($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/ResizeVolume', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getVolume(); + $this->assertProtobufEquals($formattedVolume, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/resizeVolumeTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function resizeVolumeExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/resizeVolumeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedVolume = $gapicClient->volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]'); + $request = (new ResizeVolumeRequest()) + ->setVolume($formattedVolume); + $response = $gapicClient->resizeVolume($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/resizeVolumeTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function restoreVolumeSnapshotTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreVolumeSnapshotTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $id = 'id3355'; + $description = 'description-1724546052'; + $storageVolume = 'storageVolume-768806562'; + $expectedResponse = new VolumeSnapshot(); + $expectedResponse->setName($name); + $expectedResponse->setId($id); + $expectedResponse->setDescription($description); + $expectedResponse->setStorageVolume($storageVolume); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restoreVolumeSnapshotTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedVolumeSnapshot = $gapicClient->volumeSnapshotName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[SNAPSHOT]'); + $request = (new RestoreVolumeSnapshotRequest()) + ->setVolumeSnapshot($formattedVolumeSnapshot); + $response = $gapicClient->restoreVolumeSnapshot($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/RestoreVolumeSnapshot', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getVolumeSnapshot(); + $this->assertProtobufEquals($formattedVolumeSnapshot, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreVolumeSnapshotTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function restoreVolumeSnapshotExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreVolumeSnapshotTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedVolumeSnapshot = $gapicClient->volumeSnapshotName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[SNAPSHOT]'); + $request = (new RestoreVolumeSnapshotRequest()) + ->setVolumeSnapshot($formattedVolumeSnapshot); + $response = $gapicClient->restoreVolumeSnapshot($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreVolumeSnapshotTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function startInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/startInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new StartInstanceResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/startInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new StartInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->startInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/StartInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/startInstanceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function startInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/startInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new StartInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->startInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/startInstanceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function stopInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/stopInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new StopInstanceResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/stopInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new StopInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->stopInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/StopInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/stopInstanceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function stopInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/stopInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new StopInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->stopInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/stopInstanceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function submitProvisioningConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SubmitProvisioningConfigResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $provisioningConfig = new ProvisioningConfig(); + $request = (new SubmitProvisioningConfigRequest()) + ->setParent($formattedParent) + ->setProvisioningConfig($provisioningConfig); + $response = $gapicClient->submitProvisioningConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/SubmitProvisioningConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getProvisioningConfig(); + $this->assertProtobufEquals($provisioningConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function submitProvisioningConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $provisioningConfig = new ProvisioningConfig(); + $request = (new SubmitProvisioningConfigRequest()) + ->setParent($formattedParent) + ->setProvisioningConfig($provisioningConfig); + try { + $gapicClient->submitProvisioningConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $id = 'id3355'; + $machineType = 'machineType1838323762'; + $hyperthreadingEnabled = true; + $interactiveSerialConsoleEnabled = false; + $osImage = 'osImage1982209856'; + $pod = 'pod111173'; + $networkTemplate = 'networkTemplate215365483'; + $loginInfo = 'loginInfo-1747949628'; + $firmwareVersion = 'firmwareVersion-987819436'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setId($id); + $expectedResponse->setMachineType($machineType); + $expectedResponse->setHyperthreadingEnabled($hyperthreadingEnabled); + $expectedResponse->setInteractiveSerialConsoleEnabled($interactiveSerialConsoleEnabled); + $expectedResponse->setOsImage($osImage); + $expectedResponse->setPod($pod); + $expectedResponse->setNetworkTemplate($networkTemplate); + $expectedResponse->setLoginInfo($loginInfo); + $expectedResponse->setFirmwareVersion($firmwareVersion); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = new Instance(); + $request = (new UpdateInstanceRequest()) + ->setInstance($instance); + $response = $gapicClient->updateInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/UpdateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $instance = new Instance(); + $request = (new UpdateInstanceRequest()) + ->setInstance($instance); + $response = $gapicClient->updateInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateNetworkTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateNetworkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $id = 'id3355'; + $ipAddress = 'ipAddress1480014044'; + $vlanId = 'vlanId536153463'; + $cidr = 'cidr3053428'; + $servicesCidr = 'servicesCidr-1169831243'; + $pod = 'pod111173'; + $jumboFramesEnabled = true; + $gatewayIp = 'gatewayIp955798786'; + $expectedResponse = new Network(); + $expectedResponse->setName($name); + $expectedResponse->setId($id); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setVlanId($vlanId); + $expectedResponse->setCidr($cidr); + $expectedResponse->setServicesCidr($servicesCidr); + $expectedResponse->setPod($pod); + $expectedResponse->setJumboFramesEnabled($jumboFramesEnabled); + $expectedResponse->setGatewayIp($gatewayIp); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateNetworkTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = new Network(); + $request = (new UpdateNetworkRequest()) + ->setNetwork($network); + $response = $gapicClient->updateNetwork($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/UpdateNetwork', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateNetworkTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateNetworkExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateNetworkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $network = new Network(); + $request = (new UpdateNetworkRequest()) + ->setNetwork($network); + $response = $gapicClient->updateNetwork($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateNetworkTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateNfsShareTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateNfsShareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $nfsShareId = 'nfsShareId931294079'; + $id = 'id3355'; + $volume = 'volume-810883302'; + $requestedSizeGib = 525454387; + $expectedResponse = new NfsShare(); + $expectedResponse->setName($name); + $expectedResponse->setNfsShareId($nfsShareId); + $expectedResponse->setId($id); + $expectedResponse->setVolume($volume); + $expectedResponse->setRequestedSizeGib($requestedSizeGib); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateNfsShareTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nfsShare = new NfsShare(); + $request = (new UpdateNfsShareRequest()) + ->setNfsShare($nfsShare); + $response = $gapicClient->updateNfsShare($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/UpdateNfsShare', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNfsShare(); + $this->assertProtobufEquals($nfsShare, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateNfsShareTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateNfsShareExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateNfsShareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $nfsShare = new NfsShare(); + $request = (new UpdateNfsShareRequest()) + ->setNfsShare($nfsShare); + $response = $gapicClient->updateNfsShare($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateNfsShareTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateProvisioningConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $ticketId = 'ticketId-71132370'; + $handoverServiceAccount = 'handoverServiceAccount747638823'; + $email2 = 'email2-1638014897'; + $location = 'location1901043637'; + $cloudConsoleUri = 'cloudConsoleUri529066874'; + $vpcScEnabled = true; + $statusMessage = 'statusMessage-239442758'; + $customId = 'customId1611556009'; + $expectedResponse = new ProvisioningConfig(); + $expectedResponse->setName($name); + $expectedResponse->setTicketId($ticketId); + $expectedResponse->setHandoverServiceAccount($handoverServiceAccount); + $expectedResponse->setEmail($email2); + $expectedResponse->setLocation($location); + $expectedResponse->setCloudConsoleUri($cloudConsoleUri); + $expectedResponse->setVpcScEnabled($vpcScEnabled); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setCustomId($customId); + $transport->addResponse($expectedResponse); + // Mock request + $provisioningConfig = new ProvisioningConfig(); + $updateMask = new FieldMask(); + $request = (new UpdateProvisioningConfigRequest()) + ->setProvisioningConfig($provisioningConfig) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateProvisioningConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/UpdateProvisioningConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getProvisioningConfig(); + $this->assertProtobufEquals($provisioningConfig, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateProvisioningConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $provisioningConfig = new ProvisioningConfig(); + $updateMask = new FieldMask(); + $request = (new UpdateProvisioningConfigRequest()) + ->setProvisioningConfig($provisioningConfig) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateProvisioningConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateVolumeTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateVolumeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $id = 'id3355'; + $requestedSizeGib = 525454387; + $originallyRequestedSizeGib = 44854004; + $currentSizeGib = 72696456; + $emergencySizeGib = 1936971120; + $maxSizeGib = 1805521661; + $autoGrownSizeGib = 1245638678; + $remainingSpaceGib = 1423108606; + $snapshotEnabled = true; + $pod = 'pod111173'; + $bootVolume = false; + $notes = 'notes105008833'; + $attached = true; + $expectedResponse = new Volume(); + $expectedResponse->setName($name); + $expectedResponse->setId($id); + $expectedResponse->setRequestedSizeGib($requestedSizeGib); + $expectedResponse->setOriginallyRequestedSizeGib($originallyRequestedSizeGib); + $expectedResponse->setCurrentSizeGib($currentSizeGib); + $expectedResponse->setEmergencySizeGib($emergencySizeGib); + $expectedResponse->setMaxSizeGib($maxSizeGib); + $expectedResponse->setAutoGrownSizeGib($autoGrownSizeGib); + $expectedResponse->setRemainingSpaceGib($remainingSpaceGib); + $expectedResponse->setSnapshotEnabled($snapshotEnabled); + $expectedResponse->setPod($pod); + $expectedResponse->setBootVolume($bootVolume); + $expectedResponse->setNotes($notes); + $expectedResponse->setAttached($attached); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateVolumeTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $volume = new Volume(); + $request = (new UpdateVolumeRequest()) + ->setVolume($volume); + $response = $gapicClient->updateVolume($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/UpdateVolume', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getVolume(); + $this->assertProtobufEquals($volume, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateVolumeTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateVolumeExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateVolumeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $volume = new Volume(); + $request = (new UpdateVolumeRequest()) + ->setVolume($volume); + $response = $gapicClient->updateVolume($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateVolumeTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createNfsShareAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createNfsShareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $nfsShareId = 'nfsShareId931294079'; + $id = 'id3355'; + $volume = 'volume-810883302'; + $requestedSizeGib = 525454387; + $expectedResponse = new NfsShare(); + $expectedResponse->setName($name); + $expectedResponse->setNfsShareId($nfsShareId); + $expectedResponse->setId($id); + $expectedResponse->setVolume($volume); + $expectedResponse->setRequestedSizeGib($requestedSizeGib); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createNfsShareTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $nfsShare = new NfsShare(); + $request = (new CreateNfsShareRequest()) + ->setParent($formattedParent) + ->setNfsShare($nfsShare); + $response = $gapicClient->createNfsShareAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.baremetalsolution.v2.BareMetalSolution/CreateNfsShare', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getNfsShare(); + $this->assertProtobufEquals($nfsShare, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createNfsShareTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Batch.php b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Batch.php new file mode 100644 index 000000000000..7f21496cde09 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Batch.php @@ -0,0 +1,93 @@ +internalAddGeneratedFile( + ' +† +!google/cloud/batch/v1/batch.protogoogle.cloud.batch.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/field_info.protogoogle/api/resource.protogoogle/cloud/batch/v1/job.proto google/cloud/batch/v1/task.proto#google/longrunning/operations.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.proto"› +CreateJobRequest0 +parent ( B àAúAbatch.googleapis.com/Job +job_id ( , +job ( 2.google.cloud.batch.v1.JobBàA + +request_id ( BàA"? + GetJobRequest. +name ( B àAúA +batch.googleapis.com/Job"N +DeleteJobRequest +name (  +reason ( BàA + +request_id ( BàA"o +ListJobsRequest +parent (  +filter (  +order_by ( BàA + page_size ( + +page_token ( "j +ListJobsResponse( +jobs ( 2.google.cloud.batch.v1.Job +next_page_token (  + unreachable ( " +ListTasksRequest6 +parent ( B&àAúA +batch.googleapis.com/TaskGroup +filter (  + page_size ( + +page_token ( "m +ListTasksResponse* +tasks ( 2.google.cloud.batch.v1.Task +next_page_token (  + unreachable ( "A +GetTaskRequest/ +name ( B!àAúA +batch.googleapis.com/Task"€ +OperationMetadata4 + create_time ( 2.google.protobuf.TimestampBàA1 +end_time ( 2.google.protobuf.TimestampBàA +target ( BàA +verb ( BàA +status_message ( BàA# +requested_cancellation (BàA + api_version ( BàA2¶ + BatchService› + CreateJob\'.google.cloud.batch.v1.CreateJobRequest.google.cloud.batch.v1.Job"IÚAparent,job,job_id‚Óä“/"(/v1/{parent=projects/*/locations/*}/jobs:jobƒ +GetJob$.google.cloud.batch.v1.GetJobRequest.google.cloud.batch.v1.Job"7ÚAname‚Óä“*(/v1/{name=projects/*/locations/*/jobs/*}Ï + DeleteJob\'.google.cloud.batch.v1.DeleteJobRequest.google.longrunning.Operation"zÊA@ +google.protobuf.Empty\'google.cloud.batch.v1.OperationMetadataÚAname‚Óä“**(/v1/{name=projects/*/locations/*/jobs/*}– +ListJobs&.google.cloud.batch.v1.ListJobsRequest\'.google.cloud.batch.v1.ListJobsResponse"9ÚAparent‚Óä“*(/v1/{parent=projects/*/locations/*}/jobs› +GetTask%.google.cloud.batch.v1.GetTaskRequest.google.cloud.batch.v1.Task"LÚAname‚Óä“?=/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}® + ListTasks\'.google.cloud.batch.v1.ListTasksRequest(.google.cloud.batch.v1.ListTasksResponse"NÚAparent‚Óä“?=/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasksHÊAbatch.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB« +com.google.cloud.batch.v1B +BatchProtoPZ/cloud.google.com/go/batch/apiv1/batchpb;batchpb¢GCBªGoogle.Cloud.Batch.V1ÊGoogle\\Cloud\\Batch\\V1êGoogle::Cloud::Batch::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Job.php b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Job.php new file mode 100644 index 000000000000..ab493fe0fa4e Binary files /dev/null and b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Job.php differ diff --git a/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Task.php b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Task.php new file mode 100644 index 000000000000..8bac0e2979df Binary files /dev/null and b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Task.php differ diff --git a/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Volume.php b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Volume.php new file mode 100644 index 000000000000..fa8ca8061c1c Binary files /dev/null and b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Volume.php differ diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy.php new file mode 100644 index 000000000000..8bb1517f5ed2 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy.php @@ -0,0 +1,412 @@ +google.cloud.batch.v1.AllocationPolicy + */ +class AllocationPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Location where compute resources should be allocated for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + */ + protected $location = null; + /** + * Describe instances that can be created by this AllocationPolicy. + * Only instances[0] is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + */ + private $instances; + /** + * Defines the service account for Batch-created VMs. If omitted, the [default + * Compute Engine service + * account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + * is used. Must match the service account specified in any used instance + * template configured in the Batch job. + * Includes the following fields: + * * email: The service account's email address. If not set, the default + * Compute Engine service account is used. + * * scopes: Additional OAuth scopes to grant the service account, beyond the + * default cloud-platform scope. (list of strings) + * + * Generated from protobuf field .google.cloud.batch.v1.ServiceAccount service_account = 9; + */ + protected $service_account = null; + /** + * Custom labels to apply to the job and all the Compute Engine resources + * that both are created by this allocation policy and support labels. + * Use labels to group and describe the resources they are applied to. Batch + * automatically applies predefined labels and supports multiple `labels` + * fields for each job, which each let you apply custom labels to various + * resources. Label names that start with "goog-" or "google-" are + * reserved for predefined labels. For more information about labels with + * Batch, see + * [Organize resources using + * labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + * + * Generated from protobuf field map labels = 6; + */ + private $labels; + /** + * The network policy. + * If you define an instance template in the `InstancePolicyOrTemplate` field, + * Batch will use the network settings in the instance template instead of + * this field. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + */ + protected $network = null; + /** + * The placement policy. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + */ + protected $placement = null; + /** + * Optional. Tags applied to the VM instances. + * The tags identify valid sources or targets for network firewalls. + * Each tag must be 1-63 characters long, and comply with + * [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + * + * Generated from protobuf field repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy $location + * Location where compute resources should be allocated for the Job. + * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicyOrTemplate>|\Google\Protobuf\Internal\RepeatedField $instances + * Describe instances that can be created by this AllocationPolicy. + * Only instances[0] is supported now. + * @type \Google\Cloud\Batch\V1\ServiceAccount $service_account + * Defines the service account for Batch-created VMs. If omitted, the [default + * Compute Engine service + * account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + * is used. Must match the service account specified in any used instance + * template configured in the Batch job. + * Includes the following fields: + * * email: The service account's email address. If not set, the default + * Compute Engine service account is used. + * * scopes: Additional OAuth scopes to grant the service account, beyond the + * default cloud-platform scope. (list of strings) + * @type array|\Google\Protobuf\Internal\MapField $labels + * Custom labels to apply to the job and all the Compute Engine resources + * that both are created by this allocation policy and support labels. + * Use labels to group and describe the resources they are applied to. Batch + * automatically applies predefined labels and supports multiple `labels` + * fields for each job, which each let you apply custom labels to various + * resources. Label names that start with "goog-" or "google-" are + * reserved for predefined labels. For more information about labels with + * Batch, see + * [Organize resources using + * labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + * @type \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy $network + * The network policy. + * If you define an instance template in the `InstancePolicyOrTemplate` field, + * Batch will use the network settings in the instance template instead of + * this field. + * @type \Google\Cloud\Batch\V1\AllocationPolicy\PlacementPolicy $placement + * The placement policy. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Optional. Tags applied to the VM instances. + * The tags identify valid sources or targets for network firewalls. + * Each tag must be 1-63 characters long, and comply with + * [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Location where compute resources should be allocated for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy|null + */ + public function getLocation() + { + return $this->location; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * Location where compute resources should be allocated for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy::class); + $this->location = $var; + + return $this; + } + + /** + * Describe instances that can be created by this AllocationPolicy. + * Only instances[0] is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Describe instances that can be created by this AllocationPolicy. + * Only instances[0] is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicyOrTemplate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicyOrTemplate::class); + $this->instances = $arr; + + return $this; + } + + /** + * Defines the service account for Batch-created VMs. If omitted, the [default + * Compute Engine service + * account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + * is used. Must match the service account specified in any used instance + * template configured in the Batch job. + * Includes the following fields: + * * email: The service account's email address. If not set, the default + * Compute Engine service account is used. + * * scopes: Additional OAuth scopes to grant the service account, beyond the + * default cloud-platform scope. (list of strings) + * + * Generated from protobuf field .google.cloud.batch.v1.ServiceAccount service_account = 9; + * @return \Google\Cloud\Batch\V1\ServiceAccount|null + */ + public function getServiceAccount() + { + return $this->service_account; + } + + public function hasServiceAccount() + { + return isset($this->service_account); + } + + public function clearServiceAccount() + { + unset($this->service_account); + } + + /** + * Defines the service account for Batch-created VMs. If omitted, the [default + * Compute Engine service + * account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + * is used. Must match the service account specified in any used instance + * template configured in the Batch job. + * Includes the following fields: + * * email: The service account's email address. If not set, the default + * Compute Engine service account is used. + * * scopes: Additional OAuth scopes to grant the service account, beyond the + * default cloud-platform scope. (list of strings) + * + * Generated from protobuf field .google.cloud.batch.v1.ServiceAccount service_account = 9; + * @param \Google\Cloud\Batch\V1\ServiceAccount $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\ServiceAccount::class); + $this->service_account = $var; + + return $this; + } + + /** + * Custom labels to apply to the job and all the Compute Engine resources + * that both are created by this allocation policy and support labels. + * Use labels to group and describe the resources they are applied to. Batch + * automatically applies predefined labels and supports multiple `labels` + * fields for each job, which each let you apply custom labels to various + * resources. Label names that start with "goog-" or "google-" are + * reserved for predefined labels. For more information about labels with + * Batch, see + * [Organize resources using + * labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + * + * Generated from protobuf field map labels = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Custom labels to apply to the job and all the Compute Engine resources + * that both are created by this allocation policy and support labels. + * Use labels to group and describe the resources they are applied to. Batch + * automatically applies predefined labels and supports multiple `labels` + * fields for each job, which each let you apply custom labels to various + * resources. Label names that start with "goog-" or "google-" are + * reserved for predefined labels. For more information about labels with + * Batch, see + * [Organize resources using + * labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + * + * Generated from protobuf field map labels = 6; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The network policy. + * If you define an instance template in the `InstancePolicyOrTemplate` field, + * Batch will use the network settings in the instance template instead of + * this field. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy|null + */ + public function getNetwork() + { + return $this->network; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * The network policy. + * If you define an instance template in the `InstancePolicyOrTemplate` field, + * Batch will use the network settings in the instance template instead of + * this field. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy::class); + $this->network = $var; + + return $this; + } + + /** + * The placement policy. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\PlacementPolicy|null + */ + public function getPlacement() + { + return $this->placement; + } + + public function hasPlacement() + { + return isset($this->placement); + } + + public function clearPlacement() + { + unset($this->placement); + } + + /** + * The placement policy. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\PlacementPolicy $var + * @return $this + */ + public function setPlacement($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\PlacementPolicy::class); + $this->placement = $var; + + return $this; + } + + /** + * Optional. Tags applied to the VM instances. + * The tags identify valid sources or targets for network firewalls. + * Each tag must be 1-63 characters long, and comply with + * [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + * + * Generated from protobuf field repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. Tags applied to the VM instances. + * The tags identify valid sources or targets for network firewalls. + * Each tag must be 1-63 characters long, and comply with + * [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + * + * Generated from protobuf field repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Accelerator.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Accelerator.php new file mode 100644 index 000000000000..a035df7f534c --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Accelerator.php @@ -0,0 +1,201 @@ +google.cloud.batch.v1.AllocationPolicy.Accelerator + */ +class Accelerator extends \Google\Protobuf\Internal\Message +{ + /** + * The accelerator type. For example, "nvidia-tesla-t4". + * See `gcloud compute accelerator-types list`. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * The number of accelerators of this type. + * + * Generated from protobuf field int64 count = 2; + */ + protected $count = 0; + /** + * Deprecated: please use instances[0].install_gpu_drivers instead. + * + * Generated from protobuf field bool install_gpu_drivers = 3 [deprecated = true]; + * @deprecated + */ + protected $install_gpu_drivers = false; + /** + * Optional. The NVIDIA GPU driver version that should be installed for this + * type. + * You can define the specific driver version such as "470.103.01", + * following the driver version requirements in + * https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. + * Batch will install the specific accelerator driver if qualified. + * + * Generated from protobuf field string driver_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $driver_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * The accelerator type. For example, "nvidia-tesla-t4". + * See `gcloud compute accelerator-types list`. + * @type int|string $count + * The number of accelerators of this type. + * @type bool $install_gpu_drivers + * Deprecated: please use instances[0].install_gpu_drivers instead. + * @type string $driver_version + * Optional. The NVIDIA GPU driver version that should be installed for this + * type. + * You can define the specific driver version such as "470.103.01", + * following the driver version requirements in + * https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. + * Batch will install the specific accelerator driver if qualified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The accelerator type. For example, "nvidia-tesla-t4". + * See `gcloud compute accelerator-types list`. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The accelerator type. For example, "nvidia-tesla-t4". + * See `gcloud compute accelerator-types list`. + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The number of accelerators of this type. + * + * Generated from protobuf field int64 count = 2; + * @return int|string + */ + public function getCount() + { + return $this->count; + } + + /** + * The number of accelerators of this type. + * + * Generated from protobuf field int64 count = 2; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt64($var); + $this->count = $var; + + return $this; + } + + /** + * Deprecated: please use instances[0].install_gpu_drivers instead. + * + * Generated from protobuf field bool install_gpu_drivers = 3 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getInstallGpuDrivers() + { + @trigger_error('install_gpu_drivers is deprecated.', E_USER_DEPRECATED); + return $this->install_gpu_drivers; + } + + /** + * Deprecated: please use instances[0].install_gpu_drivers instead. + * + * Generated from protobuf field bool install_gpu_drivers = 3 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setInstallGpuDrivers($var) + { + @trigger_error('install_gpu_drivers is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->install_gpu_drivers = $var; + + return $this; + } + + /** + * Optional. The NVIDIA GPU driver version that should be installed for this + * type. + * You can define the specific driver version such as "470.103.01", + * following the driver version requirements in + * https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. + * Batch will install the specific accelerator driver if qualified. + * + * Generated from protobuf field string driver_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDriverVersion() + { + return $this->driver_version; + } + + /** + * Optional. The NVIDIA GPU driver version that should be installed for this + * type. + * You can define the specific driver version such as "470.103.01", + * following the driver version requirements in + * https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. + * Batch will install the specific accelerator driver if qualified. + * + * Generated from protobuf field string driver_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDriverVersion($var) + { + GPBUtil::checkString($var, True); + $this->driver_version = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Accelerator::class, \Google\Cloud\Batch\V1\AllocationPolicy_Accelerator::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/AttachedDisk.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/AttachedDisk.php new file mode 100644 index 000000000000..d57b97912d09 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/AttachedDisk.php @@ -0,0 +1,153 @@ +google.cloud.batch.v1.AllocationPolicy.AttachedDisk + */ +class AttachedDisk extends \Google\Protobuf\Internal\Message +{ + /** + * Device name that the guest operating system will see. + * It is used by Runnable.volumes field to mount disks. So please specify + * the device_name if you want Batch to help mount the disk, and it should + * match the device_name field in volumes. + * + * Generated from protobuf field string device_name = 3; + */ + protected $device_name = ''; + protected $attached; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Batch\V1\AllocationPolicy\Disk $new_disk + * @type string $existing_disk + * Name of an existing PD. + * @type string $device_name + * Device name that the guest operating system will see. + * It is used by Runnable.volumes field to mount disks. So please specify + * the device_name if you want Batch to help mount the disk, and it should + * match the device_name field in volumes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\Disk|null + */ + public function getNewDisk() + { + return $this->readOneof(1); + } + + public function hasNewDisk() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\Disk $var + * @return $this + */ + public function setNewDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\Disk::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Name of an existing PD. + * + * Generated from protobuf field string existing_disk = 2; + * @return string + */ + public function getExistingDisk() + { + return $this->readOneof(2); + } + + public function hasExistingDisk() + { + return $this->hasOneof(2); + } + + /** + * Name of an existing PD. + * + * Generated from protobuf field string existing_disk = 2; + * @param string $var + * @return $this + */ + public function setExistingDisk($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Device name that the guest operating system will see. + * It is used by Runnable.volumes field to mount disks. So please specify + * the device_name if you want Batch to help mount the disk, and it should + * match the device_name field in volumes. + * + * Generated from protobuf field string device_name = 3; + * @return string + */ + public function getDeviceName() + { + return $this->device_name; + } + + /** + * Device name that the guest operating system will see. + * It is used by Runnable.volumes field to mount disks. So please specify + * the device_name if you want Batch to help mount the disk, and it should + * match the device_name field in volumes. + * + * Generated from protobuf field string device_name = 3; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->device_name = $var; + + return $this; + } + + /** + * @return string + */ + public function getAttached() + { + return $this->whichOneof("attached"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AttachedDisk::class, \Google\Cloud\Batch\V1\AllocationPolicy_AttachedDisk::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Disk.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Disk.php new file mode 100644 index 000000000000..339c61b43588 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Disk.php @@ -0,0 +1,349 @@ +google.cloud.batch.v1.AllocationPolicy.Disk + */ +class Disk extends \Google\Protobuf\Internal\Message +{ + /** + * Disk type as shown in `gcloud compute disk-types list`. + * For example, local SSD uses type "local-ssd". + * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + * or "pd-standard". If not specified, "pd-standard" will be used as the + * default type for non-boot disks, "pd-balanced" will be used as the + * default type for boot disks. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * Disk size in GB. + * **Non-Boot Disk**: + * If the `type` specifies a persistent disk, this field + * is ignored if `data_source` is set as `image` or `snapshot`. + * If the `type` specifies a local SSD, this field should be a multiple of + * 375 GB, otherwise, the final size will be the next greater multiple of + * 375 GB. + * **Boot Disk**: + * Batch will calculate the boot disk size based on source + * image and task requirements if you do not speicify the size. + * If both this field and the `boot_disk_mib` field in task spec's + * `compute_resource` are defined, Batch will only honor this field. + * Also, this field should be no smaller than the source disk's + * size when the `data_source` is set as `snapshot` or `image`. + * For example, if you set an image as the `data_source` field and the + * image's default disk size 30 GB, you can only use this field to make the + * disk larger or equal to 30 GB. + * + * Generated from protobuf field int64 size_gb = 2; + */ + protected $size_gb = 0; + /** + * Local SSDs are available through both "SCSI" and "NVMe" interfaces. + * If not indicated, "NVMe" will be the default one for local ssds. + * This field is ignored for persistent disks as the interface is chosen + * automatically. See + * https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. + * + * Generated from protobuf field string disk_interface = 6; + */ + protected $disk_interface = ''; + protected $data_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image + * URL for a VM image to use as the data source for this disk. + * For example, the following are all valid URLs: + * * Specify the image by its family name: + * projects/{project}/global/images/family/{image_family} + * * Specify the image version: + * projects/{project}/global/images/{image_version} + * You can also use Batch customized image in short names. + * The following image values are supported for a boot disk: + * * `batch-debian`: use Batch Debian images. + * * `batch-cos`: use Batch Container-Optimized images. + * * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. + * @type string $snapshot + * Name of a snapshot used as the data source. + * Snapshot is not supported as boot disk now. + * @type string $type + * Disk type as shown in `gcloud compute disk-types list`. + * For example, local SSD uses type "local-ssd". + * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + * or "pd-standard". If not specified, "pd-standard" will be used as the + * default type for non-boot disks, "pd-balanced" will be used as the + * default type for boot disks. + * @type int|string $size_gb + * Disk size in GB. + * **Non-Boot Disk**: + * If the `type` specifies a persistent disk, this field + * is ignored if `data_source` is set as `image` or `snapshot`. + * If the `type` specifies a local SSD, this field should be a multiple of + * 375 GB, otherwise, the final size will be the next greater multiple of + * 375 GB. + * **Boot Disk**: + * Batch will calculate the boot disk size based on source + * image and task requirements if you do not speicify the size. + * If both this field and the `boot_disk_mib` field in task spec's + * `compute_resource` are defined, Batch will only honor this field. + * Also, this field should be no smaller than the source disk's + * size when the `data_source` is set as `snapshot` or `image`. + * For example, if you set an image as the `data_source` field and the + * image's default disk size 30 GB, you can only use this field to make the + * disk larger or equal to 30 GB. + * @type string $disk_interface + * Local SSDs are available through both "SCSI" and "NVMe" interfaces. + * If not indicated, "NVMe" will be the default one for local ssds. + * This field is ignored for persistent disks as the interface is chosen + * automatically. See + * https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * URL for a VM image to use as the data source for this disk. + * For example, the following are all valid URLs: + * * Specify the image by its family name: + * projects/{project}/global/images/family/{image_family} + * * Specify the image version: + * projects/{project}/global/images/{image_version} + * You can also use Batch customized image in short names. + * The following image values are supported for a boot disk: + * * `batch-debian`: use Batch Debian images. + * * `batch-cos`: use Batch Container-Optimized images. + * * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. + * + * Generated from protobuf field string image = 4; + * @return string + */ + public function getImage() + { + return $this->readOneof(4); + } + + public function hasImage() + { + return $this->hasOneof(4); + } + + /** + * URL for a VM image to use as the data source for this disk. + * For example, the following are all valid URLs: + * * Specify the image by its family name: + * projects/{project}/global/images/family/{image_family} + * * Specify the image version: + * projects/{project}/global/images/{image_version} + * You can also use Batch customized image in short names. + * The following image values are supported for a boot disk: + * * `batch-debian`: use Batch Debian images. + * * `batch-cos`: use Batch Container-Optimized images. + * * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. + * + * Generated from protobuf field string image = 4; + * @param string $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Name of a snapshot used as the data source. + * Snapshot is not supported as boot disk now. + * + * Generated from protobuf field string snapshot = 5; + * @return string + */ + public function getSnapshot() + { + return $this->readOneof(5); + } + + public function hasSnapshot() + { + return $this->hasOneof(5); + } + + /** + * Name of a snapshot used as the data source. + * Snapshot is not supported as boot disk now. + * + * Generated from protobuf field string snapshot = 5; + * @param string $var + * @return $this + */ + public function setSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Disk type as shown in `gcloud compute disk-types list`. + * For example, local SSD uses type "local-ssd". + * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + * or "pd-standard". If not specified, "pd-standard" will be used as the + * default type for non-boot disks, "pd-balanced" will be used as the + * default type for boot disks. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Disk type as shown in `gcloud compute disk-types list`. + * For example, local SSD uses type "local-ssd". + * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + * or "pd-standard". If not specified, "pd-standard" will be used as the + * default type for non-boot disks, "pd-balanced" will be used as the + * default type for boot disks. + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Disk size in GB. + * **Non-Boot Disk**: + * If the `type` specifies a persistent disk, this field + * is ignored if `data_source` is set as `image` or `snapshot`. + * If the `type` specifies a local SSD, this field should be a multiple of + * 375 GB, otherwise, the final size will be the next greater multiple of + * 375 GB. + * **Boot Disk**: + * Batch will calculate the boot disk size based on source + * image and task requirements if you do not speicify the size. + * If both this field and the `boot_disk_mib` field in task spec's + * `compute_resource` are defined, Batch will only honor this field. + * Also, this field should be no smaller than the source disk's + * size when the `data_source` is set as `snapshot` or `image`. + * For example, if you set an image as the `data_source` field and the + * image's default disk size 30 GB, you can only use this field to make the + * disk larger or equal to 30 GB. + * + * Generated from protobuf field int64 size_gb = 2; + * @return int|string + */ + public function getSizeGb() + { + return $this->size_gb; + } + + /** + * Disk size in GB. + * **Non-Boot Disk**: + * If the `type` specifies a persistent disk, this field + * is ignored if `data_source` is set as `image` or `snapshot`. + * If the `type` specifies a local SSD, this field should be a multiple of + * 375 GB, otherwise, the final size will be the next greater multiple of + * 375 GB. + * **Boot Disk**: + * Batch will calculate the boot disk size based on source + * image and task requirements if you do not speicify the size. + * If both this field and the `boot_disk_mib` field in task spec's + * `compute_resource` are defined, Batch will only honor this field. + * Also, this field should be no smaller than the source disk's + * size when the `data_source` is set as `snapshot` or `image`. + * For example, if you set an image as the `data_source` field and the + * image's default disk size 30 GB, you can only use this field to make the + * disk larger or equal to 30 GB. + * + * Generated from protobuf field int64 size_gb = 2; + * @param int|string $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->size_gb = $var; + + return $this; + } + + /** + * Local SSDs are available through both "SCSI" and "NVMe" interfaces. + * If not indicated, "NVMe" will be the default one for local ssds. + * This field is ignored for persistent disks as the interface is chosen + * automatically. See + * https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. + * + * Generated from protobuf field string disk_interface = 6; + * @return string + */ + public function getDiskInterface() + { + return $this->disk_interface; + } + + /** + * Local SSDs are available through both "SCSI" and "NVMe" interfaces. + * If not indicated, "NVMe" will be the default one for local ssds. + * This field is ignored for persistent disks as the interface is chosen + * automatically. See + * https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. + * + * Generated from protobuf field string disk_interface = 6; + * @param string $var + * @return $this + */ + public function setDiskInterface($var) + { + GPBUtil::checkString($var, True); + $this->disk_interface = $var; + + return $this; + } + + /** + * @return string + */ + public function getDataSource() + { + return $this->whichOneof("data_source"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Disk::class, \Google\Cloud\Batch\V1\AllocationPolicy_Disk::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicy.php new file mode 100644 index 000000000000..8a22c39cdcec --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicy.php @@ -0,0 +1,329 @@ +google.cloud.batch.v1.AllocationPolicy.InstancePolicy + */ +class InstancePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 2; + */ + protected $machine_type = ''; + /** + * The minimum CPU platform. + * See + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * + * Generated from protobuf field string min_cpu_platform = 3; + */ + protected $min_cpu_platform = ''; + /** + * The provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + */ + protected $provisioning_model = 0; + /** + * The accelerators attached to each VM instance. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + */ + private $accelerators; + /** + * Boot disk to be created and attached to each VM by this InstancePolicy. + * Boot disk will be deleted when the VM is deleted. + * Batch API now only supports booting from image. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + */ + protected $boot_disk = null; + /** + * Non-boot disks to be attached for each VM created by this InstancePolicy. + * New disks will be deleted when the VM is deleted. + * A non-boot disk is a disk that can be of a device with a + * file system or a raw storage drive that is not ready for data + * storage and accessing. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + */ + private $disks; + /** + * Optional. If not specified (default), VMs will consume any applicable + * reservation. If "NO_RESERVATION" is specified, VMs will not consume any + * reservation. Otherwise, if specified, VMs will consume only the specified + * reservation. + * + * Generated from protobuf field string reservation = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $reservation = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $machine_type + * The Compute Engine machine type. + * @type string $min_cpu_platform + * The minimum CPU platform. + * See + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * @type int $provisioning_model + * The provisioning model. + * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\Accelerator>|\Google\Protobuf\Internal\RepeatedField $accelerators + * The accelerators attached to each VM instance. + * @type \Google\Cloud\Batch\V1\AllocationPolicy\Disk $boot_disk + * Boot disk to be created and attached to each VM by this InstancePolicy. + * Boot disk will be deleted when the VM is deleted. + * Batch API now only supports booting from image. + * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $disks + * Non-boot disks to be attached for each VM created by this InstancePolicy. + * New disks will be deleted when the VM is deleted. + * A non-boot disk is a disk that can be of a device with a + * file system or a raw storage drive that is not ready for data + * storage and accessing. + * @type string $reservation + * Optional. If not specified (default), VMs will consume any applicable + * reservation. If "NO_RESERVATION" is specified, VMs will not consume any + * reservation. Otherwise, if specified, VMs will consume only the specified + * reservation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 2; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 2; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * The minimum CPU platform. + * See + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * + * Generated from protobuf field string min_cpu_platform = 3; + * @return string + */ + public function getMinCpuPlatform() + { + return $this->min_cpu_platform; + } + + /** + * The minimum CPU platform. + * See + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * + * Generated from protobuf field string min_cpu_platform = 3; + * @param string $var + * @return $this + */ + public function setMinCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->min_cpu_platform = $var; + + return $this; + } + + /** + * The provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * @return int + */ + public function getProvisioningModel() + { + return $this->provisioning_model; + } + + /** + * The provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * @param int $var + * @return $this + */ + public function setProvisioningModel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\AllocationPolicy\ProvisioningModel::class); + $this->provisioning_model = $var; + + return $this; + } + + /** + * The accelerators attached to each VM instance. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccelerators() + { + return $this->accelerators; + } + + /** + * The accelerators attached to each VM instance. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\Accelerator>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\Accelerator::class); + $this->accelerators = $arr; + + return $this; + } + + /** + * Boot disk to be created and attached to each VM by this InstancePolicy. + * Boot disk will be deleted when the VM is deleted. + * Batch API now only supports booting from image. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\Disk|null + */ + public function getBootDisk() + { + return $this->boot_disk; + } + + public function hasBootDisk() + { + return isset($this->boot_disk); + } + + public function clearBootDisk() + { + unset($this->boot_disk); + } + + /** + * Boot disk to be created and attached to each VM by this InstancePolicy. + * Boot disk will be deleted when the VM is deleted. + * Batch API now only supports booting from image. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\Disk $var + * @return $this + */ + public function setBootDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\Disk::class); + $this->boot_disk = $var; + + return $this; + } + + /** + * Non-boot disks to be attached for each VM created by this InstancePolicy. + * New disks will be deleted when the VM is deleted. + * A non-boot disk is a disk that can be of a device with a + * file system or a raw storage drive that is not ready for data + * storage and accessing. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Non-boot disks to be attached for each VM created by this InstancePolicy. + * New disks will be deleted when the VM is deleted. + * A non-boot disk is a disk that can be of a device with a + * file system or a raw storage drive that is not ready for data + * storage and accessing. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk::class); + $this->disks = $arr; + + return $this; + } + + /** + * Optional. If not specified (default), VMs will consume any applicable + * reservation. If "NO_RESERVATION" is specified, VMs will not consume any + * reservation. Otherwise, if specified, VMs will consume only the specified + * reservation. + * + * Generated from protobuf field string reservation = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getReservation() + { + return $this->reservation; + } + + /** + * Optional. If not specified (default), VMs will consume any applicable + * reservation. If "NO_RESERVATION" is specified, VMs will not consume any + * reservation. Otherwise, if specified, VMs will consume only the specified + * reservation. + * + * Generated from protobuf field string reservation = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setReservation($var) + { + GPBUtil::checkString($var, True); + $this->reservation = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstancePolicy::class, \Google\Cloud\Batch\V1\AllocationPolicy_InstancePolicy::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicyOrTemplate.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicyOrTemplate.php new file mode 100644 index 000000000000..4a27518c3f23 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicyOrTemplate.php @@ -0,0 +1,319 @@ +google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + */ +class InstancePolicyOrTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Set this field true if you want Batch to help fetch drivers from a third + * party location and install them for GPUs specified in + * `policy.accelerators` or `instance_template` on your behalf. Default is + * false. + * For Container-Optimized Image cases, Batch will install the + * accelerator driver following milestones of + * https://cloud.google.com/container-optimized-os/docs/release-notes. For + * non Container-Optimized Image cases, following + * https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. + * + * Generated from protobuf field bool install_gpu_drivers = 3; + */ + protected $install_gpu_drivers = false; + /** + * Optional. Set this field true if you want Batch to install Ops Agent on + * your behalf. Default is false. + * + * Generated from protobuf field bool install_ops_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $install_ops_agent = false; + /** + * Optional. Set this field to `true` if you want Batch to block + * project-level SSH keys from accessing this job's VMs. Alternatively, you + * can configure the job to specify a VM instance template that blocks + * project-level SSH keys. In either case, Batch blocks project-level SSH + * keys while creating the VMs for this job. + * Batch allows project-level SSH keys for a job's VMs only if all + * the following are true: + * + This field is undefined or set to `false`. + * + The job's VM instance template (if any) doesn't block project-level + * SSH keys. + * Notably, you can override this behavior by manually updating a VM to + * block or allow project-level SSH keys. For more information about + * blocking project-level SSH keys, see the Compute Engine documentation: + * https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys + * + * Generated from protobuf field bool block_project_ssh_keys = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $block_project_ssh_keys = false; + protected $policy_template; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy $policy + * InstancePolicy. + * @type string $instance_template + * Name of an instance template used to create VMs. + * Named the field as 'instance_template' instead of 'template' to avoid + * C++ keyword conflict. + * Batch only supports global instance templates from the same project as + * the job. + * You can specify the global instance template as a full or partial URL. + * @type bool $install_gpu_drivers + * Set this field true if you want Batch to help fetch drivers from a third + * party location and install them for GPUs specified in + * `policy.accelerators` or `instance_template` on your behalf. Default is + * false. + * For Container-Optimized Image cases, Batch will install the + * accelerator driver following milestones of + * https://cloud.google.com/container-optimized-os/docs/release-notes. For + * non Container-Optimized Image cases, following + * https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. + * @type bool $install_ops_agent + * Optional. Set this field true if you want Batch to install Ops Agent on + * your behalf. Default is false. + * @type bool $block_project_ssh_keys + * Optional. Set this field to `true` if you want Batch to block + * project-level SSH keys from accessing this job's VMs. Alternatively, you + * can configure the job to specify a VM instance template that blocks + * project-level SSH keys. In either case, Batch blocks project-level SSH + * keys while creating the VMs for this job. + * Batch allows project-level SSH keys for a job's VMs only if all + * the following are true: + * + This field is undefined or set to `false`. + * + The job's VM instance template (if any) doesn't block project-level + * SSH keys. + * Notably, you can override this behavior by manually updating a VM to + * block or allow project-level SSH keys. For more information about + * blocking project-level SSH keys, see the Compute Engine documentation: + * https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * InstancePolicy. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy|null + */ + public function getPolicy() + { + return $this->readOneof(1); + } + + public function hasPolicy() + { + return $this->hasOneof(1); + } + + /** + * InstancePolicy. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Name of an instance template used to create VMs. + * Named the field as 'instance_template' instead of 'template' to avoid + * C++ keyword conflict. + * Batch only supports global instance templates from the same project as + * the job. + * You can specify the global instance template as a full or partial URL. + * + * Generated from protobuf field string instance_template = 2; + * @return string + */ + public function getInstanceTemplate() + { + return $this->readOneof(2); + } + + public function hasInstanceTemplate() + { + return $this->hasOneof(2); + } + + /** + * Name of an instance template used to create VMs. + * Named the field as 'instance_template' instead of 'template' to avoid + * C++ keyword conflict. + * Batch only supports global instance templates from the same project as + * the job. + * You can specify the global instance template as a full or partial URL. + * + * Generated from protobuf field string instance_template = 2; + * @param string $var + * @return $this + */ + public function setInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Set this field true if you want Batch to help fetch drivers from a third + * party location and install them for GPUs specified in + * `policy.accelerators` or `instance_template` on your behalf. Default is + * false. + * For Container-Optimized Image cases, Batch will install the + * accelerator driver following milestones of + * https://cloud.google.com/container-optimized-os/docs/release-notes. For + * non Container-Optimized Image cases, following + * https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. + * + * Generated from protobuf field bool install_gpu_drivers = 3; + * @return bool + */ + public function getInstallGpuDrivers() + { + return $this->install_gpu_drivers; + } + + /** + * Set this field true if you want Batch to help fetch drivers from a third + * party location and install them for GPUs specified in + * `policy.accelerators` or `instance_template` on your behalf. Default is + * false. + * For Container-Optimized Image cases, Batch will install the + * accelerator driver following milestones of + * https://cloud.google.com/container-optimized-os/docs/release-notes. For + * non Container-Optimized Image cases, following + * https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. + * + * Generated from protobuf field bool install_gpu_drivers = 3; + * @param bool $var + * @return $this + */ + public function setInstallGpuDrivers($var) + { + GPBUtil::checkBool($var); + $this->install_gpu_drivers = $var; + + return $this; + } + + /** + * Optional. Set this field true if you want Batch to install Ops Agent on + * your behalf. Default is false. + * + * Generated from protobuf field bool install_ops_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getInstallOpsAgent() + { + return $this->install_ops_agent; + } + + /** + * Optional. Set this field true if you want Batch to install Ops Agent on + * your behalf. Default is false. + * + * Generated from protobuf field bool install_ops_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setInstallOpsAgent($var) + { + GPBUtil::checkBool($var); + $this->install_ops_agent = $var; + + return $this; + } + + /** + * Optional. Set this field to `true` if you want Batch to block + * project-level SSH keys from accessing this job's VMs. Alternatively, you + * can configure the job to specify a VM instance template that blocks + * project-level SSH keys. In either case, Batch blocks project-level SSH + * keys while creating the VMs for this job. + * Batch allows project-level SSH keys for a job's VMs only if all + * the following are true: + * + This field is undefined or set to `false`. + * + The job's VM instance template (if any) doesn't block project-level + * SSH keys. + * Notably, you can override this behavior by manually updating a VM to + * block or allow project-level SSH keys. For more information about + * blocking project-level SSH keys, see the Compute Engine documentation: + * https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys + * + * Generated from protobuf field bool block_project_ssh_keys = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getBlockProjectSshKeys() + { + return $this->block_project_ssh_keys; + } + + /** + * Optional. Set this field to `true` if you want Batch to block + * project-level SSH keys from accessing this job's VMs. Alternatively, you + * can configure the job to specify a VM instance template that blocks + * project-level SSH keys. In either case, Batch blocks project-level SSH + * keys while creating the VMs for this job. + * Batch allows project-level SSH keys for a job's VMs only if all + * the following are true: + * + This field is undefined or set to `false`. + * + The job's VM instance template (if any) doesn't block project-level + * SSH keys. + * Notably, you can override this behavior by manually updating a VM to + * block or allow project-level SSH keys. For more information about + * blocking project-level SSH keys, see the Compute Engine documentation: + * https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys + * + * Generated from protobuf field bool block_project_ssh_keys = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setBlockProjectSshKeys($var) + { + GPBUtil::checkBool($var); + $this->block_project_ssh_keys = $var; + + return $this; + } + + /** + * @return string + */ + public function getPolicyTemplate() + { + return $this->whichOneof("policy_template"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstancePolicyOrTemplate::class, \Google\Cloud\Batch\V1\AllocationPolicy_InstancePolicyOrTemplate::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/LocationPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/LocationPolicy.php new file mode 100644 index 000000000000..cb5fbeb79a66 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/LocationPolicy.php @@ -0,0 +1,112 @@ +google.cloud.batch.v1.AllocationPolicy.LocationPolicy + */ +class LocationPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * A list of allowed location names represented by internal URLs. + * Each location can be a region or a zone. + * Only one region or multiple zones in one region is supported now. + * For example, + * ["regions/us-central1"] allow VMs in any zones in region us-central1. + * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + * in zones us-central1-a and us-central1-c. + * Mixing locations from different regions would cause errors. + * For example, + * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + * "zones/us-west1-a"] contains locations from two distinct regions: + * us-central1 and us-west1. This combination will trigger an error. + * + * Generated from protobuf field repeated string allowed_locations = 1; + */ + private $allowed_locations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_locations + * A list of allowed location names represented by internal URLs. + * Each location can be a region or a zone. + * Only one region or multiple zones in one region is supported now. + * For example, + * ["regions/us-central1"] allow VMs in any zones in region us-central1. + * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + * in zones us-central1-a and us-central1-c. + * Mixing locations from different regions would cause errors. + * For example, + * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + * "zones/us-west1-a"] contains locations from two distinct regions: + * us-central1 and us-west1. This combination will trigger an error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * A list of allowed location names represented by internal URLs. + * Each location can be a region or a zone. + * Only one region or multiple zones in one region is supported now. + * For example, + * ["regions/us-central1"] allow VMs in any zones in region us-central1. + * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + * in zones us-central1-a and us-central1-c. + * Mixing locations from different regions would cause errors. + * For example, + * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + * "zones/us-west1-a"] contains locations from two distinct regions: + * us-central1 and us-west1. This combination will trigger an error. + * + * Generated from protobuf field repeated string allowed_locations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedLocations() + { + return $this->allowed_locations; + } + + /** + * A list of allowed location names represented by internal URLs. + * Each location can be a region or a zone. + * Only one region or multiple zones in one region is supported now. + * For example, + * ["regions/us-central1"] allow VMs in any zones in region us-central1. + * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + * in zones us-central1-a and us-central1-c. + * Mixing locations from different regions would cause errors. + * For example, + * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + * "zones/us-west1-a"] contains locations from two distinct regions: + * us-central1 and us-west1. This combination will trigger an error. + * + * Generated from protobuf field repeated string allowed_locations = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_locations = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LocationPolicy::class, \Google\Cloud\Batch\V1\AllocationPolicy_LocationPolicy::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkInterface.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkInterface.php new file mode 100644 index 000000000000..1c4b064ed7e0 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkInterface.php @@ -0,0 +1,202 @@ +google.cloud.batch.v1.AllocationPolicy.NetworkInterface + */ +class NetworkInterface extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of an existing network resource. + * You can specify the network as a full or partial URL. + * For example, the following are all valid URLs: + * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + * * projects/{project}/global/networks/{network} + * * global/networks/{network} + * + * Generated from protobuf field string network = 1; + */ + protected $network = ''; + /** + * The URL of an existing subnetwork resource in the network. + * You can specify the subnetwork as a full or partial URL. + * For example, the following are all valid URLs: + * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + * * projects/{project}/regions/{region}/subnetworks/{subnetwork} + * * regions/{region}/subnetworks/{subnetwork} + * + * Generated from protobuf field string subnetwork = 2; + */ + protected $subnetwork = ''; + /** + * Default is false (with an external IP address). Required if + * no external public IP address is attached to the VM. If no external + * public IP address, additional configuration is required to allow the VM + * to access Google Services. See + * https://cloud.google.com/vpc/docs/configure-private-google-access and + * https://cloud.google.com/nat/docs/gce-example#create-nat for more + * information. + * + * Generated from protobuf field bool no_external_ip_address = 3; + */ + protected $no_external_ip_address = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * The URL of an existing network resource. + * You can specify the network as a full or partial URL. + * For example, the following are all valid URLs: + * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + * * projects/{project}/global/networks/{network} + * * global/networks/{network} + * @type string $subnetwork + * The URL of an existing subnetwork resource in the network. + * You can specify the subnetwork as a full or partial URL. + * For example, the following are all valid URLs: + * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + * * projects/{project}/regions/{region}/subnetworks/{subnetwork} + * * regions/{region}/subnetworks/{subnetwork} + * @type bool $no_external_ip_address + * Default is false (with an external IP address). Required if + * no external public IP address is attached to the VM. If no external + * public IP address, additional configuration is required to allow the VM + * to access Google Services. See + * https://cloud.google.com/vpc/docs/configure-private-google-access and + * https://cloud.google.com/nat/docs/gce-example#create-nat for more + * information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The URL of an existing network resource. + * You can specify the network as a full or partial URL. + * For example, the following are all valid URLs: + * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + * * projects/{project}/global/networks/{network} + * * global/networks/{network} + * + * Generated from protobuf field string network = 1; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * The URL of an existing network resource. + * You can specify the network as a full or partial URL. + * For example, the following are all valid URLs: + * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + * * projects/{project}/global/networks/{network} + * * global/networks/{network} + * + * Generated from protobuf field string network = 1; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * The URL of an existing subnetwork resource in the network. + * You can specify the subnetwork as a full or partial URL. + * For example, the following are all valid URLs: + * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + * * projects/{project}/regions/{region}/subnetworks/{subnetwork} + * * regions/{region}/subnetworks/{subnetwork} + * + * Generated from protobuf field string subnetwork = 2; + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * The URL of an existing subnetwork resource in the network. + * You can specify the subnetwork as a full or partial URL. + * For example, the following are all valid URLs: + * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + * * projects/{project}/regions/{region}/subnetworks/{subnetwork} + * * regions/{region}/subnetworks/{subnetwork} + * + * Generated from protobuf field string subnetwork = 2; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * Default is false (with an external IP address). Required if + * no external public IP address is attached to the VM. If no external + * public IP address, additional configuration is required to allow the VM + * to access Google Services. See + * https://cloud.google.com/vpc/docs/configure-private-google-access and + * https://cloud.google.com/nat/docs/gce-example#create-nat for more + * information. + * + * Generated from protobuf field bool no_external_ip_address = 3; + * @return bool + */ + public function getNoExternalIpAddress() + { + return $this->no_external_ip_address; + } + + /** + * Default is false (with an external IP address). Required if + * no external public IP address is attached to the VM. If no external + * public IP address, additional configuration is required to allow the VM + * to access Google Services. See + * https://cloud.google.com/vpc/docs/configure-private-google-access and + * https://cloud.google.com/nat/docs/gce-example#create-nat for more + * information. + * + * Generated from protobuf field bool no_external_ip_address = 3; + * @param bool $var + * @return $this + */ + public function setNoExternalIpAddress($var) + { + GPBUtil::checkBool($var); + $this->no_external_ip_address = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkInterface::class, \Google\Cloud\Batch\V1\AllocationPolicy_NetworkInterface::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkPolicy.php new file mode 100644 index 000000000000..f402f3e8e3d2 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkPolicy.php @@ -0,0 +1,70 @@ +google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + */ +class NetworkPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Network configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + */ + private $network_interfaces; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * Network configurations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Network configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * Network configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\NetworkInterface::class); + $this->network_interfaces = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkPolicy::class, \Google\Cloud\Batch\V1\AllocationPolicy_NetworkPolicy::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/PlacementPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/PlacementPolicy.php new file mode 100644 index 000000000000..2b9777719d46 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/PlacementPolicy.php @@ -0,0 +1,133 @@ +google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + */ +class PlacementPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you + * want VMs to be located close to each other for low network latency + * between the VMs. No placement policy will be generated when collocation + * is UNSPECIFIED. + * + * Generated from protobuf field string collocation = 1; + */ + protected $collocation = ''; + /** + * When specified, causes the job to fail if more than max_distance logical + * switches are required between VMs. Batch uses the most compact possible + * placement of VMs even when max_distance is not specified. An explicit + * max_distance makes that level of compactness a strict requirement. + * Not yet implemented + * + * Generated from protobuf field int64 max_distance = 2; + */ + protected $max_distance = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $collocation + * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you + * want VMs to be located close to each other for low network latency + * between the VMs. No placement policy will be generated when collocation + * is UNSPECIFIED. + * @type int|string $max_distance + * When specified, causes the job to fail if more than max_distance logical + * switches are required between VMs. Batch uses the most compact possible + * placement of VMs even when max_distance is not specified. An explicit + * max_distance makes that level of compactness a strict requirement. + * Not yet implemented + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you + * want VMs to be located close to each other for low network latency + * between the VMs. No placement policy will be generated when collocation + * is UNSPECIFIED. + * + * Generated from protobuf field string collocation = 1; + * @return string + */ + public function getCollocation() + { + return $this->collocation; + } + + /** + * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you + * want VMs to be located close to each other for low network latency + * between the VMs. No placement policy will be generated when collocation + * is UNSPECIFIED. + * + * Generated from protobuf field string collocation = 1; + * @param string $var + * @return $this + */ + public function setCollocation($var) + { + GPBUtil::checkString($var, True); + $this->collocation = $var; + + return $this; + } + + /** + * When specified, causes the job to fail if more than max_distance logical + * switches are required between VMs. Batch uses the most compact possible + * placement of VMs even when max_distance is not specified. An explicit + * max_distance makes that level of compactness a strict requirement. + * Not yet implemented + * + * Generated from protobuf field int64 max_distance = 2; + * @return int|string + */ + public function getMaxDistance() + { + return $this->max_distance; + } + + /** + * When specified, causes the job to fail if more than max_distance logical + * switches are required between VMs. Batch uses the most compact possible + * placement of VMs even when max_distance is not specified. An explicit + * max_distance makes that level of compactness a strict requirement. + * Not yet implemented + * + * Generated from protobuf field int64 max_distance = 2; + * @param int|string $var + * @return $this + */ + public function setMaxDistance($var) + { + GPBUtil::checkInt64($var); + $this->max_distance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PlacementPolicy::class, \Google\Cloud\Batch\V1\AllocationPolicy_PlacementPolicy::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/ProvisioningModel.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/ProvisioningModel.php new file mode 100644 index 000000000000..62a6191c61cb --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/ProvisioningModel.php @@ -0,0 +1,75 @@ +google.cloud.batch.v1.AllocationPolicy.ProvisioningModel + */ +class ProvisioningModel +{ + /** + * Unspecified. + * + * Generated from protobuf enum PROVISIONING_MODEL_UNSPECIFIED = 0; + */ + const PROVISIONING_MODEL_UNSPECIFIED = 0; + /** + * Standard VM. + * + * Generated from protobuf enum STANDARD = 1; + */ + const STANDARD = 1; + /** + * SPOT VM. + * + * Generated from protobuf enum SPOT = 2; + */ + const SPOT = 2; + /** + * Preemptible VM (PVM). + * Above SPOT VM is the preferable model for preemptible VM instances: the + * old preemptible VM model (indicated by this field) is the older model, + * and has been migrated to use the SPOT model as the underlying technology. + * This old model will still be supported. + * + * Generated from protobuf enum PREEMPTIBLE = 3; + */ + const PREEMPTIBLE = 3; + + private static $valueToName = [ + self::PROVISIONING_MODEL_UNSPECIFIED => 'PROVISIONING_MODEL_UNSPECIFIED', + self::STANDARD => 'STANDARD', + self::SPOT => 'SPOT', + self::PREEMPTIBLE => 'PREEMPTIBLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProvisioningModel::class, \Google\Cloud\Batch\V1\AllocationPolicy_ProvisioningModel::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ComputeResource.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ComputeResource.php new file mode 100644 index 000000000000..71cfcd4d50f6 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ComputeResource.php @@ -0,0 +1,248 @@ +google.cloud.batch.v1.ComputeResource + */ +class ComputeResource extends \Google\Protobuf\Internal\Message +{ + /** + * The milliCPU count. + * `cpuMilli` defines the amount of CPU resources per task in milliCPU units. + * For example, `1000` corresponds to 1 vCPU per task. If undefined, the + * default value is `2000`. + * If you also define the VM's machine type using the `machineType` in + * [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + * field or inside the `instanceTemplate` in the + * [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + * field, make sure the CPU resources for both fields are compatible with each + * other and with how many tasks you want to allow to run on the same VM at + * the same time. + * For example, if you specify the `n2-standard-2` machine type, which has 2 + * vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or + * you are recommended to run two tasks on the same VM if you set `cpuMilli` + * to `1000` or less. + * + * Generated from protobuf field int64 cpu_milli = 1; + */ + protected $cpu_milli = 0; + /** + * Memory in MiB. + * `memoryMib` defines the amount of memory per task in MiB units. + * If undefined, the default value is `2000`. + * If you also define the VM's machine type using the `machineType` in + * [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + * field or inside the `instanceTemplate` in the + * [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + * field, make sure the memory resources for both fields are compatible with + * each other and with how many tasks you want to allow to run on the same VM + * at the same time. + * For example, if you specify the `n2-standard-2` machine type, which has 8 + * GiB each, you are recommended to set `memoryMib` to no more than `8192`, + * or you are recommended to run two tasks on the same VM if you set + * `memoryMib` to `4096` or less. + * + * Generated from protobuf field int64 memory_mib = 2; + */ + protected $memory_mib = 0; + /** + * Extra boot disk size in MiB for each task. + * + * Generated from protobuf field int64 boot_disk_mib = 4; + */ + protected $boot_disk_mib = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $cpu_milli + * The milliCPU count. + * `cpuMilli` defines the amount of CPU resources per task in milliCPU units. + * For example, `1000` corresponds to 1 vCPU per task. If undefined, the + * default value is `2000`. + * If you also define the VM's machine type using the `machineType` in + * [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + * field or inside the `instanceTemplate` in the + * [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + * field, make sure the CPU resources for both fields are compatible with each + * other and with how many tasks you want to allow to run on the same VM at + * the same time. + * For example, if you specify the `n2-standard-2` machine type, which has 2 + * vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or + * you are recommended to run two tasks on the same VM if you set `cpuMilli` + * to `1000` or less. + * @type int|string $memory_mib + * Memory in MiB. + * `memoryMib` defines the amount of memory per task in MiB units. + * If undefined, the default value is `2000`. + * If you also define the VM's machine type using the `machineType` in + * [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + * field or inside the `instanceTemplate` in the + * [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + * field, make sure the memory resources for both fields are compatible with + * each other and with how many tasks you want to allow to run on the same VM + * at the same time. + * For example, if you specify the `n2-standard-2` machine type, which has 8 + * GiB each, you are recommended to set `memoryMib` to no more than `8192`, + * or you are recommended to run two tasks on the same VM if you set + * `memoryMib` to `4096` or less. + * @type int|string $boot_disk_mib + * Extra boot disk size in MiB for each task. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * The milliCPU count. + * `cpuMilli` defines the amount of CPU resources per task in milliCPU units. + * For example, `1000` corresponds to 1 vCPU per task. If undefined, the + * default value is `2000`. + * If you also define the VM's machine type using the `machineType` in + * [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + * field or inside the `instanceTemplate` in the + * [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + * field, make sure the CPU resources for both fields are compatible with each + * other and with how many tasks you want to allow to run on the same VM at + * the same time. + * For example, if you specify the `n2-standard-2` machine type, which has 2 + * vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or + * you are recommended to run two tasks on the same VM if you set `cpuMilli` + * to `1000` or less. + * + * Generated from protobuf field int64 cpu_milli = 1; + * @return int|string + */ + public function getCpuMilli() + { + return $this->cpu_milli; + } + + /** + * The milliCPU count. + * `cpuMilli` defines the amount of CPU resources per task in milliCPU units. + * For example, `1000` corresponds to 1 vCPU per task. If undefined, the + * default value is `2000`. + * If you also define the VM's machine type using the `machineType` in + * [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + * field or inside the `instanceTemplate` in the + * [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + * field, make sure the CPU resources for both fields are compatible with each + * other and with how many tasks you want to allow to run on the same VM at + * the same time. + * For example, if you specify the `n2-standard-2` machine type, which has 2 + * vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or + * you are recommended to run two tasks on the same VM if you set `cpuMilli` + * to `1000` or less. + * + * Generated from protobuf field int64 cpu_milli = 1; + * @param int|string $var + * @return $this + */ + public function setCpuMilli($var) + { + GPBUtil::checkInt64($var); + $this->cpu_milli = $var; + + return $this; + } + + /** + * Memory in MiB. + * `memoryMib` defines the amount of memory per task in MiB units. + * If undefined, the default value is `2000`. + * If you also define the VM's machine type using the `machineType` in + * [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + * field or inside the `instanceTemplate` in the + * [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + * field, make sure the memory resources for both fields are compatible with + * each other and with how many tasks you want to allow to run on the same VM + * at the same time. + * For example, if you specify the `n2-standard-2` machine type, which has 8 + * GiB each, you are recommended to set `memoryMib` to no more than `8192`, + * or you are recommended to run two tasks on the same VM if you set + * `memoryMib` to `4096` or less. + * + * Generated from protobuf field int64 memory_mib = 2; + * @return int|string + */ + public function getMemoryMib() + { + return $this->memory_mib; + } + + /** + * Memory in MiB. + * `memoryMib` defines the amount of memory per task in MiB units. + * If undefined, the default value is `2000`. + * If you also define the VM's machine type using the `machineType` in + * [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + * field or inside the `instanceTemplate` in the + * [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + * field, make sure the memory resources for both fields are compatible with + * each other and with how many tasks you want to allow to run on the same VM + * at the same time. + * For example, if you specify the `n2-standard-2` machine type, which has 8 + * GiB each, you are recommended to set `memoryMib` to no more than `8192`, + * or you are recommended to run two tasks on the same VM if you set + * `memoryMib` to `4096` or less. + * + * Generated from protobuf field int64 memory_mib = 2; + * @param int|string $var + * @return $this + */ + public function setMemoryMib($var) + { + GPBUtil::checkInt64($var); + $this->memory_mib = $var; + + return $this; + } + + /** + * Extra boot disk size in MiB for each task. + * + * Generated from protobuf field int64 boot_disk_mib = 4; + * @return int|string + */ + public function getBootDiskMib() + { + return $this->boot_disk_mib; + } + + /** + * Extra boot disk size in MiB for each task. + * + * Generated from protobuf field int64 boot_disk_mib = 4; + * @param int|string $var + * @return $this + */ + public function setBootDiskMib($var) + { + GPBUtil::checkInt64($var); + $this->boot_disk_mib = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/CreateJobRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/CreateJobRequest.php new file mode 100644 index 000000000000..fdec8fae5402 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/CreateJobRequest.php @@ -0,0 +1,278 @@ +google.cloud.batch.v1.CreateJobRequest + */ +class CreateJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * + * Generated from protobuf field string job_id = 2; + */ + protected $job_id = ''; + /** + * Required. The Job to create. + * + * Generated from protobuf field .google.cloud.batch.v1.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $job = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * Please see {@see BatchServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Batch\V1\Job $job Required. The Job to create. + * @param string $jobId ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * + * @return \Google\Cloud\Batch\V1\CreateJobRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Batch\V1\Job $job, string $jobId): self + { + return (new self()) + ->setParent($parent) + ->setJob($job) + ->setJobId($jobId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * @type string $job_id + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * @type \Google\Cloud\Batch\V1\Job $job + * Required. The Job to create. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * + * Generated from protobuf field string job_id = 2; + * @return string + */ + public function getJobId() + { + return $this->job_id; + } + + /** + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * + * Generated from protobuf field string job_id = 2; + * @param string $var + * @return $this + */ + public function setJobId($var) + { + GPBUtil::checkString($var, True); + $this->job_id = $var; + + return $this; + } + + /** + * Required. The Job to create. + * + * Generated from protobuf field .google.cloud.batch.v1.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Batch\V1\Job|null + */ + public function getJob() + { + return $this->job; + } + + public function hasJob() + { + return isset($this->job); + } + + public function clearJob() + { + unset($this->job); + } + + /** + * Required. The Job to create. + * + * Generated from protobuf field .google.cloud.batch.v1.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Batch\V1\Job $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Job::class); + $this->job = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/DeleteJobRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/DeleteJobRequest.php new file mode 100644 index 000000000000..0acc2dfbbac6 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/DeleteJobRequest.php @@ -0,0 +1,188 @@ +google.cloud.batch.v1.DeleteJobRequest + */ +class DeleteJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Job name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Optional. Reason for this deletion. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $reason = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Job name. + * + * @return \Google\Cloud\Batch\V1\DeleteJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Job name. + * @type string $reason + * Optional. Reason for this deletion. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Job name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Job name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Reason for this deletion. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * Optional. Reason for this deletion. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment.php new file mode 100644 index 000000000000..058a8d4ccc90 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment.php @@ -0,0 +1,158 @@ +google.cloud.batch.v1.Environment + */ +class Environment extends \Google\Protobuf\Internal\Message +{ + /** + * A map of environment variable names to values. + * + * Generated from protobuf field map variables = 1; + */ + private $variables; + /** + * A map of environment variable names to Secret Manager secret names. + * The VM will access the named secrets to set the value of each environment + * variable. + * + * Generated from protobuf field map secret_variables = 2; + */ + private $secret_variables; + /** + * An encrypted JSON dictionary where the key/value pairs correspond to + * environment variable names and their values. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + */ + protected $encrypted_variables = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $variables + * A map of environment variable names to values. + * @type array|\Google\Protobuf\Internal\MapField $secret_variables + * A map of environment variable names to Secret Manager secret names. + * The VM will access the named secrets to set the value of each environment + * variable. + * @type \Google\Cloud\Batch\V1\Environment\KMSEnvMap $encrypted_variables + * An encrypted JSON dictionary where the key/value pairs correspond to + * environment variable names and their values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * A map of environment variable names to values. + * + * Generated from protobuf field map variables = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getVariables() + { + return $this->variables; + } + + /** + * A map of environment variable names to values. + * + * Generated from protobuf field map variables = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setVariables($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->variables = $arr; + + return $this; + } + + /** + * A map of environment variable names to Secret Manager secret names. + * The VM will access the named secrets to set the value of each environment + * variable. + * + * Generated from protobuf field map secret_variables = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getSecretVariables() + { + return $this->secret_variables; + } + + /** + * A map of environment variable names to Secret Manager secret names. + * The VM will access the named secrets to set the value of each environment + * variable. + * + * Generated from protobuf field map secret_variables = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setSecretVariables($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->secret_variables = $arr; + + return $this; + } + + /** + * An encrypted JSON dictionary where the key/value pairs correspond to + * environment variable names and their values. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + * @return \Google\Cloud\Batch\V1\Environment\KMSEnvMap|null + */ + public function getEncryptedVariables() + { + return $this->encrypted_variables; + } + + public function hasEncryptedVariables() + { + return isset($this->encrypted_variables); + } + + public function clearEncryptedVariables() + { + unset($this->encrypted_variables); + } + + /** + * An encrypted JSON dictionary where the key/value pairs correspond to + * environment variable names and their values. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + * @param \Google\Cloud\Batch\V1\Environment\KMSEnvMap $var + * @return $this + */ + public function setEncryptedVariables($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Environment\KMSEnvMap::class); + $this->encrypted_variables = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment/KMSEnvMap.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment/KMSEnvMap.php new file mode 100644 index 000000000000..91b995831e11 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment/KMSEnvMap.php @@ -0,0 +1,102 @@ +google.cloud.batch.v1.Environment.KMSEnvMap + */ +class KMSEnvMap extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the KMS key that will be used to decrypt the cipher text. + * + * Generated from protobuf field string key_name = 1; + */ + protected $key_name = ''; + /** + * The value of the cipherText response from the `encrypt` method. + * + * Generated from protobuf field string cipher_text = 2; + */ + protected $cipher_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key_name + * The name of the KMS key that will be used to decrypt the cipher text. + * @type string $cipher_text + * The value of the cipherText response from the `encrypt` method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * The name of the KMS key that will be used to decrypt the cipher text. + * + * Generated from protobuf field string key_name = 1; + * @return string + */ + public function getKeyName() + { + return $this->key_name; + } + + /** + * The name of the KMS key that will be used to decrypt the cipher text. + * + * Generated from protobuf field string key_name = 1; + * @param string $var + * @return $this + */ + public function setKeyName($var) + { + GPBUtil::checkString($var, True); + $this->key_name = $var; + + return $this; + } + + /** + * The value of the cipherText response from the `encrypt` method. + * + * Generated from protobuf field string cipher_text = 2; + * @return string + */ + public function getCipherText() + { + return $this->cipher_text; + } + + /** + * The value of the cipherText response from the `encrypt` method. + * + * Generated from protobuf field string cipher_text = 2; + * @param string $var + * @return $this + */ + public function setCipherText($var) + { + GPBUtil::checkString($var, True); + $this->cipher_text = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KMSEnvMap::class, \Google\Cloud\Batch\V1\Environment_KMSEnvMap::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GCS.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GCS.php new file mode 100644 index 000000000000..af7bffd938ba --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GCS.php @@ -0,0 +1,71 @@ +google.cloud.batch.v1.GCS + */ +class GCS extends \Google\Protobuf\Internal\Message +{ + /** + * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + * bucket_name, bucket_name/subdirectory/ + * + * Generated from protobuf field string remote_path = 1; + */ + protected $remote_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $remote_path + * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + * bucket_name, bucket_name/subdirectory/ + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Volume::initOnce(); + parent::__construct($data); + } + + /** + * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + * bucket_name, bucket_name/subdirectory/ + * + * Generated from protobuf field string remote_path = 1; + * @return string + */ + public function getRemotePath() + { + return $this->remote_path; + } + + /** + * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + * bucket_name, bucket_name/subdirectory/ + * + * Generated from protobuf field string remote_path = 1; + * @param string $var + * @return $this + */ + public function setRemotePath($var) + { + GPBUtil::checkString($var, True); + $this->remote_path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetJobRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetJobRequest.php new file mode 100644 index 000000000000..ae27090d4139 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetJobRequest.php @@ -0,0 +1,81 @@ +google.cloud.batch.v1.GetJobRequest + */ +class GetJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Job name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Job name. Please see + * {@see BatchServiceClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Batch\V1\GetJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Job name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Required. Job name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Job name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetTaskRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetTaskRequest.php new file mode 100644 index 000000000000..6271a4460bce --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetTaskRequest.php @@ -0,0 +1,81 @@ +google.cloud.batch.v1.GetTaskRequest + */ +class GetTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Task name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Task name. Please see + * {@see BatchServiceClient::taskName()} for help formatting this field. + * + * @return \Google\Cloud\Batch\V1\GetTaskRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Task name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Required. Task name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Task name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Job.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Job.php new file mode 100644 index 000000000000..da2fd8861353 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Job.php @@ -0,0 +1,517 @@ +google.cloud.batch.v1.Job + */ +class Job extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Job name. + * For example: "projects/123456/locations/us-central1/jobs/job01". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. A system generated unique ID for the Job. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Priority of the Job. + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. + * A job with higher priority value is more likely to run earlier if all other + * requirements are satisfied. + * + * Generated from protobuf field int64 priority = 3; + */ + protected $priority = 0; + /** + * Required. TaskGroups in the Job. Only one TaskGroup is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $task_groups; + /** + * Compute resource allocation for all TaskGroups in the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + */ + protected $allocation_policy = null; + /** + * Custom labels to apply to the job and any Cloud Logging + * [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) + * that it generates. + * Use labels to group and describe the resources they are applied to. Batch + * automatically applies predefined labels and supports multiple `labels` + * fields for each job, which each let you apply custom labels to various + * resources. Label names that start with "goog-" or "google-" are + * reserved for predefined labels. For more information about labels with + * Batch, see + * [Organize resources using + * labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + * + * Generated from protobuf field map labels = 8; + */ + private $labels; + /** + * Output only. Job status. It is read only for users. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = null; + /** + * Output only. When the Job was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last time the Job was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Log preservation policy for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy logs_policy = 13; + */ + protected $logs_policy = null; + /** + * Notification configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobNotification notifications = 14; + */ + private $notifications; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Job name. + * For example: "projects/123456/locations/us-central1/jobs/job01". + * @type string $uid + * Output only. A system generated unique ID for the Job. + * @type int|string $priority + * Priority of the Job. + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. + * A job with higher priority value is more likely to run earlier if all other + * requirements are satisfied. + * @type array<\Google\Cloud\Batch\V1\TaskGroup>|\Google\Protobuf\Internal\RepeatedField $task_groups + * Required. TaskGroups in the Job. Only one TaskGroup is supported now. + * @type \Google\Cloud\Batch\V1\AllocationPolicy $allocation_policy + * Compute resource allocation for all TaskGroups in the Job. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Custom labels to apply to the job and any Cloud Logging + * [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) + * that it generates. + * Use labels to group and describe the resources they are applied to. Batch + * automatically applies predefined labels and supports multiple `labels` + * fields for each job, which each let you apply custom labels to various + * resources. Label names that start with "goog-" or "google-" are + * reserved for predefined labels. For more information about labels with + * Batch, see + * [Organize resources using + * labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + * @type \Google\Cloud\Batch\V1\JobStatus $status + * Output only. Job status. It is read only for users. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. When the Job was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last time the Job was updated. + * @type \Google\Cloud\Batch\V1\LogsPolicy $logs_policy + * Log preservation policy for the Job. + * @type array<\Google\Cloud\Batch\V1\JobNotification>|\Google\Protobuf\Internal\RepeatedField $notifications + * Notification configurations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Job name. + * For example: "projects/123456/locations/us-central1/jobs/job01". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Job name. + * For example: "projects/123456/locations/us-central1/jobs/job01". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. A system generated unique ID for the Job. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A system generated unique ID for the Job. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Priority of the Job. + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. + * A job with higher priority value is more likely to run earlier if all other + * requirements are satisfied. + * + * Generated from protobuf field int64 priority = 3; + * @return int|string + */ + public function getPriority() + { + return $this->priority; + } + + /** + * Priority of the Job. + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. + * A job with higher priority value is more likely to run earlier if all other + * requirements are satisfied. + * + * Generated from protobuf field int64 priority = 3; + * @param int|string $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt64($var); + $this->priority = $var; + + return $this; + } + + /** + * Required. TaskGroups in the Job. Only one TaskGroup is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTaskGroups() + { + return $this->task_groups; + } + + /** + * Required. TaskGroups in the Job. Only one TaskGroup is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Batch\V1\TaskGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTaskGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\TaskGroup::class); + $this->task_groups = $arr; + + return $this; + } + + /** + * Compute resource allocation for all TaskGroups in the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + * @return \Google\Cloud\Batch\V1\AllocationPolicy|null + */ + public function getAllocationPolicy() + { + return $this->allocation_policy; + } + + public function hasAllocationPolicy() + { + return isset($this->allocation_policy); + } + + public function clearAllocationPolicy() + { + unset($this->allocation_policy); + } + + /** + * Compute resource allocation for all TaskGroups in the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + * @param \Google\Cloud\Batch\V1\AllocationPolicy $var + * @return $this + */ + public function setAllocationPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy::class); + $this->allocation_policy = $var; + + return $this; + } + + /** + * Custom labels to apply to the job and any Cloud Logging + * [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) + * that it generates. + * Use labels to group and describe the resources they are applied to. Batch + * automatically applies predefined labels and supports multiple `labels` + * fields for each job, which each let you apply custom labels to various + * resources. Label names that start with "goog-" or "google-" are + * reserved for predefined labels. For more information about labels with + * Batch, see + * [Organize resources using + * labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + * + * Generated from protobuf field map labels = 8; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Custom labels to apply to the job and any Cloud Logging + * [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) + * that it generates. + * Use labels to group and describe the resources they are applied to. Batch + * automatically applies predefined labels and supports multiple `labels` + * fields for each job, which each let you apply custom labels to various + * resources. Label names that start with "goog-" or "google-" are + * reserved for predefined labels. For more information about labels with + * Batch, see + * [Organize resources using + * labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + * + * Generated from protobuf field map labels = 8; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Job status. It is read only for users. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Batch\V1\JobStatus|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Output only. Job status. It is read only for users. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Batch\V1\JobStatus $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\JobStatus::class); + $this->status = $var; + + return $this; + } + + /** + * Output only. When the Job was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. When the Job was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last time the Job was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last time the Job was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Log preservation policy for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy logs_policy = 13; + * @return \Google\Cloud\Batch\V1\LogsPolicy|null + */ + public function getLogsPolicy() + { + return $this->logs_policy; + } + + public function hasLogsPolicy() + { + return isset($this->logs_policy); + } + + public function clearLogsPolicy() + { + unset($this->logs_policy); + } + + /** + * Log preservation policy for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy logs_policy = 13; + * @param \Google\Cloud\Batch\V1\LogsPolicy $var + * @return $this + */ + public function setLogsPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\LogsPolicy::class); + $this->logs_policy = $var; + + return $this; + } + + /** + * Notification configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobNotification notifications = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotifications() + { + return $this->notifications; + } + + /** + * Notification configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobNotification notifications = 14; + * @param array<\Google\Cloud\Batch\V1\JobNotification>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotifications($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\JobNotification::class); + $this->notifications = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification.php new file mode 100644 index 000000000000..a84bc5653ad3 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification.php @@ -0,0 +1,155 @@ +google.cloud.batch.v1.JobNotification + */ +class JobNotification extends \Google\Protobuf\Internal\Message +{ + /** + * The Pub/Sub topic where notifications for the job, like state + * changes, will be published. If undefined, no Pub/Sub notifications + * are sent for this job. + * Specify the topic using the following format: + * `projects/{project}/topics/{topic}`. + * Notably, if you want to specify a Pub/Sub topic that is in a + * different project than the job, your administrator must grant your + * project's Batch service agent permission to publish to that topic. + * For more information about configuring Pub/Sub notifications for + * a job, see + * https://cloud.google.com/batch/docs/enable-notifications. + * + * Generated from protobuf field string pubsub_topic = 1; + */ + protected $pubsub_topic = ''; + /** + * The attribute requirements of messages to be sent to this Pub/Sub topic. + * Without this field, no message will be sent. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Message message = 2; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $pubsub_topic + * The Pub/Sub topic where notifications for the job, like state + * changes, will be published. If undefined, no Pub/Sub notifications + * are sent for this job. + * Specify the topic using the following format: + * `projects/{project}/topics/{topic}`. + * Notably, if you want to specify a Pub/Sub topic that is in a + * different project than the job, your administrator must grant your + * project's Batch service agent permission to publish to that topic. + * For more information about configuring Pub/Sub notifications for + * a job, see + * https://cloud.google.com/batch/docs/enable-notifications. + * @type \Google\Cloud\Batch\V1\JobNotification\Message $message + * The attribute requirements of messages to be sent to this Pub/Sub topic. + * Without this field, no message will be sent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The Pub/Sub topic where notifications for the job, like state + * changes, will be published. If undefined, no Pub/Sub notifications + * are sent for this job. + * Specify the topic using the following format: + * `projects/{project}/topics/{topic}`. + * Notably, if you want to specify a Pub/Sub topic that is in a + * different project than the job, your administrator must grant your + * project's Batch service agent permission to publish to that topic. + * For more information about configuring Pub/Sub notifications for + * a job, see + * https://cloud.google.com/batch/docs/enable-notifications. + * + * Generated from protobuf field string pubsub_topic = 1; + * @return string + */ + public function getPubsubTopic() + { + return $this->pubsub_topic; + } + + /** + * The Pub/Sub topic where notifications for the job, like state + * changes, will be published. If undefined, no Pub/Sub notifications + * are sent for this job. + * Specify the topic using the following format: + * `projects/{project}/topics/{topic}`. + * Notably, if you want to specify a Pub/Sub topic that is in a + * different project than the job, your administrator must grant your + * project's Batch service agent permission to publish to that topic. + * For more information about configuring Pub/Sub notifications for + * a job, see + * https://cloud.google.com/batch/docs/enable-notifications. + * + * Generated from protobuf field string pubsub_topic = 1; + * @param string $var + * @return $this + */ + public function setPubsubTopic($var) + { + GPBUtil::checkString($var, True); + $this->pubsub_topic = $var; + + return $this; + } + + /** + * The attribute requirements of messages to be sent to this Pub/Sub topic. + * Without this field, no message will be sent. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Message message = 2; + * @return \Google\Cloud\Batch\V1\JobNotification\Message|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * The attribute requirements of messages to be sent to this Pub/Sub topic. + * Without this field, no message will be sent. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Message message = 2; + * @param \Google\Cloud\Batch\V1\JobNotification\Message $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\JobNotification\Message::class); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Message.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Message.php new file mode 100644 index 000000000000..2dc572817132 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Message.php @@ -0,0 +1,144 @@ +google.cloud.batch.v1.JobNotification.Message + */ +class Message extends \Google\Protobuf\Internal\Message +{ + /** + * The message type. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Type type = 1; + */ + protected $type = 0; + /** + * The new job state. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State new_job_state = 2; + */ + protected $new_job_state = 0; + /** + * The new task state. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State new_task_state = 3; + */ + protected $new_task_state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The message type. + * @type int $new_job_state + * The new job state. + * @type int $new_task_state + * The new task state. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The message type. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The message type. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\JobNotification\Type::class); + $this->type = $var; + + return $this; + } + + /** + * The new job state. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State new_job_state = 2; + * @return int + */ + public function getNewJobState() + { + return $this->new_job_state; + } + + /** + * The new job state. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State new_job_state = 2; + * @param int $var + * @return $this + */ + public function setNewJobState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\JobStatus\State::class); + $this->new_job_state = $var; + + return $this; + } + + /** + * The new task state. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State new_task_state = 3; + * @return int + */ + public function getNewTaskState() + { + return $this->new_task_state; + } + + /** + * The new task state. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State new_task_state = 3; + * @param int $var + * @return $this + */ + public function setNewTaskState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\TaskStatus\State::class); + $this->new_task_state = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Message::class, \Google\Cloud\Batch\V1\JobNotification_Message::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Type.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Type.php new file mode 100644 index 000000000000..28ccf868f4c0 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Type.php @@ -0,0 +1,64 @@ +google.cloud.batch.v1.JobNotification.Type + */ +class Type +{ + /** + * Unspecified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Notify users that the job state has changed. + * + * Generated from protobuf enum JOB_STATE_CHANGED = 1; + */ + const JOB_STATE_CHANGED = 1; + /** + * Notify users that the task state has changed. + * + * Generated from protobuf enum TASK_STATE_CHANGED = 2; + */ + const TASK_STATE_CHANGED = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::JOB_STATE_CHANGED => 'JOB_STATE_CHANGED', + self::TASK_STATE_CHANGED => 'TASK_STATE_CHANGED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Batch\V1\JobNotification_Type::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus.php new file mode 100644 index 000000000000..44e61d9713b6 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus.php @@ -0,0 +1,183 @@ +google.cloud.batch.v1.JobStatus + */ +class JobStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Job state + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State state = 1; + */ + protected $state = 0; + /** + * Job status events + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + */ + private $status_events; + /** + * Aggregated task status for each TaskGroup in the Job. + * The map key is TaskGroup ID. + * + * Generated from protobuf field map task_groups = 4; + */ + private $task_groups; + /** + * The duration of time that the Job spent in status RUNNING. + * + * Generated from protobuf field .google.protobuf.Duration run_duration = 5; + */ + protected $run_duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Job state + * @type array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $status_events + * Job status events + * @type array|\Google\Protobuf\Internal\MapField $task_groups + * Aggregated task status for each TaskGroup in the Job. + * The map key is TaskGroup ID. + * @type \Google\Protobuf\Duration $run_duration + * The duration of time that the Job spent in status RUNNING. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Job state + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Job state + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\JobStatus\State::class); + $this->state = $var; + + return $this; + } + + /** + * Job status events + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStatusEvents() + { + return $this->status_events; + } + + /** + * Job status events + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + * @param array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStatusEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\StatusEvent::class); + $this->status_events = $arr; + + return $this; + } + + /** + * Aggregated task status for each TaskGroup in the Job. + * The map key is TaskGroup ID. + * + * Generated from protobuf field map task_groups = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTaskGroups() + { + return $this->task_groups; + } + + /** + * Aggregated task status for each TaskGroup in the Job. + * The map key is TaskGroup ID. + * + * Generated from protobuf field map task_groups = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTaskGroups($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\JobStatus\TaskGroupStatus::class); + $this->task_groups = $arr; + + return $this; + } + + /** + * The duration of time that the Job spent in status RUNNING. + * + * Generated from protobuf field .google.protobuf.Duration run_duration = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getRunDuration() + { + return $this->run_duration; + } + + public function hasRunDuration() + { + return isset($this->run_duration); + } + + public function clearRunDuration() + { + unset($this->run_duration); + } + + /** + * The duration of time that the Job spent in status RUNNING. + * + * Generated from protobuf field .google.protobuf.Duration run_duration = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRunDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->run_duration = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/InstanceStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/InstanceStatus.php new file mode 100644 index 000000000000..4073a44ab3bc --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/InstanceStatus.php @@ -0,0 +1,182 @@ +google.cloud.batch.v1.JobStatus.InstanceStatus + */ +class InstanceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 1; + */ + protected $machine_type = ''; + /** + * The VM instance provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + */ + protected $provisioning_model = 0; + /** + * The max number of tasks can be assigned to this instance type. + * + * Generated from protobuf field int64 task_pack = 3; + */ + protected $task_pack = 0; + /** + * The VM boot disk. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + */ + protected $boot_disk = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $machine_type + * The Compute Engine machine type. + * @type int $provisioning_model + * The VM instance provisioning model. + * @type int|string $task_pack + * The max number of tasks can be assigned to this instance type. + * @type \Google\Cloud\Batch\V1\AllocationPolicy\Disk $boot_disk + * The VM boot disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 1; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 1; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * The VM instance provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * @return int + */ + public function getProvisioningModel() + { + return $this->provisioning_model; + } + + /** + * The VM instance provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * @param int $var + * @return $this + */ + public function setProvisioningModel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\AllocationPolicy\ProvisioningModel::class); + $this->provisioning_model = $var; + + return $this; + } + + /** + * The max number of tasks can be assigned to this instance type. + * + * Generated from protobuf field int64 task_pack = 3; + * @return int|string + */ + public function getTaskPack() + { + return $this->task_pack; + } + + /** + * The max number of tasks can be assigned to this instance type. + * + * Generated from protobuf field int64 task_pack = 3; + * @param int|string $var + * @return $this + */ + public function setTaskPack($var) + { + GPBUtil::checkInt64($var); + $this->task_pack = $var; + + return $this; + } + + /** + * The VM boot disk. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\Disk|null + */ + public function getBootDisk() + { + return $this->boot_disk; + } + + public function hasBootDisk() + { + return isset($this->boot_disk); + } + + public function clearBootDisk() + { + unset($this->boot_disk); + } + + /** + * The VM boot disk. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\Disk $var + * @return $this + */ + public function setBootDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\Disk::class); + $this->boot_disk = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstanceStatus::class, \Google\Cloud\Batch\V1\JobStatus_InstanceStatus::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/State.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/State.php new file mode 100644 index 000000000000..88b1b714c63f --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/State.php @@ -0,0 +1,96 @@ +google.cloud.batch.v1.JobStatus.State + */ +class State +{ + /** + * Job state unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Job is admitted (validated and persisted) and waiting for resources. + * + * Generated from protobuf enum QUEUED = 1; + */ + const QUEUED = 1; + /** + * Job is scheduled to run as soon as resource allocation is ready. + * The resource allocation may happen at a later time but with a high + * chance to succeed. + * + * Generated from protobuf enum SCHEDULED = 2; + */ + const SCHEDULED = 2; + /** + * Resource allocation has been successful. At least one Task in the Job is + * RUNNING. + * + * Generated from protobuf enum RUNNING = 3; + */ + const RUNNING = 3; + /** + * All Tasks in the Job have finished successfully. + * + * Generated from protobuf enum SUCCEEDED = 4; + */ + const SUCCEEDED = 4; + /** + * At least one Task in the Job has failed. + * + * Generated from protobuf enum FAILED = 5; + */ + const FAILED = 5; + /** + * The Job will be deleted, but has not been deleted yet. Typically this is + * because resources used by the Job are still being cleaned up. + * + * Generated from protobuf enum DELETION_IN_PROGRESS = 6; + */ + const DELETION_IN_PROGRESS = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::QUEUED => 'QUEUED', + self::SCHEDULED => 'SCHEDULED', + self::RUNNING => 'RUNNING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::DELETION_IN_PROGRESS => 'DELETION_IN_PROGRESS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Batch\V1\JobStatus_State::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/TaskGroupStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/TaskGroupStatus.php new file mode 100644 index 000000000000..54e870456e18 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/TaskGroupStatus.php @@ -0,0 +1,108 @@ +google.cloud.batch.v1.JobStatus.TaskGroupStatus + */ +class TaskGroupStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Count of task in each state in the TaskGroup. + * The map key is task state name. + * + * Generated from protobuf field map counts = 1; + */ + private $counts; + /** + * Status of instances allocated for the TaskGroup. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $counts + * Count of task in each state in the TaskGroup. + * The map key is task state name. + * @type array<\Google\Cloud\Batch\V1\JobStatus\InstanceStatus>|\Google\Protobuf\Internal\RepeatedField $instances + * Status of instances allocated for the TaskGroup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Count of task in each state in the TaskGroup. + * The map key is task state name. + * + * Generated from protobuf field map counts = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getCounts() + { + return $this->counts; + } + + /** + * Count of task in each state in the TaskGroup. + * The map key is task state name. + * + * Generated from protobuf field map counts = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setCounts($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::INT64); + $this->counts = $arr; + + return $this; + } + + /** + * Status of instances allocated for the TaskGroup. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Status of instances allocated for the TaskGroup. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + * @param array<\Google\Cloud\Batch\V1\JobStatus\InstanceStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\JobStatus\InstanceStatus::class); + $this->instances = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TaskGroupStatus::class, \Google\Cloud\Batch\V1\JobStatus_TaskGroupStatus::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy.php new file mode 100644 index 000000000000..50bf332faf2d --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy.php @@ -0,0 +1,128 @@ +google.cloud.batch.v1.LifecyclePolicy + */ +class LifecyclePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; + */ + protected $action = 0; + /** + * Conditions that decide why a task failure is dealt with a specific action. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + */ + protected $action_condition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $action + * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. + * @type \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition $action_condition + * Conditions that decide why a task failure is dealt with a specific action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; + * @return int + */ + public function getAction() + { + return $this->action; + } + + /** + * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; + * @param int $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\LifecyclePolicy\Action::class); + $this->action = $var; + + return $this; + } + + /** + * Conditions that decide why a task failure is dealt with a specific action. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * @return \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition|null + */ + public function getActionCondition() + { + return $this->action_condition; + } + + public function hasActionCondition() + { + return isset($this->action_condition); + } + + public function clearActionCondition() + { + unset($this->action_condition); + } + + /** + * Conditions that decide why a task failure is dealt with a specific action. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * @param \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition $var + * @return $this + */ + public function setActionCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition::class); + $this->action_condition = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/Action.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/Action.php new file mode 100644 index 000000000000..08419071bb67 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/Action.php @@ -0,0 +1,64 @@ +google.cloud.batch.v1.LifecyclePolicy.Action + */ +class Action +{ + /** + * Action unspecified. + * + * Generated from protobuf enum ACTION_UNSPECIFIED = 0; + */ + const ACTION_UNSPECIFIED = 0; + /** + * Action that tasks in the group will be scheduled to re-execute. + * + * Generated from protobuf enum RETRY_TASK = 1; + */ + const RETRY_TASK = 1; + /** + * Action that tasks in the group will be stopped immediately. + * + * Generated from protobuf enum FAIL_TASK = 2; + */ + const FAIL_TASK = 2; + + private static $valueToName = [ + self::ACTION_UNSPECIFIED => 'ACTION_UNSPECIFIED', + self::RETRY_TASK => 'RETRY_TASK', + self::FAIL_TASK => 'FAIL_TASK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Action::class, \Google\Cloud\Batch\V1\LifecyclePolicy_Action::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/ActionCondition.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/ActionCondition.php new file mode 100644 index 000000000000..acffa97a9300 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/ActionCondition.php @@ -0,0 +1,82 @@ +google.cloud.batch.v1.LifecyclePolicy.ActionCondition + */ +class ActionCondition extends \Google\Protobuf\Internal\Message +{ + /** + * Exit codes of a task execution. + * If there are more than 1 exit codes, + * when task executes with any of the exit code in the list, + * the condition is met and the action will be executed. + * + * Generated from protobuf field repeated int32 exit_codes = 1; + */ + private $exit_codes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $exit_codes + * Exit codes of a task execution. + * If there are more than 1 exit codes, + * when task executes with any of the exit code in the list, + * the condition is met and the action will be executed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Exit codes of a task execution. + * If there are more than 1 exit codes, + * when task executes with any of the exit code in the list, + * the condition is met and the action will be executed. + * + * Generated from protobuf field repeated int32 exit_codes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExitCodes() + { + return $this->exit_codes; + } + + /** + * Exit codes of a task execution. + * If there are more than 1 exit codes, + * when task executes with any of the exit code in the list, + * the condition is met and the action will be executed. + * + * Generated from protobuf field repeated int32 exit_codes = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExitCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->exit_codes = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ActionCondition::class, \Google\Cloud\Batch\V1\LifecyclePolicy_ActionCondition::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsRequest.php new file mode 100644 index 000000000000..172ee92ea293 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsRequest.php @@ -0,0 +1,220 @@ +google.cloud.batch.v1.ListJobsRequest + */ +class ListJobsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Parent path. + * + * Generated from protobuf field string parent = 1; + */ + protected $parent = ''; + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Parent path. + * + * @return \Google\Cloud\Batch\V1\ListJobsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Parent path. + * @type string $filter + * List filter. + * @type string $order_by + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @type int $page_size + * Page size. + * @type string $page_token + * Page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Parent path. + * + * Generated from protobuf field string parent = 1; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Parent path. + * + * Generated from protobuf field string parent = 1; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsResponse.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsResponse.php new file mode 100644 index 000000000000..9874dbeed530 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsResponse.php @@ -0,0 +1,135 @@ +google.cloud.batch.v1.ListJobsResponse + */ +class ListJobsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Jobs. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Job jobs = 1; + */ + private $jobs; + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Batch\V1\Job>|\Google\Protobuf\Internal\RepeatedField $jobs + * Jobs. + * @type string $next_page_token + * Next page token. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Jobs. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Job jobs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getJobs() + { + return $this->jobs; + } + + /** + * Jobs. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Job jobs = 1; + * @param array<\Google\Cloud\Batch\V1\Job>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setJobs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Job::class); + $this->jobs = $arr; + + return $this; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksRequest.php new file mode 100644 index 000000000000..bd42658dcae9 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksRequest.php @@ -0,0 +1,201 @@ +google.cloud.batch.v1.ListTasksRequest + */ +class ListTasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * Page token. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * Please see {@see BatchServiceClient::taskGroupName()} for help formatting this field. + * + * @return \Google\Cloud\Batch\V1\ListTasksRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @type string $filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @type int $page_size + * Page size. + * @type string $page_token + * Page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksResponse.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksResponse.php new file mode 100644 index 000000000000..7209c2e30a9f --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksResponse.php @@ -0,0 +1,135 @@ +google.cloud.batch.v1.ListTasksResponse + */ +class ListTasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Tasks. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Task tasks = 1; + */ + private $tasks; + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Batch\V1\Task>|\Google\Protobuf\Internal\RepeatedField $tasks + * Tasks. + * @type string $next_page_token + * Next page token. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Tasks. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Task tasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * Tasks. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Task tasks = 1; + * @param array<\Google\Cloud\Batch\V1\Task>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Task::class); + $this->tasks = $arr; + + return $this; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy.php new file mode 100644 index 000000000000..f4f1e486ddb7 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy.php @@ -0,0 +1,180 @@ +google.cloud.batch.v1.LogsPolicy + */ +class LogsPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * If and where logs should be saved. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.Destination destination = 1; + */ + protected $destination = 0; + /** + * When `destination` is set to `PATH`, you must set this field to the path + * where you want logs to be saved. This path can point to a local directory + * on the VM or (if congifured) a directory under the mount path of any + * Cloud Storage bucket, network file system (NFS), or writable persistent + * disk that is mounted to the job. For example, if the job has a bucket with + * `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the + * root directory of the `remotePath` of that bucket by setting this field to + * `/mnt/disks/my-bucket/`. + * + * Generated from protobuf field string logs_path = 2; + */ + protected $logs_path = ''; + /** + * Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally + * set this field to configure additional settings for Cloud Logging. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.CloudLoggingOption cloud_logging_option = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cloud_logging_option = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $destination + * If and where logs should be saved. + * @type string $logs_path + * When `destination` is set to `PATH`, you must set this field to the path + * where you want logs to be saved. This path can point to a local directory + * on the VM or (if congifured) a directory under the mount path of any + * Cloud Storage bucket, network file system (NFS), or writable persistent + * disk that is mounted to the job. For example, if the job has a bucket with + * `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the + * root directory of the `remotePath` of that bucket by setting this field to + * `/mnt/disks/my-bucket/`. + * @type \Google\Cloud\Batch\V1\LogsPolicy\CloudLoggingOption $cloud_logging_option + * Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally + * set this field to configure additional settings for Cloud Logging. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * If and where logs should be saved. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.Destination destination = 1; + * @return int + */ + public function getDestination() + { + return $this->destination; + } + + /** + * If and where logs should be saved. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.Destination destination = 1; + * @param int $var + * @return $this + */ + public function setDestination($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\LogsPolicy\Destination::class); + $this->destination = $var; + + return $this; + } + + /** + * When `destination` is set to `PATH`, you must set this field to the path + * where you want logs to be saved. This path can point to a local directory + * on the VM or (if congifured) a directory under the mount path of any + * Cloud Storage bucket, network file system (NFS), or writable persistent + * disk that is mounted to the job. For example, if the job has a bucket with + * `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the + * root directory of the `remotePath` of that bucket by setting this field to + * `/mnt/disks/my-bucket/`. + * + * Generated from protobuf field string logs_path = 2; + * @return string + */ + public function getLogsPath() + { + return $this->logs_path; + } + + /** + * When `destination` is set to `PATH`, you must set this field to the path + * where you want logs to be saved. This path can point to a local directory + * on the VM or (if congifured) a directory under the mount path of any + * Cloud Storage bucket, network file system (NFS), or writable persistent + * disk that is mounted to the job. For example, if the job has a bucket with + * `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the + * root directory of the `remotePath` of that bucket by setting this field to + * `/mnt/disks/my-bucket/`. + * + * Generated from protobuf field string logs_path = 2; + * @param string $var + * @return $this + */ + public function setLogsPath($var) + { + GPBUtil::checkString($var, True); + $this->logs_path = $var; + + return $this; + } + + /** + * Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally + * set this field to configure additional settings for Cloud Logging. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.CloudLoggingOption cloud_logging_option = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Batch\V1\LogsPolicy\CloudLoggingOption|null + */ + public function getCloudLoggingOption() + { + return $this->cloud_logging_option; + } + + public function hasCloudLoggingOption() + { + return isset($this->cloud_logging_option); + } + + public function clearCloudLoggingOption() + { + unset($this->cloud_logging_option); + } + + /** + * Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally + * set this field to configure additional settings for Cloud Logging. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.CloudLoggingOption cloud_logging_option = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Batch\V1\LogsPolicy\CloudLoggingOption $var + * @return $this + */ + public function setCloudLoggingOption($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\LogsPolicy\CloudLoggingOption::class); + $this->cloud_logging_option = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/CloudLoggingOption.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/CloudLoggingOption.php new file mode 100644 index 000000000000..1b0d72d65c64 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/CloudLoggingOption.php @@ -0,0 +1,99 @@ +google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + */ +class CloudLoggingOption extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Set this field to `true` to change the [monitored resource + * type](https://cloud.google.com/monitoring/api/resources) for + * Cloud Logging logs generated by this Batch job from + * the + * [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) + * type to the formerly used + * [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) + * type. + * + * Generated from protobuf field bool use_generic_task_monitored_resource = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $use_generic_task_monitored_resource = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $use_generic_task_monitored_resource + * Optional. Set this field to `true` to change the [monitored resource + * type](https://cloud.google.com/monitoring/api/resources) for + * Cloud Logging logs generated by this Batch job from + * the + * [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) + * type to the formerly used + * [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) + * type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Set this field to `true` to change the [monitored resource + * type](https://cloud.google.com/monitoring/api/resources) for + * Cloud Logging logs generated by this Batch job from + * the + * [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) + * type to the formerly used + * [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) + * type. + * + * Generated from protobuf field bool use_generic_task_monitored_resource = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUseGenericTaskMonitoredResource() + { + return $this->use_generic_task_monitored_resource; + } + + /** + * Optional. Set this field to `true` to change the [monitored resource + * type](https://cloud.google.com/monitoring/api/resources) for + * Cloud Logging logs generated by this Batch job from + * the + * [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) + * type to the formerly used + * [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) + * type. + * + * Generated from protobuf field bool use_generic_task_monitored_resource = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUseGenericTaskMonitoredResource($var) + { + GPBUtil::checkBool($var); + $this->use_generic_task_monitored_resource = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CloudLoggingOption::class, \Google\Cloud\Batch\V1\LogsPolicy_CloudLoggingOption::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/Destination.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/Destination.php new file mode 100644 index 000000000000..5c8894c8e3e4 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/Destination.php @@ -0,0 +1,65 @@ +google.cloud.batch.v1.LogsPolicy.Destination + */ +class Destination +{ + /** + * (Default) Logs are not preserved. + * + * Generated from protobuf enum DESTINATION_UNSPECIFIED = 0; + */ + const DESTINATION_UNSPECIFIED = 0; + /** + * Logs are streamed to Cloud Logging. Optionally, you can configure + * additional settings in the `cloudLoggingOption` field. + * + * Generated from protobuf enum CLOUD_LOGGING = 1; + */ + const CLOUD_LOGGING = 1; + /** + * Logs are saved to the file path specified in the `logsPath` field. + * + * Generated from protobuf enum PATH = 2; + */ + const PATH = 2; + + private static $valueToName = [ + self::DESTINATION_UNSPECIFIED => 'DESTINATION_UNSPECIFIED', + self::CLOUD_LOGGING => 'CLOUD_LOGGING', + self::PATH => 'PATH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Destination::class, \Google\Cloud\Batch\V1\LogsPolicy_Destination::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/NFS.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/NFS.php new file mode 100644 index 000000000000..b4c6e4bb1506 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/NFS.php @@ -0,0 +1,101 @@ +google.cloud.batch.v1.NFS + */ +class NFS extends \Google\Protobuf\Internal\Message +{ + /** + * The IP address of the NFS. + * + * Generated from protobuf field string server = 1; + */ + protected $server = ''; + /** + * Remote source path exported from the NFS, e.g., "/share". + * + * Generated from protobuf field string remote_path = 2; + */ + protected $remote_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $server + * The IP address of the NFS. + * @type string $remote_path + * Remote source path exported from the NFS, e.g., "/share". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Volume::initOnce(); + parent::__construct($data); + } + + /** + * The IP address of the NFS. + * + * Generated from protobuf field string server = 1; + * @return string + */ + public function getServer() + { + return $this->server; + } + + /** + * The IP address of the NFS. + * + * Generated from protobuf field string server = 1; + * @param string $var + * @return $this + */ + public function setServer($var) + { + GPBUtil::checkString($var, True); + $this->server = $var; + + return $this; + } + + /** + * Remote source path exported from the NFS, e.g., "/share". + * + * Generated from protobuf field string remote_path = 2; + * @return string + */ + public function getRemotePath() + { + return $this->remote_path; + } + + /** + * Remote source path exported from the NFS, e.g., "/share". + * + * Generated from protobuf field string remote_path = 2; + * @param string $var + * @return $this + */ + public function setRemotePath($var) + { + GPBUtil::checkString($var, True); + $this->remote_path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/OperationMetadata.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/OperationMetadata.php new file mode 100644 index 000000000000..6a98d039d45c --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.batch.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable.php new file mode 100644 index 000000000000..f04d7966d7b3 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable.php @@ -0,0 +1,492 @@ +google.cloud.batch.v1.Runnable + */ +class Runnable extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. DisplayName is an optional field that can be provided by the + * caller. If provided, it will be used in logs and other outputs to identify + * the script, making it easier for users to understand the logs. If not + * provided the index of the runnable will be used for outputs. + * + * Generated from protobuf field string display_name = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Normally, a runnable that returns a non-zero exit status fails and causes + * the task to fail. However, you can set this field to `true` to allow the + * task to continue executing its other runnables even if this runnable + * fails. + * + * Generated from protobuf field bool ignore_exit_status = 3; + */ + protected $ignore_exit_status = false; + /** + * Normally, a runnable that doesn't exit causes its task to fail. However, + * you can set this field to `true` to configure a background runnable. + * Background runnables are allowed continue running in the background while + * the task executes subsequent runnables. For example, background runnables + * are useful for providing services to other runnables or providing + * debugging-support tools like SSH servers. + * Specifically, background runnables are killed automatically (if they have + * not already exited) a short time after all foreground runnables have + * completed. Even though this is likely to result in a non-zero exit status + * for the background runnable, these automatic kills are not treated as task + * failures. + * + * Generated from protobuf field bool background = 4; + */ + protected $background = false; + /** + * By default, after a Runnable fails, no further Runnable are executed. This + * flag indicates that this Runnable must be run even if the Task has already + * failed. This is useful for Runnables that copy output files off of the VM + * or for debugging. + * The always_run flag does not override the Task's overall max_run_duration. + * If the max_run_duration has expired then no further Runnables will execute, + * not even always_run Runnables. + * + * Generated from protobuf field bool always_run = 5; + */ + protected $always_run = false; + /** + * Environment variables for this Runnable (overrides variables set for the + * whole Task or TaskGroup). + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 7; + */ + protected $environment = null; + /** + * Timeout for this Runnable. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + */ + protected $timeout = null; + /** + * Labels for this Runnable. + * + * Generated from protobuf field map labels = 9; + */ + private $labels; + protected $executable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Batch\V1\Runnable\Container $container + * Container runnable. + * @type \Google\Cloud\Batch\V1\Runnable\Script $script + * Script runnable. + * @type \Google\Cloud\Batch\V1\Runnable\Barrier $barrier + * Barrier runnable. + * @type string $display_name + * Optional. DisplayName is an optional field that can be provided by the + * caller. If provided, it will be used in logs and other outputs to identify + * the script, making it easier for users to understand the logs. If not + * provided the index of the runnable will be used for outputs. + * @type bool $ignore_exit_status + * Normally, a runnable that returns a non-zero exit status fails and causes + * the task to fail. However, you can set this field to `true` to allow the + * task to continue executing its other runnables even if this runnable + * fails. + * @type bool $background + * Normally, a runnable that doesn't exit causes its task to fail. However, + * you can set this field to `true` to configure a background runnable. + * Background runnables are allowed continue running in the background while + * the task executes subsequent runnables. For example, background runnables + * are useful for providing services to other runnables or providing + * debugging-support tools like SSH servers. + * Specifically, background runnables are killed automatically (if they have + * not already exited) a short time after all foreground runnables have + * completed. Even though this is likely to result in a non-zero exit status + * for the background runnable, these automatic kills are not treated as task + * failures. + * @type bool $always_run + * By default, after a Runnable fails, no further Runnable are executed. This + * flag indicates that this Runnable must be run even if the Task has already + * failed. This is useful for Runnables that copy output files off of the VM + * or for debugging. + * The always_run flag does not override the Task's overall max_run_duration. + * If the max_run_duration has expired then no further Runnables will execute, + * not even always_run Runnables. + * @type \Google\Cloud\Batch\V1\Environment $environment + * Environment variables for this Runnable (overrides variables set for the + * whole Task or TaskGroup). + * @type \Google\Protobuf\Duration $timeout + * Timeout for this Runnable. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels for this Runnable. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Container runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Container container = 1; + * @return \Google\Cloud\Batch\V1\Runnable\Container|null + */ + public function getContainer() + { + return $this->readOneof(1); + } + + public function hasContainer() + { + return $this->hasOneof(1); + } + + /** + * Container runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Container container = 1; + * @param \Google\Cloud\Batch\V1\Runnable\Container $var + * @return $this + */ + public function setContainer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Runnable\Container::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Script runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Script script = 2; + * @return \Google\Cloud\Batch\V1\Runnable\Script|null + */ + public function getScript() + { + return $this->readOneof(2); + } + + public function hasScript() + { + return $this->hasOneof(2); + } + + /** + * Script runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Script script = 2; + * @param \Google\Cloud\Batch\V1\Runnable\Script $var + * @return $this + */ + public function setScript($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Runnable\Script::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Barrier runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Barrier barrier = 6; + * @return \Google\Cloud\Batch\V1\Runnable\Barrier|null + */ + public function getBarrier() + { + return $this->readOneof(6); + } + + public function hasBarrier() + { + return $this->hasOneof(6); + } + + /** + * Barrier runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Barrier barrier = 6; + * @param \Google\Cloud\Batch\V1\Runnable\Barrier $var + * @return $this + */ + public function setBarrier($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Runnable\Barrier::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Optional. DisplayName is an optional field that can be provided by the + * caller. If provided, it will be used in logs and other outputs to identify + * the script, making it easier for users to understand the logs. If not + * provided the index of the runnable will be used for outputs. + * + * Generated from protobuf field string display_name = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. DisplayName is an optional field that can be provided by the + * caller. If provided, it will be used in logs and other outputs to identify + * the script, making it easier for users to understand the logs. If not + * provided the index of the runnable will be used for outputs. + * + * Generated from protobuf field string display_name = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Normally, a runnable that returns a non-zero exit status fails and causes + * the task to fail. However, you can set this field to `true` to allow the + * task to continue executing its other runnables even if this runnable + * fails. + * + * Generated from protobuf field bool ignore_exit_status = 3; + * @return bool + */ + public function getIgnoreExitStatus() + { + return $this->ignore_exit_status; + } + + /** + * Normally, a runnable that returns a non-zero exit status fails and causes + * the task to fail. However, you can set this field to `true` to allow the + * task to continue executing its other runnables even if this runnable + * fails. + * + * Generated from protobuf field bool ignore_exit_status = 3; + * @param bool $var + * @return $this + */ + public function setIgnoreExitStatus($var) + { + GPBUtil::checkBool($var); + $this->ignore_exit_status = $var; + + return $this; + } + + /** + * Normally, a runnable that doesn't exit causes its task to fail. However, + * you can set this field to `true` to configure a background runnable. + * Background runnables are allowed continue running in the background while + * the task executes subsequent runnables. For example, background runnables + * are useful for providing services to other runnables or providing + * debugging-support tools like SSH servers. + * Specifically, background runnables are killed automatically (if they have + * not already exited) a short time after all foreground runnables have + * completed. Even though this is likely to result in a non-zero exit status + * for the background runnable, these automatic kills are not treated as task + * failures. + * + * Generated from protobuf field bool background = 4; + * @return bool + */ + public function getBackground() + { + return $this->background; + } + + /** + * Normally, a runnable that doesn't exit causes its task to fail. However, + * you can set this field to `true` to configure a background runnable. + * Background runnables are allowed continue running in the background while + * the task executes subsequent runnables. For example, background runnables + * are useful for providing services to other runnables or providing + * debugging-support tools like SSH servers. + * Specifically, background runnables are killed automatically (if they have + * not already exited) a short time after all foreground runnables have + * completed. Even though this is likely to result in a non-zero exit status + * for the background runnable, these automatic kills are not treated as task + * failures. + * + * Generated from protobuf field bool background = 4; + * @param bool $var + * @return $this + */ + public function setBackground($var) + { + GPBUtil::checkBool($var); + $this->background = $var; + + return $this; + } + + /** + * By default, after a Runnable fails, no further Runnable are executed. This + * flag indicates that this Runnable must be run even if the Task has already + * failed. This is useful for Runnables that copy output files off of the VM + * or for debugging. + * The always_run flag does not override the Task's overall max_run_duration. + * If the max_run_duration has expired then no further Runnables will execute, + * not even always_run Runnables. + * + * Generated from protobuf field bool always_run = 5; + * @return bool + */ + public function getAlwaysRun() + { + return $this->always_run; + } + + /** + * By default, after a Runnable fails, no further Runnable are executed. This + * flag indicates that this Runnable must be run even if the Task has already + * failed. This is useful for Runnables that copy output files off of the VM + * or for debugging. + * The always_run flag does not override the Task's overall max_run_duration. + * If the max_run_duration has expired then no further Runnables will execute, + * not even always_run Runnables. + * + * Generated from protobuf field bool always_run = 5; + * @param bool $var + * @return $this + */ + public function setAlwaysRun($var) + { + GPBUtil::checkBool($var); + $this->always_run = $var; + + return $this; + } + + /** + * Environment variables for this Runnable (overrides variables set for the + * whole Task or TaskGroup). + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 7; + * @return \Google\Cloud\Batch\V1\Environment|null + */ + public function getEnvironment() + { + return $this->environment; + } + + public function hasEnvironment() + { + return isset($this->environment); + } + + public function clearEnvironment() + { + unset($this->environment); + } + + /** + * Environment variables for this Runnable (overrides variables set for the + * whole Task or TaskGroup). + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 7; + * @param \Google\Cloud\Batch\V1\Environment $var + * @return $this + */ + public function setEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Environment::class); + $this->environment = $var; + + return $this; + } + + /** + * Timeout for this Runnable. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Timeout for this Runnable. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Labels for this Runnable. + * + * Generated from protobuf field map labels = 9; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels for this Runnable. + * + * Generated from protobuf field map labels = 9; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * @return string + */ + public function getExecutable() + { + return $this->whichOneof("executable"); + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Barrier.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Barrier.php new file mode 100644 index 000000000000..4e85102178ac --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Barrier.php @@ -0,0 +1,75 @@ +google.cloud.batch.v1.Runnable.Barrier + */ +class Barrier extends \Google\Protobuf\Internal\Message +{ + /** + * Barriers are identified by their index in runnable list. + * Names are not required, but if present should be an identifier. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Barriers are identified by their index in runnable list. + * Names are not required, but if present should be an identifier. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Barriers are identified by their index in runnable list. + * Names are not required, but if present should be an identifier. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Barriers are identified by their index in runnable list. + * Names are not required, but if present should be an identifier. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Barrier::class, \Google\Cloud\Batch\V1\Runnable_Barrier::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Container.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Container.php new file mode 100644 index 000000000000..614fdd5d3e5c --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Container.php @@ -0,0 +1,562 @@ +google.cloud.batch.v1.Runnable.Container + */ +class Container extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The URI to pull the container image from. + * + * Generated from protobuf field string image_uri = 1; + */ + protected $image_uri = ''; + /** + * Required for some container images. Overrides the `CMD` specified in the + * container. If there is an `ENTRYPOINT` (either in the container image or + * with the `entrypoint` field below) then these commands are appended as + * arguments to the `ENTRYPOINT`. + * + * Generated from protobuf field repeated string commands = 2; + */ + private $commands; + /** + * Required for some container images. Overrides the `ENTRYPOINT` specified + * in the container. + * + * Generated from protobuf field string entrypoint = 3; + */ + protected $entrypoint = ''; + /** + * Volumes to mount (bind mount) from the host machine files or directories + * into the container, formatted to match `--volume` option for the + * `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. + * If the `TaskSpec.Volumes` field is specified but this field is not, Batch + * will mount each volume from the host machine to the container with the + * same mount path by default. In this case, the default mount option for + * containers will be read-only (`ro`) for existing persistent disks and + * read-write (`rw`) for other volume types, regardless of the original + * mount options specified in `TaskSpec.Volumes`. If you need different + * mount settings, you can explicitly configure them in this field. + * + * Generated from protobuf field repeated string volumes = 7; + */ + private $volumes; + /** + * Required for some container images. Arbitrary additional options to + * include in the `docker run` command when running this container—for + * example, `--network host`. For the `--volume` option, use the `volumes` + * field for the container. + * + * Generated from protobuf field string options = 8; + */ + protected $options = ''; + /** + * If set to true, external network access to and from container will be + * blocked, containers that are with block_external_network as true can + * still communicate with each other, network cannot be specified in the + * `container.options` field. + * + * Generated from protobuf field bool block_external_network = 9; + */ + protected $block_external_network = false; + /** + * Required if the container image is from a private Docker registry. The + * username to login to the Docker registry that contains the image. + * You can either specify the username directly by using plain text or + * specify an encrypted username by using a Secret Manager secret: + * `projects/*/secrets/*/versions/*`. However, using a secret is + * recommended for enhanced security. + * Caution: If you specify the username using plain text, you risk the + * username being exposed to any users who can view the job or its logs. + * To avoid this risk, specify a secret that contains the username instead. + * Learn more about [Secret + * Manager](https://cloud.google.com/secret-manager/docs/) and [using + * Secret Manager with + * Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + * + * Generated from protobuf field string username = 10; + */ + protected $username = ''; + /** + * Required if the container image is from a private Docker registry. The + * password to login to the Docker registry that contains the image. + * For security, it is strongly recommended to specify an + * encrypted password by using a Secret Manager secret: + * `projects/*/secrets/*/versions/*`. + * Warning: If you specify the password using plain text, you risk the + * password being exposed to any users who can view the job or its logs. + * To avoid this risk, specify a secret that contains the password instead. + * Learn more about [Secret + * Manager](https://cloud.google.com/secret-manager/docs/) and [using + * Secret Manager with + * Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + * + * Generated from protobuf field string password = 11; + */ + protected $password = ''; + /** + * Optional. If set to true, this container runnable uses Image streaming. + * Use Image streaming to allow the runnable to initialize without + * waiting for the entire container image to download, which can + * significantly reduce startup time for large container images. + * When `enableImageStreaming` is set to true, the container + * runtime is [containerd](https://containerd.io/) instead of Docker. + * Additionally, this container runnable only supports the following + * `container` subfields: `imageUri`, + * `commands[]`, `entrypoint`, and + * `volumes[]`; any other `container` subfields are ignored. + * For more information about the requirements and limitations for using + * Image streaming with Batch, see the [`image-streaming` + * sample on + * GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). + * + * Generated from protobuf field bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_image_streaming = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image_uri + * Required. The URI to pull the container image from. + * @type array|\Google\Protobuf\Internal\RepeatedField $commands + * Required for some container images. Overrides the `CMD` specified in the + * container. If there is an `ENTRYPOINT` (either in the container image or + * with the `entrypoint` field below) then these commands are appended as + * arguments to the `ENTRYPOINT`. + * @type string $entrypoint + * Required for some container images. Overrides the `ENTRYPOINT` specified + * in the container. + * @type array|\Google\Protobuf\Internal\RepeatedField $volumes + * Volumes to mount (bind mount) from the host machine files or directories + * into the container, formatted to match `--volume` option for the + * `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. + * If the `TaskSpec.Volumes` field is specified but this field is not, Batch + * will mount each volume from the host machine to the container with the + * same mount path by default. In this case, the default mount option for + * containers will be read-only (`ro`) for existing persistent disks and + * read-write (`rw`) for other volume types, regardless of the original + * mount options specified in `TaskSpec.Volumes`. If you need different + * mount settings, you can explicitly configure them in this field. + * @type string $options + * Required for some container images. Arbitrary additional options to + * include in the `docker run` command when running this container—for + * example, `--network host`. For the `--volume` option, use the `volumes` + * field for the container. + * @type bool $block_external_network + * If set to true, external network access to and from container will be + * blocked, containers that are with block_external_network as true can + * still communicate with each other, network cannot be specified in the + * `container.options` field. + * @type string $username + * Required if the container image is from a private Docker registry. The + * username to login to the Docker registry that contains the image. + * You can either specify the username directly by using plain text or + * specify an encrypted username by using a Secret Manager secret: + * `projects/*/secrets/*/versions/*`. However, using a secret is + * recommended for enhanced security. + * Caution: If you specify the username using plain text, you risk the + * username being exposed to any users who can view the job or its logs. + * To avoid this risk, specify a secret that contains the username instead. + * Learn more about [Secret + * Manager](https://cloud.google.com/secret-manager/docs/) and [using + * Secret Manager with + * Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + * @type string $password + * Required if the container image is from a private Docker registry. The + * password to login to the Docker registry that contains the image. + * For security, it is strongly recommended to specify an + * encrypted password by using a Secret Manager secret: + * `projects/*/secrets/*/versions/*`. + * Warning: If you specify the password using plain text, you risk the + * password being exposed to any users who can view the job or its logs. + * To avoid this risk, specify a secret that contains the password instead. + * Learn more about [Secret + * Manager](https://cloud.google.com/secret-manager/docs/) and [using + * Secret Manager with + * Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + * @type bool $enable_image_streaming + * Optional. If set to true, this container runnable uses Image streaming. + * Use Image streaming to allow the runnable to initialize without + * waiting for the entire container image to download, which can + * significantly reduce startup time for large container images. + * When `enableImageStreaming` is set to true, the container + * runtime is [containerd](https://containerd.io/) instead of Docker. + * Additionally, this container runnable only supports the following + * `container` subfields: `imageUri`, + * `commands[]`, `entrypoint`, and + * `volumes[]`; any other `container` subfields are ignored. + * For more information about the requirements and limitations for using + * Image streaming with Batch, see the [`image-streaming` + * sample on + * GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URI to pull the container image from. + * + * Generated from protobuf field string image_uri = 1; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * Required. The URI to pull the container image from. + * + * Generated from protobuf field string image_uri = 1; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * Required for some container images. Overrides the `CMD` specified in the + * container. If there is an `ENTRYPOINT` (either in the container image or + * with the `entrypoint` field below) then these commands are appended as + * arguments to the `ENTRYPOINT`. + * + * Generated from protobuf field repeated string commands = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCommands() + { + return $this->commands; + } + + /** + * Required for some container images. Overrides the `CMD` specified in the + * container. If there is an `ENTRYPOINT` (either in the container image or + * with the `entrypoint` field below) then these commands are appended as + * arguments to the `ENTRYPOINT`. + * + * Generated from protobuf field repeated string commands = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCommands($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->commands = $arr; + + return $this; + } + + /** + * Required for some container images. Overrides the `ENTRYPOINT` specified + * in the container. + * + * Generated from protobuf field string entrypoint = 3; + * @return string + */ + public function getEntrypoint() + { + return $this->entrypoint; + } + + /** + * Required for some container images. Overrides the `ENTRYPOINT` specified + * in the container. + * + * Generated from protobuf field string entrypoint = 3; + * @param string $var + * @return $this + */ + public function setEntrypoint($var) + { + GPBUtil::checkString($var, True); + $this->entrypoint = $var; + + return $this; + } + + /** + * Volumes to mount (bind mount) from the host machine files or directories + * into the container, formatted to match `--volume` option for the + * `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. + * If the `TaskSpec.Volumes` field is specified but this field is not, Batch + * will mount each volume from the host machine to the container with the + * same mount path by default. In this case, the default mount option for + * containers will be read-only (`ro`) for existing persistent disks and + * read-write (`rw`) for other volume types, regardless of the original + * mount options specified in `TaskSpec.Volumes`. If you need different + * mount settings, you can explicitly configure them in this field. + * + * Generated from protobuf field repeated string volumes = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * Volumes to mount (bind mount) from the host machine files or directories + * into the container, formatted to match `--volume` option for the + * `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. + * If the `TaskSpec.Volumes` field is specified but this field is not, Batch + * will mount each volume from the host machine to the container with the + * same mount path by default. In this case, the default mount option for + * containers will be read-only (`ro`) for existing persistent disks and + * read-write (`rw`) for other volume types, regardless of the original + * mount options specified in `TaskSpec.Volumes`. If you need different + * mount settings, you can explicitly configure them in this field. + * + * Generated from protobuf field repeated string volumes = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->volumes = $arr; + + return $this; + } + + /** + * Required for some container images. Arbitrary additional options to + * include in the `docker run` command when running this container—for + * example, `--network host`. For the `--volume` option, use the `volumes` + * field for the container. + * + * Generated from protobuf field string options = 8; + * @return string + */ + public function getOptions() + { + return $this->options; + } + + /** + * Required for some container images. Arbitrary additional options to + * include in the `docker run` command when running this container—for + * example, `--network host`. For the `--volume` option, use the `volumes` + * field for the container. + * + * Generated from protobuf field string options = 8; + * @param string $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkString($var, True); + $this->options = $var; + + return $this; + } + + /** + * If set to true, external network access to and from container will be + * blocked, containers that are with block_external_network as true can + * still communicate with each other, network cannot be specified in the + * `container.options` field. + * + * Generated from protobuf field bool block_external_network = 9; + * @return bool + */ + public function getBlockExternalNetwork() + { + return $this->block_external_network; + } + + /** + * If set to true, external network access to and from container will be + * blocked, containers that are with block_external_network as true can + * still communicate with each other, network cannot be specified in the + * `container.options` field. + * + * Generated from protobuf field bool block_external_network = 9; + * @param bool $var + * @return $this + */ + public function setBlockExternalNetwork($var) + { + GPBUtil::checkBool($var); + $this->block_external_network = $var; + + return $this; + } + + /** + * Required if the container image is from a private Docker registry. The + * username to login to the Docker registry that contains the image. + * You can either specify the username directly by using plain text or + * specify an encrypted username by using a Secret Manager secret: + * `projects/*/secrets/*/versions/*`. However, using a secret is + * recommended for enhanced security. + * Caution: If you specify the username using plain text, you risk the + * username being exposed to any users who can view the job or its logs. + * To avoid this risk, specify a secret that contains the username instead. + * Learn more about [Secret + * Manager](https://cloud.google.com/secret-manager/docs/) and [using + * Secret Manager with + * Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + * + * Generated from protobuf field string username = 10; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Required if the container image is from a private Docker registry. The + * username to login to the Docker registry that contains the image. + * You can either specify the username directly by using plain text or + * specify an encrypted username by using a Secret Manager secret: + * `projects/*/secrets/*/versions/*`. However, using a secret is + * recommended for enhanced security. + * Caution: If you specify the username using plain text, you risk the + * username being exposed to any users who can view the job or its logs. + * To avoid this risk, specify a secret that contains the username instead. + * Learn more about [Secret + * Manager](https://cloud.google.com/secret-manager/docs/) and [using + * Secret Manager with + * Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + * + * Generated from protobuf field string username = 10; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + + /** + * Required if the container image is from a private Docker registry. The + * password to login to the Docker registry that contains the image. + * For security, it is strongly recommended to specify an + * encrypted password by using a Secret Manager secret: + * `projects/*/secrets/*/versions/*`. + * Warning: If you specify the password using plain text, you risk the + * password being exposed to any users who can view the job or its logs. + * To avoid this risk, specify a secret that contains the password instead. + * Learn more about [Secret + * Manager](https://cloud.google.com/secret-manager/docs/) and [using + * Secret Manager with + * Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + * + * Generated from protobuf field string password = 11; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Required if the container image is from a private Docker registry. The + * password to login to the Docker registry that contains the image. + * For security, it is strongly recommended to specify an + * encrypted password by using a Secret Manager secret: + * `projects/*/secrets/*/versions/*`. + * Warning: If you specify the password using plain text, you risk the + * password being exposed to any users who can view the job or its logs. + * To avoid this risk, specify a secret that contains the password instead. + * Learn more about [Secret + * Manager](https://cloud.google.com/secret-manager/docs/) and [using + * Secret Manager with + * Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + * + * Generated from protobuf field string password = 11; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + + /** + * Optional. If set to true, this container runnable uses Image streaming. + * Use Image streaming to allow the runnable to initialize without + * waiting for the entire container image to download, which can + * significantly reduce startup time for large container images. + * When `enableImageStreaming` is set to true, the container + * runtime is [containerd](https://containerd.io/) instead of Docker. + * Additionally, this container runnable only supports the following + * `container` subfields: `imageUri`, + * `commands[]`, `entrypoint`, and + * `volumes[]`; any other `container` subfields are ignored. + * For more information about the requirements and limitations for using + * Image streaming with Batch, see the [`image-streaming` + * sample on + * GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). + * + * Generated from protobuf field bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableImageStreaming() + { + return $this->enable_image_streaming; + } + + /** + * Optional. If set to true, this container runnable uses Image streaming. + * Use Image streaming to allow the runnable to initialize without + * waiting for the entire container image to download, which can + * significantly reduce startup time for large container images. + * When `enableImageStreaming` is set to true, the container + * runtime is [containerd](https://containerd.io/) instead of Docker. + * Additionally, this container runnable only supports the following + * `container` subfields: `imageUri`, + * `commands[]`, `entrypoint`, and + * `volumes[]`; any other `container` subfields are ignored. + * For more information about the requirements and limitations for using + * Image streaming with Batch, see the [`image-streaming` + * sample on + * GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). + * + * Generated from protobuf field bool enable_image_streaming = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableImageStreaming($var) + { + GPBUtil::checkBool($var); + $this->enable_image_streaming = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Container::class, \Google\Cloud\Batch\V1\Runnable_Container::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Script.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Script.php new file mode 100644 index 000000000000..1abdb64dd330 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Script.php @@ -0,0 +1,153 @@ +google.cloud.batch.v1.Runnable.Script + */ +class Script extends \Google\Protobuf\Internal\Message +{ + protected $command; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * The path to a script file that is accessible from the host VM(s). + * Unless the script file supports the default `#!/bin/sh` shell + * interpreter, you must specify an interpreter by including a + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the + * first line of the file. For example, to execute the script using bash, + * include `#!/bin/bash` as the first line of the file. Alternatively, + * to execute the script using Python3, include `#!/usr/bin/env python3` + * as the first line of the file. + * @type string $text + * The text for a script. + * Unless the script text supports the default `#!/bin/sh` shell + * interpreter, you must specify an interpreter by including a + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the + * beginning of the text. For example, to execute the script using bash, + * include `#!/bin/bash\n` at the beginning of the text. Alternatively, + * to execute the script using Python3, include `#!/usr/bin/env python3\n` + * at the beginning of the text. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * The path to a script file that is accessible from the host VM(s). + * Unless the script file supports the default `#!/bin/sh` shell + * interpreter, you must specify an interpreter by including a + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the + * first line of the file. For example, to execute the script using bash, + * include `#!/bin/bash` as the first line of the file. Alternatively, + * to execute the script using Python3, include `#!/usr/bin/env python3` + * as the first line of the file. + * + * Generated from protobuf field string path = 1; + * @return string + */ + public function getPath() + { + return $this->readOneof(1); + } + + public function hasPath() + { + return $this->hasOneof(1); + } + + /** + * The path to a script file that is accessible from the host VM(s). + * Unless the script file supports the default `#!/bin/sh` shell + * interpreter, you must specify an interpreter by including a + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the + * first line of the file. For example, to execute the script using bash, + * include `#!/bin/bash` as the first line of the file. Alternatively, + * to execute the script using Python3, include `#!/usr/bin/env python3` + * as the first line of the file. + * + * Generated from protobuf field string path = 1; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The text for a script. + * Unless the script text supports the default `#!/bin/sh` shell + * interpreter, you must specify an interpreter by including a + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the + * beginning of the text. For example, to execute the script using bash, + * include `#!/bin/bash\n` at the beginning of the text. Alternatively, + * to execute the script using Python3, include `#!/usr/bin/env python3\n` + * at the beginning of the text. + * + * Generated from protobuf field string text = 2; + * @return string + */ + public function getText() + { + return $this->readOneof(2); + } + + public function hasText() + { + return $this->hasOneof(2); + } + + /** + * The text for a script. + * Unless the script text supports the default `#!/bin/sh` shell + * interpreter, you must specify an interpreter by including a + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the + * beginning of the text. For example, to execute the script using bash, + * include `#!/bin/bash\n` at the beginning of the text. Alternatively, + * to execute the script using Python3, include `#!/usr/bin/env python3\n` + * at the beginning of the text. + * + * Generated from protobuf field string text = 2; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getCommand() + { + return $this->whichOneof("command"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Script::class, \Google\Cloud\Batch\V1\Runnable_Script::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ServiceAccount.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ServiceAccount.php new file mode 100644 index 000000000000..2a315346b647 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ServiceAccount.php @@ -0,0 +1,101 @@ +google.cloud.batch.v1.ServiceAccount + */ +class ServiceAccount extends \Google\Protobuf\Internal\Message +{ + /** + * Email address of the service account. + * + * Generated from protobuf field string email = 1; + */ + protected $email = ''; + /** + * List of scopes to be enabled for this service account. + * + * Generated from protobuf field repeated string scopes = 2; + */ + private $scopes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $email + * Email address of the service account. + * @type array|\Google\Protobuf\Internal\RepeatedField $scopes + * List of scopes to be enabled for this service account. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Email address of the service account. + * + * Generated from protobuf field string email = 1; + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Email address of the service account. + * + * Generated from protobuf field string email = 1; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * List of scopes to be enabled for this service account. + * + * Generated from protobuf field repeated string scopes = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * List of scopes to be enabled for this service account. + * + * Generated from protobuf field repeated string scopes = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->scopes = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/StatusEvent.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/StatusEvent.php new file mode 100644 index 000000000000..1a199e88f2ff --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/StatusEvent.php @@ -0,0 +1,235 @@ +google.cloud.batch.v1.StatusEvent + */ +class StatusEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Type of the event. + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + /** + * Description of the event. + * + * Generated from protobuf field string description = 1; + */ + protected $description = ''; + /** + * The time this event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 2; + */ + protected $event_time = null; + /** + * Task Execution. + * This field is only defined for task-level status events where the task + * fails. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskExecution task_execution = 4; + */ + protected $task_execution = null; + /** + * Task State. + * This field is only defined for task-level status events. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; + */ + protected $task_state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * Type of the event. + * @type string $description + * Description of the event. + * @type \Google\Protobuf\Timestamp $event_time + * The time this event occurred. + * @type \Google\Cloud\Batch\V1\TaskExecution $task_execution + * Task Execution. + * This field is only defined for task-level status events where the task + * fails. + * @type int $task_state + * Task State. + * This field is only defined for task-level status events. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Type of the event. + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the event. + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Description of the event. + * + * Generated from protobuf field string description = 1; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Description of the event. + * + * Generated from protobuf field string description = 1; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The time this event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEventTime() + { + return $this->event_time; + } + + public function hasEventTime() + { + return isset($this->event_time); + } + + public function clearEventTime() + { + unset($this->event_time); + } + + /** + * The time this event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEventTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->event_time = $var; + + return $this; + } + + /** + * Task Execution. + * This field is only defined for task-level status events where the task + * fails. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskExecution task_execution = 4; + * @return \Google\Cloud\Batch\V1\TaskExecution|null + */ + public function getTaskExecution() + { + return $this->task_execution; + } + + public function hasTaskExecution() + { + return isset($this->task_execution); + } + + public function clearTaskExecution() + { + unset($this->task_execution); + } + + /** + * Task Execution. + * This field is only defined for task-level status events where the task + * fails. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskExecution task_execution = 4; + * @param \Google\Cloud\Batch\V1\TaskExecution $var + * @return $this + */ + public function setTaskExecution($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\TaskExecution::class); + $this->task_execution = $var; + + return $this; + } + + /** + * Task State. + * This field is only defined for task-level status events. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * @return int + */ + public function getTaskState() + { + return $this->task_state; + } + + /** + * Task State. + * This field is only defined for task-level status events. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * @param int $var + * @return $this + */ + public function setTaskState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\TaskStatus\State::class); + $this->task_state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Task.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Task.php new file mode 100644 index 000000000000..c034a667462e --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Task.php @@ -0,0 +1,123 @@ +google.cloud.batch.v1.Task + */ +class Task extends \Google\Protobuf\Internal\Message +{ + /** + * Task name. + * The name is generated from the parent TaskGroup name and 'id' field. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Task Status. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus status = 2; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Task name. + * The name is generated from the parent TaskGroup name and 'id' field. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + * @type \Google\Cloud\Batch\V1\TaskStatus $status + * Task Status. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Task name. + * The name is generated from the parent TaskGroup name and 'id' field. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Task name. + * The name is generated from the parent TaskGroup name and 'id' field. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Task Status. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus status = 2; + * @return \Google\Cloud\Batch\V1\TaskStatus|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Task Status. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus status = 2; + * @param \Google\Cloud\Batch\V1\TaskStatus $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\TaskStatus::class); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskExecution.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskExecution.php new file mode 100644 index 000000000000..3a06c25ccab4 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskExecution.php @@ -0,0 +1,100 @@ +google.cloud.batch.v1.TaskExecution + */ +class TaskExecution extends \Google\Protobuf\Internal\Message +{ + /** + * The exit code of a finished task. + * If the task succeeded, the exit code will be 0. If the task failed but not + * due to the following reasons, the exit code will be 50000. + * Otherwise, it can be from different sources: + * * Batch known failures: + * https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + * * Batch runnable execution failures; you can rely on Batch logs to further + * diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + * there are multiple runnables failures, Batch only exposes the first error. + * + * Generated from protobuf field int32 exit_code = 1; + */ + protected $exit_code = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $exit_code + * The exit code of a finished task. + * If the task succeeded, the exit code will be 0. If the task failed but not + * due to the following reasons, the exit code will be 50000. + * Otherwise, it can be from different sources: + * * Batch known failures: + * https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + * * Batch runnable execution failures; you can rely on Batch logs to further + * diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + * there are multiple runnables failures, Batch only exposes the first error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * The exit code of a finished task. + * If the task succeeded, the exit code will be 0. If the task failed but not + * due to the following reasons, the exit code will be 50000. + * Otherwise, it can be from different sources: + * * Batch known failures: + * https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + * * Batch runnable execution failures; you can rely on Batch logs to further + * diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + * there are multiple runnables failures, Batch only exposes the first error. + * + * Generated from protobuf field int32 exit_code = 1; + * @return int + */ + public function getExitCode() + { + return $this->exit_code; + } + + /** + * The exit code of a finished task. + * If the task succeeded, the exit code will be 0. If the task failed but not + * due to the following reasons, the exit code will be 50000. + * Otherwise, it can be from different sources: + * * Batch known failures: + * https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + * * Batch runnable execution failures; you can rely on Batch logs to further + * diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + * there are multiple runnables failures, Batch only exposes the first error. + * + * Generated from protobuf field int32 exit_code = 1; + * @param int $var + * @return $this + */ + public function setExitCode($var) + { + GPBUtil::checkInt32($var); + $this->exit_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup.php new file mode 100644 index 000000000000..9a71f100436d --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup.php @@ -0,0 +1,479 @@ +google.cloud.batch.v1.TaskGroup + */ +class TaskGroup extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. TaskGroup name. + * The system generates this field based on parent Job name. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. Tasks in the group share the same task spec. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $task_spec = null; + /** + * Number of Tasks in the TaskGroup. + * Default is 1. + * + * Generated from protobuf field int64 task_count = 4; + */ + protected $task_count = 0; + /** + * Max number of tasks that can run in parallel. + * Default to min(task_count, parallel tasks per job limit). + * See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). + * Field parallelism must be 1 if the scheduling_policy is IN_ORDER. + * + * Generated from protobuf field int64 parallelism = 5; + */ + protected $parallelism = 0; + /** + * Scheduling policy for Tasks in the TaskGroup. + * The default value is AS_SOON_AS_POSSIBLE. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskGroup.SchedulingPolicy scheduling_policy = 6; + */ + protected $scheduling_policy = 0; + /** + * An array of environment variable mappings, which are passed to Tasks with + * matching indices. If task_environments is used then task_count should + * not be specified in the request (and will be ignored). Task count will be + * the length of task_environments. + * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + * addition to any environment variables set in task_environments, specifying + * the number of Tasks in the Task's parent TaskGroup, and the specific Task's + * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Environment task_environments = 9; + */ + private $task_environments; + /** + * Max number of tasks that can be run on a VM at the same time. + * If not specified, the system will decide a value based on available + * compute resources on a VM and task requirements. + * + * Generated from protobuf field int64 task_count_per_node = 10; + */ + protected $task_count_per_node = 0; + /** + * When true, Batch will populate a file with a list of all VMs assigned to + * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + * of that file. Defaults to false. The host file supports up to 1000 VMs. + * + * Generated from protobuf field bool require_hosts_file = 11; + */ + protected $require_hosts_file = false; + /** + * When true, Batch will configure SSH to allow passwordless login between + * VMs running the Batch tasks in the same TaskGroup. + * + * Generated from protobuf field bool permissive_ssh = 12; + */ + protected $permissive_ssh = false; + /** + * Optional. If not set or set to false, Batch uses the root user to execute + * runnables. If set to true, Batch runs the runnables using a non-root user. + * Currently, the non-root user Batch used is generated by OS Login. For more + * information, see [About OS + * Login](https://cloud.google.com/compute/docs/oslogin). + * + * Generated from protobuf field bool run_as_non_root = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $run_as_non_root = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. TaskGroup name. + * The system generates this field based on parent Job name. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + * @type \Google\Cloud\Batch\V1\TaskSpec $task_spec + * Required. Tasks in the group share the same task spec. + * @type int|string $task_count + * Number of Tasks in the TaskGroup. + * Default is 1. + * @type int|string $parallelism + * Max number of tasks that can run in parallel. + * Default to min(task_count, parallel tasks per job limit). + * See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). + * Field parallelism must be 1 if the scheduling_policy is IN_ORDER. + * @type int $scheduling_policy + * Scheduling policy for Tasks in the TaskGroup. + * The default value is AS_SOON_AS_POSSIBLE. + * @type array<\Google\Cloud\Batch\V1\Environment>|\Google\Protobuf\Internal\RepeatedField $task_environments + * An array of environment variable mappings, which are passed to Tasks with + * matching indices. If task_environments is used then task_count should + * not be specified in the request (and will be ignored). Task count will be + * the length of task_environments. + * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + * addition to any environment variables set in task_environments, specifying + * the number of Tasks in the Task's parent TaskGroup, and the specific Task's + * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + * @type int|string $task_count_per_node + * Max number of tasks that can be run on a VM at the same time. + * If not specified, the system will decide a value based on available + * compute resources on a VM and task requirements. + * @type bool $require_hosts_file + * When true, Batch will populate a file with a list of all VMs assigned to + * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + * of that file. Defaults to false. The host file supports up to 1000 VMs. + * @type bool $permissive_ssh + * When true, Batch will configure SSH to allow passwordless login between + * VMs running the Batch tasks in the same TaskGroup. + * @type bool $run_as_non_root + * Optional. If not set or set to false, Batch uses the root user to execute + * runnables. If set to true, Batch runs the runnables using a non-root user. + * Currently, the non-root user Batch used is generated by OS Login. For more + * information, see [About OS + * Login](https://cloud.google.com/compute/docs/oslogin). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Output only. TaskGroup name. + * The system generates this field based on parent Job name. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. TaskGroup name. + * The system generates this field based on parent Job name. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Tasks in the group share the same task spec. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Batch\V1\TaskSpec|null + */ + public function getTaskSpec() + { + return $this->task_spec; + } + + public function hasTaskSpec() + { + return isset($this->task_spec); + } + + public function clearTaskSpec() + { + unset($this->task_spec); + } + + /** + * Required. Tasks in the group share the same task spec. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Batch\V1\TaskSpec $var + * @return $this + */ + public function setTaskSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\TaskSpec::class); + $this->task_spec = $var; + + return $this; + } + + /** + * Number of Tasks in the TaskGroup. + * Default is 1. + * + * Generated from protobuf field int64 task_count = 4; + * @return int|string + */ + public function getTaskCount() + { + return $this->task_count; + } + + /** + * Number of Tasks in the TaskGroup. + * Default is 1. + * + * Generated from protobuf field int64 task_count = 4; + * @param int|string $var + * @return $this + */ + public function setTaskCount($var) + { + GPBUtil::checkInt64($var); + $this->task_count = $var; + + return $this; + } + + /** + * Max number of tasks that can run in parallel. + * Default to min(task_count, parallel tasks per job limit). + * See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). + * Field parallelism must be 1 if the scheduling_policy is IN_ORDER. + * + * Generated from protobuf field int64 parallelism = 5; + * @return int|string + */ + public function getParallelism() + { + return $this->parallelism; + } + + /** + * Max number of tasks that can run in parallel. + * Default to min(task_count, parallel tasks per job limit). + * See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). + * Field parallelism must be 1 if the scheduling_policy is IN_ORDER. + * + * Generated from protobuf field int64 parallelism = 5; + * @param int|string $var + * @return $this + */ + public function setParallelism($var) + { + GPBUtil::checkInt64($var); + $this->parallelism = $var; + + return $this; + } + + /** + * Scheduling policy for Tasks in the TaskGroup. + * The default value is AS_SOON_AS_POSSIBLE. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskGroup.SchedulingPolicy scheduling_policy = 6; + * @return int + */ + public function getSchedulingPolicy() + { + return $this->scheduling_policy; + } + + /** + * Scheduling policy for Tasks in the TaskGroup. + * The default value is AS_SOON_AS_POSSIBLE. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskGroup.SchedulingPolicy scheduling_policy = 6; + * @param int $var + * @return $this + */ + public function setSchedulingPolicy($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\TaskGroup\SchedulingPolicy::class); + $this->scheduling_policy = $var; + + return $this; + } + + /** + * An array of environment variable mappings, which are passed to Tasks with + * matching indices. If task_environments is used then task_count should + * not be specified in the request (and will be ignored). Task count will be + * the length of task_environments. + * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + * addition to any environment variables set in task_environments, specifying + * the number of Tasks in the Task's parent TaskGroup, and the specific Task's + * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Environment task_environments = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTaskEnvironments() + { + return $this->task_environments; + } + + /** + * An array of environment variable mappings, which are passed to Tasks with + * matching indices. If task_environments is used then task_count should + * not be specified in the request (and will be ignored). Task count will be + * the length of task_environments. + * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + * addition to any environment variables set in task_environments, specifying + * the number of Tasks in the Task's parent TaskGroup, and the specific Task's + * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Environment task_environments = 9; + * @param array<\Google\Cloud\Batch\V1\Environment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTaskEnvironments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Environment::class); + $this->task_environments = $arr; + + return $this; + } + + /** + * Max number of tasks that can be run on a VM at the same time. + * If not specified, the system will decide a value based on available + * compute resources on a VM and task requirements. + * + * Generated from protobuf field int64 task_count_per_node = 10; + * @return int|string + */ + public function getTaskCountPerNode() + { + return $this->task_count_per_node; + } + + /** + * Max number of tasks that can be run on a VM at the same time. + * If not specified, the system will decide a value based on available + * compute resources on a VM and task requirements. + * + * Generated from protobuf field int64 task_count_per_node = 10; + * @param int|string $var + * @return $this + */ + public function setTaskCountPerNode($var) + { + GPBUtil::checkInt64($var); + $this->task_count_per_node = $var; + + return $this; + } + + /** + * When true, Batch will populate a file with a list of all VMs assigned to + * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + * of that file. Defaults to false. The host file supports up to 1000 VMs. + * + * Generated from protobuf field bool require_hosts_file = 11; + * @return bool + */ + public function getRequireHostsFile() + { + return $this->require_hosts_file; + } + + /** + * When true, Batch will populate a file with a list of all VMs assigned to + * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + * of that file. Defaults to false. The host file supports up to 1000 VMs. + * + * Generated from protobuf field bool require_hosts_file = 11; + * @param bool $var + * @return $this + */ + public function setRequireHostsFile($var) + { + GPBUtil::checkBool($var); + $this->require_hosts_file = $var; + + return $this; + } + + /** + * When true, Batch will configure SSH to allow passwordless login between + * VMs running the Batch tasks in the same TaskGroup. + * + * Generated from protobuf field bool permissive_ssh = 12; + * @return bool + */ + public function getPermissiveSsh() + { + return $this->permissive_ssh; + } + + /** + * When true, Batch will configure SSH to allow passwordless login between + * VMs running the Batch tasks in the same TaskGroup. + * + * Generated from protobuf field bool permissive_ssh = 12; + * @param bool $var + * @return $this + */ + public function setPermissiveSsh($var) + { + GPBUtil::checkBool($var); + $this->permissive_ssh = $var; + + return $this; + } + + /** + * Optional. If not set or set to false, Batch uses the root user to execute + * runnables. If set to true, Batch runs the runnables using a non-root user. + * Currently, the non-root user Batch used is generated by OS Login. For more + * information, see [About OS + * Login](https://cloud.google.com/compute/docs/oslogin). + * + * Generated from protobuf field bool run_as_non_root = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRunAsNonRoot() + { + return $this->run_as_non_root; + } + + /** + * Optional. If not set or set to false, Batch uses the root user to execute + * runnables. If set to true, Batch runs the runnables using a non-root user. + * Currently, the non-root user Batch used is generated by OS Login. For more + * information, see [About OS + * Login](https://cloud.google.com/compute/docs/oslogin). + * + * Generated from protobuf field bool run_as_non_root = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRunAsNonRoot($var) + { + GPBUtil::checkBool($var); + $this->run_as_non_root = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup/SchedulingPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup/SchedulingPolicy.php new file mode 100644 index 000000000000..df18ec4557bc --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup/SchedulingPolicy.php @@ -0,0 +1,66 @@ +google.cloud.batch.v1.TaskGroup.SchedulingPolicy + */ +class SchedulingPolicy +{ + /** + * Unspecified. + * + * Generated from protobuf enum SCHEDULING_POLICY_UNSPECIFIED = 0; + */ + const SCHEDULING_POLICY_UNSPECIFIED = 0; + /** + * Run Tasks as soon as resources are available. + * Tasks might be executed in parallel depending on parallelism and + * task_count values. + * + * Generated from protobuf enum AS_SOON_AS_POSSIBLE = 1; + */ + const AS_SOON_AS_POSSIBLE = 1; + /** + * Run Tasks sequentially with increased task index. + * + * Generated from protobuf enum IN_ORDER = 2; + */ + const IN_ORDER = 2; + + private static $valueToName = [ + self::SCHEDULING_POLICY_UNSPECIFIED => 'SCHEDULING_POLICY_UNSPECIFIED', + self::AS_SOON_AS_POSSIBLE => 'AS_SOON_AS_POSSIBLE', + self::IN_ORDER => 'IN_ORDER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SchedulingPolicy::class, \Google\Cloud\Batch\V1\TaskGroup_SchedulingPolicy::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskSpec.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskSpec.php new file mode 100644 index 000000000000..e690af593b2f --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskSpec.php @@ -0,0 +1,440 @@ +google.cloud.batch.v1.TaskSpec + */ +class TaskSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The sequence of one or more runnables (executable scripts, + * executable containers, and/or barriers) for each task in this task group to + * run. Each task runs this list of runnables in order. For a task to succeed, + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Runnable runnables = 8; + */ + private $runnables; + /** + * ComputeResource requirements. + * + * Generated from protobuf field .google.cloud.batch.v1.ComputeResource compute_resource = 3; + */ + protected $compute_resource = null; + /** + * Maximum duration the task should run before being automatically retried + * (if enabled) or automatically failed. Format the value of this field + * as a time limit in seconds followed by `s`—for example, `3600s` + * for 1 hour. The field accepts any value between 0 and the maximum listed + * for the `Duration` field type at + * https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + * the actual maximum run time for a job will be limited to the maximum run + * time for a job listed at + * https://cloud.google.com/batch/quotas#max-job-duration. + * + * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; + */ + protected $max_run_duration = null; + /** + * Maximum number of retries on failures. + * The default, 0, which means never retry. + * The valid value range is [0, 10]. + * + * Generated from protobuf field int32 max_retry_count = 5; + */ + protected $max_retry_count = 0; + /** + * Lifecycle management schema when any task in a task group is failed. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. + * If task ends with non-zero exit code, retry the task with max_retry_count. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; + */ + private $lifecycle_policies; + /** + * Deprecated: please use environment(non-plural) instead. + * + * Generated from protobuf field map environments = 6 [deprecated = true]; + * @deprecated + */ + private $environments; + /** + * Volumes to mount before running Tasks using this TaskSpec. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Volume volumes = 7; + */ + private $volumes; + /** + * Environment variables to set before running the Task. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 10; + */ + protected $environment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Batch\V1\Runnable>|\Google\Protobuf\Internal\RepeatedField $runnables + * Required. The sequence of one or more runnables (executable scripts, + * executable containers, and/or barriers) for each task in this task group to + * run. Each task runs this list of runnables in order. For a task to succeed, + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. + * @type \Google\Cloud\Batch\V1\ComputeResource $compute_resource + * ComputeResource requirements. + * @type \Google\Protobuf\Duration $max_run_duration + * Maximum duration the task should run before being automatically retried + * (if enabled) or automatically failed. Format the value of this field + * as a time limit in seconds followed by `s`—for example, `3600s` + * for 1 hour. The field accepts any value between 0 and the maximum listed + * for the `Duration` field type at + * https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + * the actual maximum run time for a job will be limited to the maximum run + * time for a job listed at + * https://cloud.google.com/batch/quotas#max-job-duration. + * @type int $max_retry_count + * Maximum number of retries on failures. + * The default, 0, which means never retry. + * The valid value range is [0, 10]. + * @type array<\Google\Cloud\Batch\V1\LifecyclePolicy>|\Google\Protobuf\Internal\RepeatedField $lifecycle_policies + * Lifecycle management schema when any task in a task group is failed. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. + * If task ends with non-zero exit code, retry the task with max_retry_count. + * @type array|\Google\Protobuf\Internal\MapField $environments + * Deprecated: please use environment(non-plural) instead. + * @type array<\Google\Cloud\Batch\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * Volumes to mount before running Tasks using this TaskSpec. + * @type \Google\Cloud\Batch\V1\Environment $environment + * Environment variables to set before running the Task. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Required. The sequence of one or more runnables (executable scripts, + * executable containers, and/or barriers) for each task in this task group to + * run. Each task runs this list of runnables in order. For a task to succeed, + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Runnable runnables = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRunnables() + { + return $this->runnables; + } + + /** + * Required. The sequence of one or more runnables (executable scripts, + * executable containers, and/or barriers) for each task in this task group to + * run. Each task runs this list of runnables in order. For a task to succeed, + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Runnable runnables = 8; + * @param array<\Google\Cloud\Batch\V1\Runnable>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRunnables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Runnable::class); + $this->runnables = $arr; + + return $this; + } + + /** + * ComputeResource requirements. + * + * Generated from protobuf field .google.cloud.batch.v1.ComputeResource compute_resource = 3; + * @return \Google\Cloud\Batch\V1\ComputeResource|null + */ + public function getComputeResource() + { + return $this->compute_resource; + } + + public function hasComputeResource() + { + return isset($this->compute_resource); + } + + public function clearComputeResource() + { + unset($this->compute_resource); + } + + /** + * ComputeResource requirements. + * + * Generated from protobuf field .google.cloud.batch.v1.ComputeResource compute_resource = 3; + * @param \Google\Cloud\Batch\V1\ComputeResource $var + * @return $this + */ + public function setComputeResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\ComputeResource::class); + $this->compute_resource = $var; + + return $this; + } + + /** + * Maximum duration the task should run before being automatically retried + * (if enabled) or automatically failed. Format the value of this field + * as a time limit in seconds followed by `s`—for example, `3600s` + * for 1 hour. The field accepts any value between 0 and the maximum listed + * for the `Duration` field type at + * https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + * the actual maximum run time for a job will be limited to the maximum run + * time for a job listed at + * https://cloud.google.com/batch/quotas#max-job-duration. + * + * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxRunDuration() + { + return $this->max_run_duration; + } + + public function hasMaxRunDuration() + { + return isset($this->max_run_duration); + } + + public function clearMaxRunDuration() + { + unset($this->max_run_duration); + } + + /** + * Maximum duration the task should run before being automatically retried + * (if enabled) or automatically failed. Format the value of this field + * as a time limit in seconds followed by `s`—for example, `3600s` + * for 1 hour. The field accepts any value between 0 and the maximum listed + * for the `Duration` field type at + * https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + * the actual maximum run time for a job will be limited to the maximum run + * time for a job listed at + * https://cloud.google.com/batch/quotas#max-job-duration. + * + * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxRunDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_run_duration = $var; + + return $this; + } + + /** + * Maximum number of retries on failures. + * The default, 0, which means never retry. + * The valid value range is [0, 10]. + * + * Generated from protobuf field int32 max_retry_count = 5; + * @return int + */ + public function getMaxRetryCount() + { + return $this->max_retry_count; + } + + /** + * Maximum number of retries on failures. + * The default, 0, which means never retry. + * The valid value range is [0, 10]. + * + * Generated from protobuf field int32 max_retry_count = 5; + * @param int $var + * @return $this + */ + public function setMaxRetryCount($var) + { + GPBUtil::checkInt32($var); + $this->max_retry_count = $var; + + return $this; + } + + /** + * Lifecycle management schema when any task in a task group is failed. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. + * If task ends with non-zero exit code, retry the task with max_retry_count. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLifecyclePolicies() + { + return $this->lifecycle_policies; + } + + /** + * Lifecycle management schema when any task in a task group is failed. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. + * If task ends with non-zero exit code, retry the task with max_retry_count. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; + * @param array<\Google\Cloud\Batch\V1\LifecyclePolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLifecyclePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\LifecyclePolicy::class); + $this->lifecycle_policies = $arr; + + return $this; + } + + /** + * Deprecated: please use environment(non-plural) instead. + * + * Generated from protobuf field map environments = 6 [deprecated = true]; + * @return \Google\Protobuf\Internal\MapField + * @deprecated + */ + public function getEnvironments() + { + @trigger_error('environments is deprecated.', E_USER_DEPRECATED); + return $this->environments; + } + + /** + * Deprecated: please use environment(non-plural) instead. + * + * Generated from protobuf field map environments = 6 [deprecated = true]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + * @deprecated + */ + public function setEnvironments($var) + { + @trigger_error('environments is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->environments = $arr; + + return $this; + } + + /** + * Volumes to mount before running Tasks using this TaskSpec. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Volume volumes = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * Volumes to mount before running Tasks using this TaskSpec. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Volume volumes = 7; + * @param array<\Google\Cloud\Batch\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * Environment variables to set before running the Task. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 10; + * @return \Google\Cloud\Batch\V1\Environment|null + */ + public function getEnvironment() + { + return $this->environment; + } + + public function hasEnvironment() + { + return isset($this->environment); + } + + public function clearEnvironment() + { + unset($this->environment); + } + + /** + * Environment variables to set before running the Task. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 10; + * @param \Google\Cloud\Batch\V1\Environment $var + * @return $this + */ + public function setEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Environment::class); + $this->environment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus.php new file mode 100644 index 000000000000..8caeb3d3d49d --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus.php @@ -0,0 +1,101 @@ +google.cloud.batch.v1.TaskStatus + */ +class TaskStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Task state. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State state = 1; + */ + protected $state = 0; + /** + * Detailed info about why the state is reached. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + */ + private $status_events; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Task state. + * @type array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $status_events + * Detailed info about why the state is reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Task state. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Task state. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\TaskStatus\State::class); + $this->state = $var; + + return $this; + } + + /** + * Detailed info about why the state is reached. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStatusEvents() + { + return $this->status_events; + } + + /** + * Detailed info about why the state is reached. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + * @param array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStatusEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\StatusEvent::class); + $this->status_events = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus/State.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus/State.php new file mode 100644 index 000000000000..d74433bd3301 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus/State.php @@ -0,0 +1,92 @@ +google.cloud.batch.v1.TaskStatus.State + */ +class State +{ + /** + * Unknown state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The Task is created and waiting for resources. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The Task is assigned to at least one VM. + * + * Generated from protobuf enum ASSIGNED = 2; + */ + const ASSIGNED = 2; + /** + * The Task is running. + * + * Generated from protobuf enum RUNNING = 3; + */ + const RUNNING = 3; + /** + * The Task has failed. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + /** + * The Task has succeeded. + * + * Generated from protobuf enum SUCCEEDED = 5; + */ + const SUCCEEDED = 5; + /** + * The Task has not been executed when the Job finishes. + * + * Generated from protobuf enum UNEXECUTED = 6; + */ + const UNEXECUTED = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::ASSIGNED => 'ASSIGNED', + self::RUNNING => 'RUNNING', + self::FAILED => 'FAILED', + self::SUCCEEDED => 'SUCCEEDED', + self::UNEXECUTED => 'UNEXECUTED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Batch\V1\TaskStatus_State::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Volume.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Volume.php new file mode 100644 index 000000000000..c13f144d732c --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Volume.php @@ -0,0 +1,268 @@ +google.cloud.batch.v1.Volume + */ +class Volume extends \Google\Protobuf\Internal\Message +{ + /** + * The mount path for the volume, e.g. /mnt/disks/share. + * + * Generated from protobuf field string mount_path = 4; + */ + protected $mount_path = ''; + /** + * Mount options vary based on the type of storage volume: + * * For a Cloud Storage bucket, all the mount options provided + * by + * the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) + * are supported. + * * For an existing persistent disk, all mount options provided by the + * [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) + * except writing are supported. This is due to restrictions of + * [multi-writer + * mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + * * For any other disk or a Network File System (NFS), all the + * mount options provided by the `mount` command are supported. + * + * Generated from protobuf field repeated string mount_options = 5; + */ + private $mount_options; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Batch\V1\NFS $nfs + * A Network File System (NFS) volume. For example, a + * Filestore file share. + * @type \Google\Cloud\Batch\V1\GCS $gcs + * A Google Cloud Storage (GCS) volume. + * @type string $device_name + * Device name of an attached disk volume, which should align with a + * device_name specified by + * job.allocation_policy.instances[0].policy.disks[i].device_name or + * defined by the given instance template in + * job.allocation_policy.instances[0].instance_template. + * @type string $mount_path + * The mount path for the volume, e.g. /mnt/disks/share. + * @type array|\Google\Protobuf\Internal\RepeatedField $mount_options + * Mount options vary based on the type of storage volume: + * * For a Cloud Storage bucket, all the mount options provided + * by + * the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) + * are supported. + * * For an existing persistent disk, all mount options provided by the + * [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) + * except writing are supported. This is due to restrictions of + * [multi-writer + * mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + * * For any other disk or a Network File System (NFS), all the + * mount options provided by the `mount` command are supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Volume::initOnce(); + parent::__construct($data); + } + + /** + * A Network File System (NFS) volume. For example, a + * Filestore file share. + * + * Generated from protobuf field .google.cloud.batch.v1.NFS nfs = 1; + * @return \Google\Cloud\Batch\V1\NFS|null + */ + public function getNfs() + { + return $this->readOneof(1); + } + + public function hasNfs() + { + return $this->hasOneof(1); + } + + /** + * A Network File System (NFS) volume. For example, a + * Filestore file share. + * + * Generated from protobuf field .google.cloud.batch.v1.NFS nfs = 1; + * @param \Google\Cloud\Batch\V1\NFS $var + * @return $this + */ + public function setNfs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\NFS::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A Google Cloud Storage (GCS) volume. + * + * Generated from protobuf field .google.cloud.batch.v1.GCS gcs = 3; + * @return \Google\Cloud\Batch\V1\GCS|null + */ + public function getGcs() + { + return $this->readOneof(3); + } + + public function hasGcs() + { + return $this->hasOneof(3); + } + + /** + * A Google Cloud Storage (GCS) volume. + * + * Generated from protobuf field .google.cloud.batch.v1.GCS gcs = 3; + * @param \Google\Cloud\Batch\V1\GCS $var + * @return $this + */ + public function setGcs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\GCS::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Device name of an attached disk volume, which should align with a + * device_name specified by + * job.allocation_policy.instances[0].policy.disks[i].device_name or + * defined by the given instance template in + * job.allocation_policy.instances[0].instance_template. + * + * Generated from protobuf field string device_name = 6; + * @return string + */ + public function getDeviceName() + { + return $this->readOneof(6); + } + + public function hasDeviceName() + { + return $this->hasOneof(6); + } + + /** + * Device name of an attached disk volume, which should align with a + * device_name specified by + * job.allocation_policy.instances[0].policy.disks[i].device_name or + * defined by the given instance template in + * job.allocation_policy.instances[0].instance_template. + * + * Generated from protobuf field string device_name = 6; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The mount path for the volume, e.g. /mnt/disks/share. + * + * Generated from protobuf field string mount_path = 4; + * @return string + */ + public function getMountPath() + { + return $this->mount_path; + } + + /** + * The mount path for the volume, e.g. /mnt/disks/share. + * + * Generated from protobuf field string mount_path = 4; + * @param string $var + * @return $this + */ + public function setMountPath($var) + { + GPBUtil::checkString($var, True); + $this->mount_path = $var; + + return $this; + } + + /** + * Mount options vary based on the type of storage volume: + * * For a Cloud Storage bucket, all the mount options provided + * by + * the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) + * are supported. + * * For an existing persistent disk, all mount options provided by the + * [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) + * except writing are supported. This is due to restrictions of + * [multi-writer + * mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + * * For any other disk or a Network File System (NFS), all the + * mount options provided by the `mount` command are supported. + * + * Generated from protobuf field repeated string mount_options = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMountOptions() + { + return $this->mount_options; + } + + /** + * Mount options vary based on the type of storage volume: + * * For a Cloud Storage bucket, all the mount options provided + * by + * the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) + * are supported. + * * For an existing persistent disk, all mount options provided by the + * [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) + * except writing are supported. This is due to restrictions of + * [multi-writer + * mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + * * For any other disk or a Network File System (NFS), all the + * mount options provided by the `mount` command are supported. + * + * Generated from protobuf field repeated string mount_options = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMountOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->mount_options = $arr; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/create_job.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/create_job.php new file mode 100644 index 000000000000..78181b5873de --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/create_job.php @@ -0,0 +1,81 @@ +setTaskSpec($jobTaskGroupsTaskSpec); + $jobTaskGroups = [$taskGroup,]; + $job = (new Job()) + ->setTaskGroups($jobTaskGroups); + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job); + + // Call the API and handle any network failures. + try { + /** @var Job $response */ + $response = $batchServiceClient->createJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BatchServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + create_job_sample($formattedParent); +} +// [END batch_v1_generated_BatchService_CreateJob_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/delete_job.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/delete_job.php new file mode 100644 index 000000000000..2f18d5dabdf6 --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/delete_job.php @@ -0,0 +1,66 @@ +deleteJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END batch_v1_generated_BatchService_DeleteJob_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_job.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_job.php new file mode 100644 index 000000000000..df59d0831359 --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_job.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Job $response */ + $response = $batchServiceClient->getJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BatchServiceClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + get_job_sample($formattedName); +} +// [END batch_v1_generated_BatchService_GetJob_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_location.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_location.php new file mode 100644 index 000000000000..7a7ba7f1f70b --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END batch_v1_generated_BatchService_GetLocation_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_task.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_task.php new file mode 100644 index 000000000000..757f3239fecb --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_task.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Task $response */ + $response = $batchServiceClient->getTask($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BatchServiceClient::taskName( + '[PROJECT]', + '[LOCATION]', + '[JOB]', + '[TASK_GROUP]', + '[TASK]' + ); + + get_task_sample($formattedName); +} +// [END batch_v1_generated_BatchService_GetTask_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_jobs.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_jobs.php new file mode 100644 index 000000000000..98fb7d71673e --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_jobs.php @@ -0,0 +1,62 @@ +listJobs($request); + + /** @var Job $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END batch_v1_generated_BatchService_ListJobs_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_locations.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_locations.php new file mode 100644 index 000000000000..044396d5d16e --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END batch_v1_generated_BatchService_ListLocations_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_tasks.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_tasks.php new file mode 100644 index 000000000000..68b45472d029 --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_tasks.php @@ -0,0 +1,83 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $batchServiceClient->listTasks($request); + + /** @var Task $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BatchServiceClient::taskGroupName( + '[PROJECT]', + '[LOCATION]', + '[JOB]', + '[TASK_GROUP]' + ); + + list_tasks_sample($formattedParent); +} +// [END batch_v1_generated_BatchService_ListTasks_sync] diff --git a/owl-bot-staging/Batch/v1/src/V1/Client/BatchServiceClient.php b/owl-bot-staging/Batch/v1/src/V1/Client/BatchServiceClient.php new file mode 100644 index 000000000000..d46c00026859 --- /dev/null +++ b/owl-bot-staging/Batch/v1/src/V1/Client/BatchServiceClient.php @@ -0,0 +1,562 @@ + createJobAsync(CreateJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteJobAsync(DeleteJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface getJobAsync(GetJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface getTaskAsync(GetTaskRequest $request, array $optionalArgs = []) + * @method PromiseInterface listJobsAsync(ListJobsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTasksAsync(ListTasksRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class BatchServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.batch.v1.BatchService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'batch.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'batch.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/batch_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/batch_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/batch_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/batch_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a job + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * + * @return string The formatted job resource. + */ + public static function jobName(string $project, string $location, string $job): string + { + return self::getPathTemplate('job')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a task + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $taskGroup + * @param string $task + * + * @return string The formatted task resource. + */ + public static function taskName(string $project, string $location, string $job, string $taskGroup, string $task): string + { + return self::getPathTemplate('task')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'task_group' => $taskGroup, + 'task' => $task, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a task_group + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $taskGroup + * + * @return string The formatted task_group resource. + */ + public static function taskGroupName(string $project, string $location, string $job, string $taskGroup): string + { + return self::getPathTemplate('taskGroup')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'task_group' => $taskGroup, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - job: projects/{project}/locations/{location}/jobs/{job} + * - location: projects/{project}/locations/{location} + * - task: projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task} + * - taskGroup: projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'batch.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Create a Job. + * + * The async variant is {@see BatchServiceClient::createJobAsync()} . + * + * @example samples/V1/BatchServiceClient/create_job.php + * + * @param CreateJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Job + * + * @throws ApiException Thrown if the API call fails. + */ + public function createJob(CreateJobRequest $request, array $callOptions = []): Job + { + return $this->startApiCall('CreateJob', $request, $callOptions)->wait(); + } + + /** + * Delete a Job. + * + * The async variant is {@see BatchServiceClient::deleteJobAsync()} . + * + * @example samples/V1/BatchServiceClient/delete_job.php + * + * @param DeleteJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteJob(DeleteJobRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteJob', $request, $callOptions)->wait(); + } + + /** + * Get a Job specified by its resource name. + * + * The async variant is {@see BatchServiceClient::getJobAsync()} . + * + * @example samples/V1/BatchServiceClient/get_job.php + * + * @param GetJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Job + * + * @throws ApiException Thrown if the API call fails. + */ + public function getJob(GetJobRequest $request, array $callOptions = []): Job + { + return $this->startApiCall('GetJob', $request, $callOptions)->wait(); + } + + /** + * Return a single Task. + * + * The async variant is {@see BatchServiceClient::getTaskAsync()} . + * + * @example samples/V1/BatchServiceClient/get_task.php + * + * @param GetTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Task + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTask(GetTaskRequest $request, array $callOptions = []): Task + { + return $this->startApiCall('GetTask', $request, $callOptions)->wait(); + } + + /** + * List all Jobs for a project within a region. + * + * The async variant is {@see BatchServiceClient::listJobsAsync()} . + * + * @example samples/V1/BatchServiceClient/list_jobs.php + * + * @param ListJobsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listJobs(ListJobsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListJobs', $request, $callOptions); + } + + /** + * List Tasks associated with a job. + * + * The async variant is {@see BatchServiceClient::listTasksAsync()} . + * + * @example samples/V1/BatchServiceClient/list_tasks.php + * + * @param ListTasksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTasks(ListTasksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTasks', $request, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see BatchServiceClient::getLocationAsync()} . + * + * @example samples/V1/BatchServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see BatchServiceClient::listLocationsAsync()} . + * + * @example samples/V1/BatchServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Batch/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Batch/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..eae7f15d2f08 --- /dev/null +++ b/owl-bot-staging/Batch/v1/src/V1/gapic_metadata.json @@ -0,0 +1,58 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.batch.v1", + "libraryPackage": "Google\\Cloud\\Batch\\V1", + "services": { + "BatchService": { + "clients": { + "grpc": { + "libraryClient": "BatchServiceGapicClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "ListJobs": { + "methods": [ + "listJobs" + ] + }, + "ListTasks": { + "methods": [ + "listTasks" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_client_config.json b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_client_config.json new file mode 100644 index 000000000000..4fae7bea9f19 --- /dev/null +++ b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_client_config.json @@ -0,0 +1,84 @@ +{ + "interfaces": { + "google.cloud.batch.v1.BatchService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetJob": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTask": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTasks": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_descriptor_config.php b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_descriptor_config.php new file mode 100644 index 000000000000..8618662401e1 --- /dev/null +++ b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_descriptor_config.php @@ -0,0 +1,163 @@ + [ + 'google.cloud.batch.v1.BatchService' => [ + 'DeleteJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Batch\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Batch\V1\Job', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Batch\V1\Job', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Batch\V1\Task', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListJobs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getJobs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Batch\V1\ListJobsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListTasks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTasks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Batch\V1\ListTasksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'job' => 'projects/{project}/locations/{location}/jobs/{job}', + 'location' => 'projects/{project}/locations/{location}', + 'task' => 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}', + 'taskGroup' => 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_rest_client_config.php b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_rest_client_config.php new file mode 100644 index 000000000000..53dc86dfd5dc --- /dev/null +++ b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_rest_client_config.php @@ -0,0 +1,167 @@ + [ + 'google.cloud.batch.v1.BatchService' => [ + 'CreateJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/jobs', + 'body' => 'job', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteJob' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetJob' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListJobs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/jobs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Batch/v1/tests/Unit/V1/Client/BatchServiceClientTest.php b/owl-bot-staging/Batch/v1/tests/Unit/V1/Client/BatchServiceClientTest.php new file mode 100644 index 000000000000..524f1fafb188 --- /dev/null +++ b/owl-bot-staging/Batch/v1/tests/Unit/V1/Client/BatchServiceClientTest.php @@ -0,0 +1,701 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BatchServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BatchServiceClient($options); + } + + /** @test */ + public function createJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $priority = 1165461084; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setPriority($priority); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $jobTaskGroups = []; + $job->setTaskGroups($jobTaskGroups); + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job); + $response = $gapicClient->createJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.batch.v1.BatchService/CreateJob', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createJobExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $jobTaskGroups = []; + $job->setTaskGroups($jobTaskGroups); + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job); + try { + $gapicClient->createJob($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $request = new DeleteJobRequest(); + $response = $gapicClient->deleteJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.batch.v1.BatchService/DeleteJob', $actualApiFuncCall); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteJobTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + $request = new DeleteJobRequest(); + $response = $gapicClient->deleteJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteJobTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $priority = 1165461084; + $expectedResponse = new Job(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setPriority($priority); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new GetJobRequest()) + ->setName($formattedName); + $response = $gapicClient->getJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.batch.v1.BatchService/GetJob', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getJobExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new GetJobRequest()) + ->setName($formattedName); + try { + $gapicClient->getJob($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]', '[TASK]'); + $request = (new GetTaskRequest()) + ->setName($formattedName); + $response = $gapicClient->getTask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.batch.v1.BatchService/GetTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]', '[TASK]'); + $request = (new GetTaskRequest()) + ->setName($formattedName); + try { + $gapicClient->getTask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listJobsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $jobsElement = new Job(); + $jobs = [ + $jobsElement, + ]; + $expectedResponse = new ListJobsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setJobs($jobs); + $transport->addResponse($expectedResponse); + $request = new ListJobsRequest(); + $response = $gapicClient->listJobs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getJobs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.batch.v1.BatchService/ListJobs', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listJobsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListJobsRequest(); + try { + $gapicClient->listJobs($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tasksElement = new Task(); + $tasks = [ + $tasksElement, + ]; + $expectedResponse = new ListTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTasks($tasks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->taskGroupName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]'); + $request = (new ListTasksRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listTasks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.batch.v1.BatchService/ListTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->taskGroupName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]'); + $request = (new ListTasksRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listTasks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createJobAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $priority = 1165461084; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setPriority($priority); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $jobTaskGroups = []; + $job->setTaskGroups($jobTaskGroups); + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job); + $response = $gapicClient->createJobAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.batch.v1.BatchService/CreateJob', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnections/V1/AppConnectionsService.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnections/V1/AppConnectionsService.php new file mode 100644 index 000000000000..2f156c3df8dc Binary files /dev/null and b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnections/V1/AppConnectionsService.php differ diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection.php new file mode 100644 index 000000000000..f676e051925c --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection.php @@ -0,0 +1,470 @@ +google.cloud.beyondcorp.appconnections.v1.AppConnection + */ +class AppConnection extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Unique resource name of the AppConnection. + * The name is ignored when creating a AppConnection. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Timestamp when the resource was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Resource labels to represent user provided metadata. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. An arbitrary user-provided name for the AppConnection. Cannot + * exceed 64 characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Output only. A unique identifier for the instance generated by the + * system. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Required. The type of network connectivity used by the AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + /** + * Required. Address of the remote application endpoint for the BeyondCorp + * AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $application_endpoint = null; + /** + * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are + * authorised to be associated with this AppConnection. + * + * Generated from protobuf field repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $connectors; + /** + * Output only. The current state of the AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. Gateway used by the AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $gateway = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Unique resource name of the AppConnection. + * The name is ignored when creating a AppConnection. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp when the resource was last modified. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels to represent user provided metadata. + * @type string $display_name + * Optional. An arbitrary user-provided name for the AppConnection. Cannot + * exceed 64 characters. + * @type string $uid + * Output only. A unique identifier for the instance generated by the + * system. + * @type int $type + * Required. The type of network connectivity used by the AppConnection. + * @type \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection\ApplicationEndpoint $application_endpoint + * Required. Address of the remote application endpoint for the BeyondCorp + * AppConnection. + * @type array|\Google\Protobuf\Internal\RepeatedField $connectors + * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are + * authorised to be associated with this AppConnection. + * @type int $state + * Output only. The current state of the AppConnection. + * @type \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection\Gateway $gateway + * Optional. Gateway used by the AppConnection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Unique resource name of the AppConnection. + * The name is ignored when creating a AppConnection. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Unique resource name of the AppConnection. + * The name is ignored when creating a AppConnection. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Timestamp when the resource was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Timestamp when the resource was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. An arbitrary user-provided name for the AppConnection. Cannot + * exceed 64 characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. An arbitrary user-provided name for the AppConnection. Cannot + * exceed 64 characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. A unique identifier for the instance generated by the + * system. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A unique identifier for the instance generated by the + * system. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Required. The type of network connectivity used by the AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The type of network connectivity used by the AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Required. Address of the remote application endpoint for the BeyondCorp + * AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection\ApplicationEndpoint|null + */ + public function getApplicationEndpoint() + { + return $this->application_endpoint; + } + + public function hasApplicationEndpoint() + { + return isset($this->application_endpoint); + } + + public function clearApplicationEndpoint() + { + unset($this->application_endpoint); + } + + /** + * Required. Address of the remote application endpoint for the BeyondCorp + * AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection\ApplicationEndpoint $var + * @return $this + */ + public function setApplicationEndpoint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection\ApplicationEndpoint::class); + $this->application_endpoint = $var; + + return $this; + } + + /** + * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are + * authorised to be associated with this AppConnection. + * + * Generated from protobuf field repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConnectors() + { + return $this->connectors; + } + + /** + * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are + * authorised to be associated with this AppConnection. + * + * Generated from protobuf field repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConnectors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->connectors = $arr; + + return $this; + } + + /** + * Output only. The current state of the AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Gateway used by the AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection\Gateway|null + */ + public function getGateway() + { + return $this->gateway; + } + + public function hasGateway() + { + return isset($this->gateway); + } + + public function clearGateway() + { + unset($this->gateway); + } + + /** + * Optional. Gateway used by the AppConnection. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection\Gateway $var + * @return $this + */ + public function setGateway($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection\Gateway::class); + $this->gateway = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/ApplicationEndpoint.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/ApplicationEndpoint.php new file mode 100644 index 000000000000..cc68ac49a44e --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/ApplicationEndpoint.php @@ -0,0 +1,104 @@ +google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + */ +class ApplicationEndpoint extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Hostname or IP address of the remote application endpoint. + * + * Generated from protobuf field string host = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $host = ''; + /** + * Required. Port of the remote application endpoint. + * + * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $port = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host + * Required. Hostname or IP address of the remote application endpoint. + * @type int $port + * Required. Port of the remote application endpoint. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Hostname or IP address of the remote application endpoint. + * + * Generated from protobuf field string host = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * Required. Hostname or IP address of the remote application endpoint. + * + * Generated from protobuf field string host = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * Required. Port of the remote application endpoint. + * + * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Required. Port of the remote application endpoint. + * + * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ApplicationEndpoint::class, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection_ApplicationEndpoint::class); + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/Gateway.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/Gateway.php new file mode 100644 index 000000000000..6af8ac8c19f7 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/Gateway.php @@ -0,0 +1,181 @@ +google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway + */ +class Gateway extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The type of hosting used by the gateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + /** + * Output only. Server-defined URI for this resource. + * + * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uri = ''; + /** + * Output only. Ingress port reserved on the gateways for this + * AppConnection, if not specified or zero, the default port is 19443. + * + * Generated from protobuf field int32 ingress_port = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ingress_port = 0; + /** + * Required. AppGateway name in following format: + * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}` + * + * Generated from protobuf field string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $app_gateway = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Required. The type of hosting used by the gateway. + * @type string $uri + * Output only. Server-defined URI for this resource. + * @type int $ingress_port + * Output only. Ingress port reserved on the gateways for this + * AppConnection, if not specified or zero, the default port is 19443. + * @type string $app_gateway + * Required. AppGateway name in following format: + * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The type of hosting used by the gateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The type of hosting used by the gateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection\Gateway\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. Server-defined URI for this resource. + * + * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Output only. Server-defined URI for this resource. + * + * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Output only. Ingress port reserved on the gateways for this + * AppConnection, if not specified or zero, the default port is 19443. + * + * Generated from protobuf field int32 ingress_port = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getIngressPort() + { + return $this->ingress_port; + } + + /** + * Output only. Ingress port reserved on the gateways for this + * AppConnection, if not specified or zero, the default port is 19443. + * + * Generated from protobuf field int32 ingress_port = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setIngressPort($var) + { + GPBUtil::checkInt32($var); + $this->ingress_port = $var; + + return $this; + } + + /** + * Required. AppGateway name in following format: + * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}` + * + * Generated from protobuf field string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAppGateway() + { + return $this->app_gateway; + } + + /** + * Required. AppGateway name in following format: + * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}` + * + * Generated from protobuf field string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAppGateway($var) + { + GPBUtil::checkString($var, True); + $this->app_gateway = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Gateway::class, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection_Gateway::class); + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/Gateway/Type.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/Gateway/Type.php new file mode 100644 index 000000000000..9f600d8afa1b --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/Gateway/Type.php @@ -0,0 +1,57 @@ +google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type + */ +class Type +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Gateway hosted in a GCP regional managed instance group. + * + * Generated from protobuf enum GCP_REGIONAL_MIG = 1; + */ + const GCP_REGIONAL_MIG = 1; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::GCP_REGIONAL_MIG => 'GCP_REGIONAL_MIG', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection_Gateway_Type::class); + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/State.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/State.php new file mode 100644 index 000000000000..28c1781608b2 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/State.php @@ -0,0 +1,86 @@ +google.cloud.beyondcorp.appconnections.v1.AppConnection.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * AppConnection is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * AppConnection has been created. + * + * Generated from protobuf enum CREATED = 2; + */ + const CREATED = 2; + /** + * AppConnection's configuration is being updated. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * AppConnection is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * AppConnection is down and may be restored in the future. + * This happens when CCFE sends ProjectState = OFF. + * + * Generated from protobuf enum DOWN = 5; + */ + const DOWN = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::CREATED => 'CREATED', + self::UPDATING => 'UPDATING', + self::DELETING => 'DELETING', + self::DOWN => 'DOWN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection_State::class); + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/Type.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/Type.php new file mode 100644 index 000000000000..d3a6ffd1e4e5 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnection/Type.php @@ -0,0 +1,59 @@ +google.cloud.beyondcorp.appconnections.v1.AppConnection.Type + */ +class Type +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * TCP Proxy based BeyondCorp AppConnection. API will default to this if + * unset. + * + * Generated from protobuf enum TCP_PROXY = 1; + */ + const TCP_PROXY = 1; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::TCP_PROXY => 'TCP_PROXY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection_Type::class); + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnectionOperationMetadata.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnectionOperationMetadata.php new file mode 100644 index 000000000000..e2ee3aedca33 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/AppConnectionOperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + */ +class AppConnectionOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/CreateAppConnectionRequest.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/CreateAppConnectionRequest.php new file mode 100644 index 000000000000..ef54860b1978 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/CreateAppConnectionRequest.php @@ -0,0 +1,295 @@ +google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest + */ +class CreateAppConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource project name of the AppConnection location using the + * form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. User-settable AppConnection resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $app_connection_id = ''; + /** + * Required. A BeyondCorp AppConnection resource. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $app_connection = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The resource project name of the AppConnection location using the + * form: `projects/{project_id}/locations/{location_id}` + * Please see {@see AppConnectionsServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection $appConnection Required. A BeyondCorp AppConnection resource. + * @param string $appConnectionId Optional. User-settable AppConnection resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * @return \Google\Cloud\BeyondCorp\AppConnections\V1\CreateAppConnectionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection $appConnection, string $appConnectionId): self + { + return (new self()) + ->setParent($parent) + ->setAppConnection($appConnection) + ->setAppConnectionId($appConnectionId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource project name of the AppConnection location using the + * form: `projects/{project_id}/locations/{location_id}` + * @type string $app_connection_id + * Optional. User-settable AppConnection resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * @type \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection $app_connection + * Required. A BeyondCorp AppConnection resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource project name of the AppConnection location using the + * form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource project name of the AppConnection location using the + * form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. User-settable AppConnection resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAppConnectionId() + { + return $this->app_connection_id; + } + + /** + * Optional. User-settable AppConnection resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAppConnectionId($var) + { + GPBUtil::checkString($var, True); + $this->app_connection_id = $var; + + return $this; + } + + /** + * Required. A BeyondCorp AppConnection resource. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection|null + */ + public function getAppConnection() + { + return $this->app_connection; + } + + public function hasAppConnection() + { + return isset($this->app_connection); + } + + public function clearAppConnection() + { + unset($this->app_connection); + } + + /** + * Required. A BeyondCorp AppConnection resource. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection $var + * @return $this + */ + public function setAppConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection::class); + $this->app_connection = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/DeleteAppConnectionRequest.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/DeleteAppConnectionRequest.php new file mode 100644 index 000000000000..33d06fe0c0a5 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/DeleteAppConnectionRequest.php @@ -0,0 +1,198 @@ +google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest + */ +class DeleteAppConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * Please see {@see AppConnectionsServiceClient::appConnectionName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\AppConnections\V1\DeleteAppConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/GetAppConnectionRequest.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/GetAppConnectionRequest.php new file mode 100644 index 000000000000..cbda1a28657b --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/GetAppConnectionRequest.php @@ -0,0 +1,86 @@ +google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest + */ +class GetAppConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. BeyondCorp AppConnection name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. BeyondCorp AppConnection name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * Please see {@see AppConnectionsServiceClient::appConnectionName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\AppConnections\V1\GetAppConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. BeyondCorp AppConnection name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. BeyondCorp AppConnection name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. BeyondCorp AppConnection name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ListAppConnectionsRequest.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ListAppConnectionsRequest.php new file mode 100644 index 000000000000..f2beaa7375a7 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ListAppConnectionsRequest.php @@ -0,0 +1,258 @@ +google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest + */ +class ListAppConnectionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppConnectionsResponse.next_page_token] to + * determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous + * ListAppConnectionsRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter specifying constraints of a list operation. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * Please see {@see AppConnectionsServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\AppConnections\V1\ListAppConnectionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * @type int $page_size + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppConnectionsResponse.next_page_token] to + * determine if there are more instances left to be queried. + * @type string $page_token + * Optional. The next_page_token value returned from a previous + * ListAppConnectionsRequest, if any. + * @type string $filter + * Optional. A filter specifying constraints of a list operation. + * @type string $order_by + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppConnectionsResponse.next_page_token] to + * determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppConnectionsResponse.next_page_token] to + * determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous + * ListAppConnectionsRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous + * ListAppConnectionsRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter specifying constraints of a list operation. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter specifying constraints of a list operation. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ListAppConnectionsResponse.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ListAppConnectionsResponse.php new file mode 100644 index 000000000000..31f3294ce77d --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ListAppConnectionsResponse.php @@ -0,0 +1,139 @@ +google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse + */ +class ListAppConnectionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of BeyondCorp AppConnections in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + */ + private $app_connections; + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection>|\Google\Protobuf\Internal\RepeatedField $app_connections + * A list of BeyondCorp AppConnections in the project. + * @type string $next_page_token + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * A list of locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * A list of BeyondCorp AppConnections in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppConnections() + { + return $this->app_connections; + } + + /** + * A list of BeyondCorp AppConnections in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * @param array<\Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection::class); + $this->app_connections = $arr; + + return $this; + } + + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ResolveAppConnectionsRequest.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ResolveAppConnectionsRequest.php new file mode 100644 index 000000000000..d35e11b22f80 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ResolveAppConnectionsRequest.php @@ -0,0 +1,220 @@ +google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + */ +class ResolveAppConnectionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. BeyondCorp Connector name of the connector associated with those + * AppConnections using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * + * Generated from protobuf field string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $app_connector_id = ''; + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ResolveAppConnectionsResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous + * ResolveAppConnectionsResponse, if any. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * Please see {@see AppConnectionsServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\AppConnections\V1\ResolveAppConnectionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * @type string $app_connector_id + * Required. BeyondCorp Connector name of the connector associated with those + * AppConnections using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * @type int $page_size + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ResolveAppConnectionsResponse.next_page_token] + * to determine if there are more instances left to be queried. + * @type string $page_token + * Optional. The next_page_token value returned from a previous + * ResolveAppConnectionsResponse, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. BeyondCorp Connector name of the connector associated with those + * AppConnections using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * + * Generated from protobuf field string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAppConnectorId() + { + return $this->app_connector_id; + } + + /** + * Required. BeyondCorp Connector name of the connector associated with those + * AppConnections using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * + * Generated from protobuf field string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAppConnectorId($var) + { + GPBUtil::checkString($var, True); + $this->app_connector_id = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ResolveAppConnectionsResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ResolveAppConnectionsResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous + * ResolveAppConnectionsResponse, if any. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous + * ResolveAppConnectionsResponse, if any. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ResolveAppConnectionsResponse.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ResolveAppConnectionsResponse.php new file mode 100644 index 000000000000..9c3bf3d32526 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ResolveAppConnectionsResponse.php @@ -0,0 +1,139 @@ +google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + */ +class ResolveAppConnectionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of BeyondCorp AppConnections with details in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + */ + private $app_connection_details; + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BeyondCorp\AppConnections\V1\ResolveAppConnectionsResponse\AppConnectionDetails>|\Google\Protobuf\Internal\RepeatedField $app_connection_details + * A list of BeyondCorp AppConnections with details in the project. + * @type string $next_page_token + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * A list of locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * A list of BeyondCorp AppConnections with details in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppConnectionDetails() + { + return $this->app_connection_details; + } + + /** + * A list of BeyondCorp AppConnections with details in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * @param array<\Google\Cloud\BeyondCorp\AppConnections\V1\ResolveAppConnectionsResponse\AppConnectionDetails>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppConnectionDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BeyondCorp\AppConnections\V1\ResolveAppConnectionsResponse\AppConnectionDetails::class); + $this->app_connection_details = $arr; + + return $this; + } + + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ResolveAppConnectionsResponse/AppConnectionDetails.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ResolveAppConnectionsResponse/AppConnectionDetails.php new file mode 100644 index 000000000000..9ca817de9125 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/ResolveAppConnectionsResponse/AppConnectionDetails.php @@ -0,0 +1,118 @@ +google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails + */ +class AppConnectionDetails extends \Google\Protobuf\Internal\Message +{ + /** + * A BeyondCorp AppConnection in the project. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + */ + protected $app_connection = null; + /** + * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like + * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`. + * + * Generated from protobuf field repeated string recent_mig_vms = 2; + */ + private $recent_mig_vms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection $app_connection + * A BeyondCorp AppConnection in the project. + * @type array|\Google\Protobuf\Internal\RepeatedField $recent_mig_vms + * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like + * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * A BeyondCorp AppConnection in the project. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + * @return \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection|null + */ + public function getAppConnection() + { + return $this->app_connection; + } + + public function hasAppConnection() + { + return isset($this->app_connection); + } + + public function clearAppConnection() + { + unset($this->app_connection); + } + + /** + * A BeyondCorp AppConnection in the project. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + * @param \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection $var + * @return $this + */ + public function setAppConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection::class); + $this->app_connection = $var; + + return $this; + } + + /** + * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like + * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`. + * + * Generated from protobuf field repeated string recent_mig_vms = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRecentMigVms() + { + return $this->recent_mig_vms; + } + + /** + * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like + * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`. + * + * Generated from protobuf field repeated string recent_mig_vms = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRecentMigVms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->recent_mig_vms = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AppConnectionDetails::class, \Google\Cloud\BeyondCorp\AppConnections\V1\ResolveAppConnectionsResponse_AppConnectionDetails::class); + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/UpdateAppConnectionRequest.php b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/UpdateAppConnectionRequest.php new file mode 100644 index 000000000000..84b98cfce15c --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/proto/src/Google/Cloud/BeyondCorp/AppConnections/V1/UpdateAppConnectionRequest.php @@ -0,0 +1,317 @@ +google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest + */ +class UpdateAppConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [BeyondCorp.AppConnection]: + * * `labels` + * * `display_name` + * * `application_endpoint` + * * `connectors` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. AppConnection message with updated fields. Only supported fields + * specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $app_connection = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set as true, will create the resource if it is not found. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection $appConnection Required. AppConnection message with updated fields. Only supported fields + * specified in update_mask are updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [BeyondCorp.AppConnection]: + * * `labels` + * * `display_name` + * * `application_endpoint` + * * `connectors` + * + * @return \Google\Cloud\BeyondCorp\AppConnections\V1\UpdateAppConnectionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection $appConnection, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAppConnection($appConnection) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [BeyondCorp.AppConnection]: + * * `labels` + * * `display_name` + * * `application_endpoint` + * * `connectors` + * @type \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection $app_connection + * Required. AppConnection message with updated fields. Only supported fields + * specified in update_mask are updated. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * @type bool $allow_missing + * Optional. If set as true, will create the resource if it is not found. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnections\V1\AppConnectionsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [BeyondCorp.AppConnection]: + * * `labels` + * * `display_name` + * * `application_endpoint` + * * `connectors` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [BeyondCorp.AppConnection]: + * * `labels` + * * `display_name` + * * `application_endpoint` + * * `connectors` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. AppConnection message with updated fields. Only supported fields + * specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection|null + */ + public function getAppConnection() + { + return $this->app_connection; + } + + public function hasAppConnection() + { + return isset($this->app_connection); + } + + public function clearAppConnection() + { + unset($this->app_connection); + } + + /** + * Required. AppConnection message with updated fields. Only supported fields + * specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection $var + * @return $this + */ + public function setAppConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection::class); + $this->app_connection = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set as true, will create the resource if it is not found. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set as true, will create the resource if it is not found. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/create_app_connection.php b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/create_app_connection.php new file mode 100644 index 000000000000..84acfb20a8fb --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/create_app_connection.php @@ -0,0 +1,114 @@ +setHost($appConnectionApplicationEndpointHost) + ->setPort($appConnectionApplicationEndpointPort); + $appConnection = (new AppConnection()) + ->setName($appConnectionName) + ->setType($appConnectionType) + ->setApplicationEndpoint($appConnectionApplicationEndpoint); + $request = (new CreateAppConnectionRequest()) + ->setParent($formattedParent) + ->setAppConnection($appConnection); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $appConnectionsServiceClient->createAppConnection($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AppConnection $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AppConnectionsServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $appConnectionName = '[NAME]'; + $appConnectionType = Type::TYPE_UNSPECIFIED; + $appConnectionApplicationEndpointHost = '[HOST]'; + $appConnectionApplicationEndpointPort = 0; + + create_app_connection_sample( + $formattedParent, + $appConnectionName, + $appConnectionType, + $appConnectionApplicationEndpointHost, + $appConnectionApplicationEndpointPort + ); +} +// [END beyondcorp_v1_generated_AppConnectionsService_CreateAppConnection_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/delete_app_connection.php b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/delete_app_connection.php new file mode 100644 index 000000000000..8c7725f0d034 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/delete_app_connection.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $appConnectionsServiceClient->deleteAppConnection($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AppConnectionsServiceClient::appConnectionName( + '[PROJECT]', + '[LOCATION]', + '[APP_CONNECTION]' + ); + + delete_app_connection_sample($formattedName); +} +// [END beyondcorp_v1_generated_AppConnectionsService_DeleteAppConnection_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/get_app_connection.php b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/get_app_connection.php new file mode 100644 index 000000000000..0482a7e89fc6 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/get_app_connection.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AppConnection $response */ + $response = $appConnectionsServiceClient->getAppConnection($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AppConnectionsServiceClient::appConnectionName( + '[PROJECT]', + '[LOCATION]', + '[APP_CONNECTION]' + ); + + get_app_connection_sample($formattedName); +} +// [END beyondcorp_v1_generated_AppConnectionsService_GetAppConnection_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/get_iam_policy.php b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..b5bc9e67f380 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $appConnectionsServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END beyondcorp_v1_generated_AppConnectionsService_GetIamPolicy_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/get_location.php b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/get_location.php new file mode 100644 index 000000000000..71164e34a912 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END beyondcorp_v1_generated_AppConnectionsService_GetLocation_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/list_app_connections.php b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/list_app_connections.php new file mode 100644 index 000000000000..2e52e3057db4 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/list_app_connections.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $appConnectionsServiceClient->listAppConnections($request); + + /** @var AppConnection $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AppConnectionsServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_app_connections_sample($formattedParent); +} +// [END beyondcorp_v1_generated_AppConnectionsService_ListAppConnections_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/list_locations.php b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/list_locations.php new file mode 100644 index 000000000000..632c9a180f99 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END beyondcorp_v1_generated_AppConnectionsService_ListLocations_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/resolve_app_connections.php b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/resolve_app_connections.php new file mode 100644 index 000000000000..2f6042c74432 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/resolve_app_connections.php @@ -0,0 +1,91 @@ +setParent($formattedParent) + ->setAppConnectorId($formattedAppConnectorId); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $appConnectionsServiceClient->resolveAppConnections($request); + + /** @var AppConnectionDetails $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AppConnectionsServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $formattedAppConnectorId = AppConnectionsServiceClient::appConnectorName( + '[PROJECT]', + '[LOCATION]', + '[APP_CONNECTOR]' + ); + + resolve_app_connections_sample($formattedParent, $formattedAppConnectorId); +} +// [END beyondcorp_v1_generated_AppConnectionsService_ResolveAppConnections_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/set_iam_policy.php b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..a0839d476b56 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $appConnectionsServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END beyondcorp_v1_generated_AppConnectionsService_SetIamPolicy_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/test_iam_permissions.php b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..d58bf6839467 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $appConnectionsServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END beyondcorp_v1_generated_AppConnectionsService_TestIamPermissions_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/update_app_connection.php b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/update_app_connection.php new file mode 100644 index 000000000000..82b501555371 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/samples/V1/AppConnectionsServiceClient/update_app_connection.php @@ -0,0 +1,110 @@ +setHost($appConnectionApplicationEndpointHost) + ->setPort($appConnectionApplicationEndpointPort); + $appConnection = (new AppConnection()) + ->setName($appConnectionName) + ->setType($appConnectionType) + ->setApplicationEndpoint($appConnectionApplicationEndpoint); + $request = (new UpdateAppConnectionRequest()) + ->setUpdateMask($updateMask) + ->setAppConnection($appConnection); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $appConnectionsServiceClient->updateAppConnection($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AppConnection $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $appConnectionName = '[NAME]'; + $appConnectionType = Type::TYPE_UNSPECIFIED; + $appConnectionApplicationEndpointHost = '[HOST]'; + $appConnectionApplicationEndpointPort = 0; + + update_app_connection_sample( + $appConnectionName, + $appConnectionType, + $appConnectionApplicationEndpointHost, + $appConnectionApplicationEndpointPort + ); +} +// [END beyondcorp_v1_generated_AppConnectionsService_UpdateAppConnection_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/Client/AppConnectionsServiceClient.php b/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/Client/AppConnectionsServiceClient.php new file mode 100644 index 000000000000..c17a2d2d0bba --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/Client/AppConnectionsServiceClient.php @@ -0,0 +1,672 @@ + createAppConnectionAsync(CreateAppConnectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAppConnectionAsync(DeleteAppConnectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAppConnectionAsync(GetAppConnectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAppConnectionsAsync(ListAppConnectionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface resolveAppConnectionsAsync(ResolveAppConnectionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAppConnectionAsync(UpdateAppConnectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class AppConnectionsServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.beyondcorp.appconnections.v1.AppConnectionsService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'beyondcorp.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'beyondcorp.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/app_connections_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/app_connections_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/app_connections_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/app_connections_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * app_connection resource. + * + * @param string $project + * @param string $location + * @param string $appConnection + * + * @return string The formatted app_connection resource. + */ + public static function appConnectionName(string $project, string $location, string $appConnection): string + { + return self::getPathTemplate('appConnection')->render([ + 'project' => $project, + 'location' => $location, + 'app_connection' => $appConnection, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * app_connector resource. + * + * @param string $project + * @param string $location + * @param string $appConnector + * + * @return string The formatted app_connector resource. + */ + public static function appConnectorName(string $project, string $location, string $appConnector): string + { + return self::getPathTemplate('appConnector')->render([ + 'project' => $project, + 'location' => $location, + 'app_connector' => $appConnector, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a app_gateway + * resource. + * + * @param string $project + * @param string $location + * @param string $appGateway + * + * @return string The formatted app_gateway resource. + */ + public static function appGatewayName(string $project, string $location, string $appGateway): string + { + return self::getPathTemplate('appGateway')->render([ + 'project' => $project, + 'location' => $location, + 'app_gateway' => $appGateway, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - appConnection: projects/{project}/locations/{location}/appConnections/{app_connection} + * - appConnector: projects/{project}/locations/{location}/appConnectors/{app_connector} + * - appGateway: projects/{project}/locations/{location}/appGateways/{app_gateway} + * - location: projects/{project}/locations/{location} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'beyondcorp.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new AppConnection in a given project and location. + * + * The async variant is + * {@see AppConnectionsServiceClient::createAppConnectionAsync()} . + * + * @example samples/V1/AppConnectionsServiceClient/create_app_connection.php + * + * @param CreateAppConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAppConnection(CreateAppConnectionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateAppConnection', $request, $callOptions)->wait(); + } + + /** + * Deletes a single AppConnection. + * + * The async variant is + * {@see AppConnectionsServiceClient::deleteAppConnectionAsync()} . + * + * @example samples/V1/AppConnectionsServiceClient/delete_app_connection.php + * + * @param DeleteAppConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAppConnection(DeleteAppConnectionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteAppConnection', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single AppConnection. + * + * The async variant is {@see AppConnectionsServiceClient::getAppConnectionAsync()} + * . + * + * @example samples/V1/AppConnectionsServiceClient/get_app_connection.php + * + * @param GetAppConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AppConnection + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAppConnection(GetAppConnectionRequest $request, array $callOptions = []): AppConnection + { + return $this->startApiCall('GetAppConnection', $request, $callOptions)->wait(); + } + + /** + * Lists AppConnections in a given project and location. + * + * The async variant is + * {@see AppConnectionsServiceClient::listAppConnectionsAsync()} . + * + * @example samples/V1/AppConnectionsServiceClient/list_app_connections.php + * + * @param ListAppConnectionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAppConnections(ListAppConnectionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAppConnections', $request, $callOptions); + } + + /** + * Resolves AppConnections details for a given AppConnector. + * An internal method called by a connector to find AppConnections to connect + * to. + * + * The async variant is + * {@see AppConnectionsServiceClient::resolveAppConnectionsAsync()} . + * + * @example samples/V1/AppConnectionsServiceClient/resolve_app_connections.php + * + * @param ResolveAppConnectionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resolveAppConnections(ResolveAppConnectionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ResolveAppConnections', $request, $callOptions); + } + + /** + * Updates the parameters of a single AppConnection. + * + * The async variant is + * {@see AppConnectionsServiceClient::updateAppConnectionAsync()} . + * + * @example samples/V1/AppConnectionsServiceClient/update_app_connection.php + * + * @param UpdateAppConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAppConnection(UpdateAppConnectionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateAppConnection', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AppConnectionsServiceClient::getLocationAsync()} . + * + * @example samples/V1/AppConnectionsServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see AppConnectionsServiceClient::listLocationsAsync()} . + * + * @example samples/V1/AppConnectionsServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see AppConnectionsServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/AppConnectionsServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see AppConnectionsServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/AppConnectionsServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is + * {@see AppConnectionsServiceClient::testIamPermissionsAsync()} . + * + * @example samples/V1/AppConnectionsServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..68ef8018f5ae --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/gapic_metadata.json @@ -0,0 +1,73 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.beyondcorp.appconnections.v1", + "libraryPackage": "Google\\Cloud\\BeyondCorp\\AppConnections\\V1", + "services": { + "AppConnectionsService": { + "clients": { + "grpc": { + "libraryClient": "AppConnectionsServiceGapicClient", + "rpcs": { + "CreateAppConnection": { + "methods": [ + "createAppConnection" + ] + }, + "DeleteAppConnection": { + "methods": [ + "deleteAppConnection" + ] + }, + "GetAppConnection": { + "methods": [ + "getAppConnection" + ] + }, + "ListAppConnections": { + "methods": [ + "listAppConnections" + ] + }, + "ResolveAppConnections": { + "methods": [ + "resolveAppConnections" + ] + }, + "UpdateAppConnection": { + "methods": [ + "updateAppConnection" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/resources/app_connections_service_client_config.json b/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/resources/app_connections_service_client_config.json new file mode 100644 index 000000000000..96222a9ebc4f --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/resources/app_connections_service_client_config.json @@ -0,0 +1,77 @@ +{ + "interfaces": { + "google.cloud.beyondcorp.appconnections.v1.AppConnectionsService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateAppConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteAppConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetAppConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListAppConnections": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ResolveAppConnections": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateAppConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/resources/app_connections_service_descriptor_config.php b/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/resources/app_connections_service_descriptor_config.php new file mode 100644 index 000000000000..2362b01c1024 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/resources/app_connections_service_descriptor_config.php @@ -0,0 +1,217 @@ + [ + 'google.cloud.beyondcorp.appconnections.v1.AppConnectionsService' => [ + 'CreateAppConnection' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\AppConnections\V1\AppConnectionOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAppConnection' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\AppConnections\V1\AppConnectionOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateAppConnection' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\AppConnections\V1\AppConnectionOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'app_connection.name', + 'fieldAccessors' => [ + 'getAppConnection', + 'getName', + ], + ], + ], + ], + 'GetAppConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BeyondCorp\AppConnections\V1\AppConnection', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAppConnections' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAppConnections', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BeyondCorp\AppConnections\V1\ListAppConnectionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ResolveAppConnections' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAppConnectionDetails', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BeyondCorp\AppConnections\V1\ResolveAppConnectionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'appConnection' => 'projects/{project}/locations/{location}/appConnections/{app_connection}', + 'appConnector' => 'projects/{project}/locations/{location}/appConnectors/{app_connector}', + 'appGateway' => 'projects/{project}/locations/{location}/appGateways/{app_gateway}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/resources/app_connections_service_rest_client_config.php b/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/resources/app_connections_service_rest_client_config.php new file mode 100644 index 000000000000..ddb0a23de5ad --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/src/V1/resources/app_connections_service_rest_client_config.php @@ -0,0 +1,271 @@ + [ + 'google.cloud.beyondcorp.appconnections.v1.AppConnectionsService' => [ + 'CreateAppConnection' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/appConnections', + 'body' => 'app_connection', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAppConnection' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/appConnections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAppConnection' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/appConnections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListAppConnections' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/appConnections', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ResolveAppConnections' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/appConnections:resolve', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateAppConnection' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{app_connection.name=projects/*/locations/*/appConnections/*}', + 'body' => 'app_connection', + 'placeholders' => [ + 'app_connection.name' => [ + 'getters' => [ + 'getAppConnection', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/BeyondCorpAppConnections/v1/tests/Unit/V1/Client/AppConnectionsServiceClientTest.php b/owl-bot-staging/BeyondCorpAppConnections/v1/tests/Unit/V1/Client/AppConnectionsServiceClientTest.php new file mode 100644 index 000000000000..0ee8d7ec041c --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnections/v1/tests/Unit/V1/Client/AppConnectionsServiceClientTest.php @@ -0,0 +1,1146 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AppConnectionsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AppConnectionsServiceClient($options); + } + + /** @test */ + public function createAppConnectionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createAppConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new AppConnection(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAppConnectionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $appConnection = new AppConnection(); + $appConnectionName = 'appConnectionName-1608104182'; + $appConnection->setName($appConnectionName); + $appConnectionType = Type::TYPE_UNSPECIFIED; + $appConnection->setType($appConnectionType); + $appConnectionApplicationEndpoint = new ApplicationEndpoint(); + $applicationEndpointHost = 'applicationEndpointHost1976079949'; + $appConnectionApplicationEndpoint->setHost($applicationEndpointHost); + $applicationEndpointPort = 1976318246; + $appConnectionApplicationEndpoint->setPort($applicationEndpointPort); + $appConnection->setApplicationEndpoint($appConnectionApplicationEndpoint); + $request = (new CreateAppConnectionRequest()) + ->setParent($formattedParent) + ->setAppConnection($appConnection); + $response = $gapicClient->createAppConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/CreateAppConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAppConnection(); + $this->assertProtobufEquals($appConnection, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAppConnectionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createAppConnectionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createAppConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $appConnection = new AppConnection(); + $appConnectionName = 'appConnectionName-1608104182'; + $appConnection->setName($appConnectionName); + $appConnectionType = Type::TYPE_UNSPECIFIED; + $appConnection->setType($appConnectionType); + $appConnectionApplicationEndpoint = new ApplicationEndpoint(); + $applicationEndpointHost = 'applicationEndpointHost1976079949'; + $appConnectionApplicationEndpoint->setHost($applicationEndpointHost); + $applicationEndpointPort = 1976318246; + $appConnectionApplicationEndpoint->setPort($applicationEndpointPort); + $appConnection->setApplicationEndpoint($appConnectionApplicationEndpoint); + $request = (new CreateAppConnectionRequest()) + ->setParent($formattedParent) + ->setAppConnection($appConnection); + $response = $gapicClient->createAppConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAppConnectionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteAppConnectionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteAppConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteAppConnectionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->appConnectionName('[PROJECT]', '[LOCATION]', '[APP_CONNECTION]'); + $request = (new DeleteAppConnectionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteAppConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/DeleteAppConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteAppConnectionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteAppConnectionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteAppConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->appConnectionName('[PROJECT]', '[LOCATION]', '[APP_CONNECTION]'); + $request = (new DeleteAppConnectionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteAppConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteAppConnectionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getAppConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new AppConnection(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->appConnectionName('[PROJECT]', '[LOCATION]', '[APP_CONNECTION]'); + $request = (new GetAppConnectionRequest()) + ->setName($formattedName); + $response = $gapicClient->getAppConnection($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/GetAppConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAppConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->appConnectionName('[PROJECT]', '[LOCATION]', '[APP_CONNECTION]'); + $request = (new GetAppConnectionRequest()) + ->setName($formattedName); + try { + $gapicClient->getAppConnection($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAppConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $appConnectionsElement = new AppConnection(); + $appConnections = [ + $appConnectionsElement, + ]; + $expectedResponse = new ListAppConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAppConnections($appConnections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListAppConnectionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listAppConnections($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAppConnections()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/ListAppConnections', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAppConnectionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListAppConnectionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listAppConnections($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resolveAppConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $appConnectionDetailsElement = new AppConnectionDetails(); + $appConnectionDetails = [ + $appConnectionDetailsElement, + ]; + $expectedResponse = new ResolveAppConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAppConnectionDetails($appConnectionDetails); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $formattedAppConnectorId = $gapicClient->appConnectorName('[PROJECT]', '[LOCATION]', '[APP_CONNECTOR]'); + $request = (new ResolveAppConnectionsRequest()) + ->setParent($formattedParent) + ->setAppConnectorId($formattedAppConnectorId); + $response = $gapicClient->resolveAppConnections($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAppConnectionDetails()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/ResolveAppConnections', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getAppConnectorId(); + $this->assertProtobufEquals($formattedAppConnectorId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resolveAppConnectionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $formattedAppConnectorId = $gapicClient->appConnectorName('[PROJECT]', '[LOCATION]', '[APP_CONNECTOR]'); + $request = (new ResolveAppConnectionsRequest()) + ->setParent($formattedParent) + ->setAppConnectorId($formattedAppConnectorId); + try { + $gapicClient->resolveAppConnections($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAppConnectionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateAppConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new AppConnection(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateAppConnectionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $appConnection = new AppConnection(); + $appConnectionName = 'appConnectionName-1608104182'; + $appConnection->setName($appConnectionName); + $appConnectionType = Type::TYPE_UNSPECIFIED; + $appConnection->setType($appConnectionType); + $appConnectionApplicationEndpoint = new ApplicationEndpoint(); + $applicationEndpointHost = 'applicationEndpointHost1976079949'; + $appConnectionApplicationEndpoint->setHost($applicationEndpointHost); + $applicationEndpointPort = 1976318246; + $appConnectionApplicationEndpoint->setPort($applicationEndpointPort); + $appConnection->setApplicationEndpoint($appConnectionApplicationEndpoint); + $request = (new UpdateAppConnectionRequest()) + ->setUpdateMask($updateMask) + ->setAppConnection($appConnection); + $response = $gapicClient->updateAppConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/UpdateAppConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getAppConnection(); + $this->assertProtobufEquals($appConnection, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAppConnectionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateAppConnectionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateAppConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $appConnection = new AppConnection(); + $appConnectionName = 'appConnectionName-1608104182'; + $appConnection->setName($appConnectionName); + $appConnectionType = Type::TYPE_UNSPECIFIED; + $appConnection->setType($appConnectionType); + $appConnectionApplicationEndpoint = new ApplicationEndpoint(); + $applicationEndpointHost = 'applicationEndpointHost1976079949'; + $appConnectionApplicationEndpoint->setHost($applicationEndpointHost); + $applicationEndpointPort = 1976318246; + $appConnectionApplicationEndpoint->setPort($applicationEndpointPort); + $appConnection->setApplicationEndpoint($appConnectionApplicationEndpoint); + $request = (new UpdateAppConnectionRequest()) + ->setUpdateMask($updateMask) + ->setAppConnection($appConnection); + $response = $gapicClient->updateAppConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAppConnectionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createAppConnectionAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createAppConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new AppConnection(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAppConnectionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $appConnection = new AppConnection(); + $appConnectionName = 'appConnectionName-1608104182'; + $appConnection->setName($appConnectionName); + $appConnectionType = Type::TYPE_UNSPECIFIED; + $appConnection->setType($appConnectionType); + $appConnectionApplicationEndpoint = new ApplicationEndpoint(); + $applicationEndpointHost = 'applicationEndpointHost1976079949'; + $appConnectionApplicationEndpoint->setHost($applicationEndpointHost); + $applicationEndpointPort = 1976318246; + $appConnectionApplicationEndpoint->setPort($applicationEndpointPort); + $appConnection->setApplicationEndpoint($appConnectionApplicationEndpoint); + $request = (new CreateAppConnectionRequest()) + ->setParent($formattedParent) + ->setAppConnection($appConnection); + $response = $gapicClient->createAppConnectionAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/CreateAppConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAppConnection(); + $this->assertProtobufEquals($appConnection, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAppConnectionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnectors/V1/AppConnectorInstanceConfig.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnectors/V1/AppConnectorInstanceConfig.php new file mode 100644 index 000000000000..b82fc926871c Binary files /dev/null and b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnectors/V1/AppConnectorInstanceConfig.php differ diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnectors/V1/AppConnectorsService.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnectors/V1/AppConnectorsService.php new file mode 100644 index 000000000000..f9d70472c219 Binary files /dev/null and b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnectors/V1/AppConnectorsService.php differ diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnectors/V1/ResourceInfo.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnectors/V1/ResourceInfo.php new file mode 100644 index 000000000000..a27254573485 Binary files /dev/null and b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appconnectors/V1/ResourceInfo.php differ diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector.php new file mode 100644 index 000000000000..8601a1ecc6c5 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector.php @@ -0,0 +1,395 @@ +google.cloud.beyondcorp.appconnectors.v1.AppConnector + */ +class AppConnector extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Unique resource name of the AppConnector. + * The name is ignored when creating a AppConnector. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Timestamp when the resource was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Resource labels to represent user provided metadata. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. An arbitrary user-provided name for the AppConnector. Cannot + * exceed 64 characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Output only. A unique identifier for the instance generated by the + * system. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. The current state of the AppConnector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. Principal information about the Identity of the AppConnector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector.PrincipalInfo principal_info = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $principal_info = null; + /** + * Optional. Resource info of the connector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.ResourceInfo resource_info = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $resource_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Unique resource name of the AppConnector. + * The name is ignored when creating a AppConnector. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp when the resource was last modified. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels to represent user provided metadata. + * @type string $display_name + * Optional. An arbitrary user-provided name for the AppConnector. Cannot + * exceed 64 characters. + * @type string $uid + * Output only. A unique identifier for the instance generated by the + * system. + * @type int $state + * Output only. The current state of the AppConnector. + * @type \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector\PrincipalInfo $principal_info + * Required. Principal information about the Identity of the AppConnector. + * @type \Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo $resource_info + * Optional. Resource info of the connector. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Unique resource name of the AppConnector. + * The name is ignored when creating a AppConnector. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Unique resource name of the AppConnector. + * The name is ignored when creating a AppConnector. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Timestamp when the resource was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Timestamp when the resource was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. An arbitrary user-provided name for the AppConnector. Cannot + * exceed 64 characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. An arbitrary user-provided name for the AppConnector. Cannot + * exceed 64 characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. A unique identifier for the instance generated by the + * system. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A unique identifier for the instance generated by the + * system. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. The current state of the AppConnector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the AppConnector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector\State::class); + $this->state = $var; + + return $this; + } + + /** + * Required. Principal information about the Identity of the AppConnector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector.PrincipalInfo principal_info = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector\PrincipalInfo|null + */ + public function getPrincipalInfo() + { + return $this->principal_info; + } + + public function hasPrincipalInfo() + { + return isset($this->principal_info); + } + + public function clearPrincipalInfo() + { + unset($this->principal_info); + } + + /** + * Required. Principal information about the Identity of the AppConnector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector.PrincipalInfo principal_info = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector\PrincipalInfo $var + * @return $this + */ + public function setPrincipalInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector\PrincipalInfo::class); + $this->principal_info = $var; + + return $this; + } + + /** + * Optional. Resource info of the connector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.ResourceInfo resource_info = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo|null + */ + public function getResourceInfo() + { + return $this->resource_info; + } + + public function hasResourceInfo() + { + return isset($this->resource_info); + } + + public function clearResourceInfo() + { + unset($this->resource_info); + } + + /** + * Optional. Resource info of the connector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.ResourceInfo resource_info = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo $var + * @return $this + */ + public function setResourceInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo::class); + $this->resource_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector/PrincipalInfo.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector/PrincipalInfo.php new file mode 100644 index 000000000000..00c58b75f4af --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector/PrincipalInfo.php @@ -0,0 +1,78 @@ +google.cloud.beyondcorp.appconnectors.v1.AppConnector.PrincipalInfo + */ +class PrincipalInfo extends \Google\Protobuf\Internal\Message +{ + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector\PrincipalInfo\ServiceAccount $service_account + * A GCP service account. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorsService::initOnce(); + parent::__construct($data); + } + + /** + * A GCP service account. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector.PrincipalInfo.ServiceAccount service_account = 1; + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector\PrincipalInfo\ServiceAccount|null + */ + public function getServiceAccount() + { + return $this->readOneof(1); + } + + public function hasServiceAccount() + { + return $this->hasOneof(1); + } + + /** + * A GCP service account. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector.PrincipalInfo.ServiceAccount service_account = 1; + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector\PrincipalInfo\ServiceAccount $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector\PrincipalInfo\ServiceAccount::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PrincipalInfo::class, \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector_PrincipalInfo::class); + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector/PrincipalInfo/ServiceAccount.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector/PrincipalInfo/ServiceAccount.php new file mode 100644 index 000000000000..9219e3d17fe8 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector/PrincipalInfo/ServiceAccount.php @@ -0,0 +1,70 @@ +google.cloud.beyondcorp.appconnectors.v1.AppConnector.PrincipalInfo.ServiceAccount + */ +class ServiceAccount extends \Google\Protobuf\Internal\Message +{ + /** + * Email address of the service account. + * + * Generated from protobuf field string email = 1; + */ + protected $email = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $email + * Email address of the service account. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorsService::initOnce(); + parent::__construct($data); + } + + /** + * Email address of the service account. + * + * Generated from protobuf field string email = 1; + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Email address of the service account. + * + * Generated from protobuf field string email = 1; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ServiceAccount::class, \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector_PrincipalInfo_ServiceAccount::class); + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector/State.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector/State.php new file mode 100644 index 000000000000..05d642b76b6d --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnector/State.php @@ -0,0 +1,86 @@ +google.cloud.beyondcorp.appconnectors.v1.AppConnector.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * AppConnector is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * AppConnector has been created. + * + * Generated from protobuf enum CREATED = 2; + */ + const CREATED = 2; + /** + * AppConnector's configuration is being updated. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * AppConnector is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * AppConnector is down and may be restored in the future. + * This happens when CCFE sends ProjectState = OFF. + * + * Generated from protobuf enum DOWN = 5; + */ + const DOWN = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::CREATED => 'CREATED', + self::UPDATING => 'UPDATING', + self::DELETING => 'DELETING', + self::DOWN => 'DOWN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector_State::class); + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnectorInstanceConfig.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnectorInstanceConfig.php new file mode 100644 index 000000000000..59a44797fb90 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnectorInstanceConfig.php @@ -0,0 +1,215 @@ +google.cloud.beyondcorp.appconnectors.v1.AppConnectorInstanceConfig + */ +class AppConnectorInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A monotonically increasing number generated and maintained + * by the API provider. Every time a config changes in the backend, the + * sequenceNumber should be bumped up to reflect the change. + * + * Generated from protobuf field int64 sequence_number = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sequence_number = 0; + /** + * The SLM instance agent configuration. + * + * Generated from protobuf field .google.protobuf.Any instance_config = 2; + */ + protected $instance_config = null; + /** + * NotificationConfig defines the notification mechanism that the remote + * instance should subscribe to in order to receive notification. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.NotificationConfig notification_config = 3; + */ + protected $notification_config = null; + /** + * ImageConfig defines the GCR images to run for the remote agent's control + * plane. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.ImageConfig image_config = 4; + */ + protected $image_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $sequence_number + * Required. A monotonically increasing number generated and maintained + * by the API provider. Every time a config changes in the backend, the + * sequenceNumber should be bumped up to reflect the change. + * @type \Google\Protobuf\Any $instance_config + * The SLM instance agent configuration. + * @type \Google\Cloud\BeyondCorp\AppConnectors\V1\NotificationConfig $notification_config + * NotificationConfig defines the notification mechanism that the remote + * instance should subscribe to in order to receive notification. + * @type \Google\Cloud\BeyondCorp\AppConnectors\V1\ImageConfig $image_config + * ImageConfig defines the GCR images to run for the remote agent's control + * plane. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorInstanceConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. A monotonically increasing number generated and maintained + * by the API provider. Every time a config changes in the backend, the + * sequenceNumber should be bumped up to reflect the change. + * + * Generated from protobuf field int64 sequence_number = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getSequenceNumber() + { + return $this->sequence_number; + } + + /** + * Required. A monotonically increasing number generated and maintained + * by the API provider. Every time a config changes in the backend, the + * sequenceNumber should be bumped up to reflect the change. + * + * Generated from protobuf field int64 sequence_number = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setSequenceNumber($var) + { + GPBUtil::checkInt64($var); + $this->sequence_number = $var; + + return $this; + } + + /** + * The SLM instance agent configuration. + * + * Generated from protobuf field .google.protobuf.Any instance_config = 2; + * @return \Google\Protobuf\Any|null + */ + public function getInstanceConfig() + { + return $this->instance_config; + } + + public function hasInstanceConfig() + { + return isset($this->instance_config); + } + + public function clearInstanceConfig() + { + unset($this->instance_config); + } + + /** + * The SLM instance agent configuration. + * + * Generated from protobuf field .google.protobuf.Any instance_config = 2; + * @param \Google\Protobuf\Any $var + * @return $this + */ + public function setInstanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); + $this->instance_config = $var; + + return $this; + } + + /** + * NotificationConfig defines the notification mechanism that the remote + * instance should subscribe to in order to receive notification. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.NotificationConfig notification_config = 3; + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\NotificationConfig|null + */ + public function getNotificationConfig() + { + return $this->notification_config; + } + + public function hasNotificationConfig() + { + return isset($this->notification_config); + } + + public function clearNotificationConfig() + { + unset($this->notification_config); + } + + /** + * NotificationConfig defines the notification mechanism that the remote + * instance should subscribe to in order to receive notification. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.NotificationConfig notification_config = 3; + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\NotificationConfig $var + * @return $this + */ + public function setNotificationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnectors\V1\NotificationConfig::class); + $this->notification_config = $var; + + return $this; + } + + /** + * ImageConfig defines the GCR images to run for the remote agent's control + * plane. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.ImageConfig image_config = 4; + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\ImageConfig|null + */ + public function getImageConfig() + { + return $this->image_config; + } + + public function hasImageConfig() + { + return isset($this->image_config); + } + + public function clearImageConfig() + { + unset($this->image_config); + } + + /** + * ImageConfig defines the GCR images to run for the remote agent's control + * plane. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.ImageConfig image_config = 4; + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\ImageConfig $var + * @return $this + */ + public function setImageConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnectors\V1\ImageConfig::class); + $this->image_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnectorOperationMetadata.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnectorOperationMetadata.php new file mode 100644 index 000000000000..28e101a224c3 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/AppConnectorOperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.beyondcorp.appconnectors.v1.AppConnectorOperationMetadata + */ +class AppConnectorOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorsService::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/CreateAppConnectorRequest.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/CreateAppConnectorRequest.php new file mode 100644 index 000000000000..971d96884ddc --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/CreateAppConnectorRequest.php @@ -0,0 +1,296 @@ +google.cloud.beyondcorp.appconnectors.v1.CreateAppConnectorRequest + */ +class CreateAppConnectorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource project name of the AppConnector location using the + * form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. User-settable AppConnector resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string app_connector_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $app_connector_id = ''; + /** + * Required. A BeyondCorp AppConnector resource. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector app_connector = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $app_connector = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The resource project name of the AppConnector location using the + * form: `projects/{project_id}/locations/{location_id}` + * Please see {@see AppConnectorsServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector $appConnector Required. A BeyondCorp AppConnector resource. + * @param string $appConnectorId Optional. User-settable AppConnector resource ID. + * + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\CreateAppConnectorRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector $appConnector, string $appConnectorId): self + { + return (new self()) + ->setParent($parent) + ->setAppConnector($appConnector) + ->setAppConnectorId($appConnectorId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource project name of the AppConnector location using the + * form: `projects/{project_id}/locations/{location_id}` + * @type string $app_connector_id + * Optional. User-settable AppConnector resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * @type \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector $app_connector + * Required. A BeyondCorp AppConnector resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource project name of the AppConnector location using the + * form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource project name of the AppConnector location using the + * form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. User-settable AppConnector resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string app_connector_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAppConnectorId() + { + return $this->app_connector_id; + } + + /** + * Optional. User-settable AppConnector resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string app_connector_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAppConnectorId($var) + { + GPBUtil::checkString($var, True); + $this->app_connector_id = $var; + + return $this; + } + + /** + * Required. A BeyondCorp AppConnector resource. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector app_connector = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector|null + */ + public function getAppConnector() + { + return $this->app_connector; + } + + public function hasAppConnector() + { + return isset($this->app_connector); + } + + public function clearAppConnector() + { + unset($this->app_connector); + } + + /** + * Required. A BeyondCorp AppConnector resource. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector app_connector = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector $var + * @return $this + */ + public function setAppConnector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector::class); + $this->app_connector = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/DeleteAppConnectorRequest.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/DeleteAppConnectorRequest.php new file mode 100644 index 000000000000..a9ac702ffd42 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/DeleteAppConnectorRequest.php @@ -0,0 +1,198 @@ +google.cloud.beyondcorp.appconnectors.v1.DeleteAppConnectorRequest + */ +class DeleteAppConnectorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. BeyondCorp AppConnector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. BeyondCorp AppConnector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * Please see {@see AppConnectorsServiceClient::appConnectorName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\DeleteAppConnectorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. BeyondCorp AppConnector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. BeyondCorp AppConnector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. BeyondCorp AppConnector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/GetAppConnectorRequest.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/GetAppConnectorRequest.php new file mode 100644 index 000000000000..977e4560e303 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/GetAppConnectorRequest.php @@ -0,0 +1,86 @@ +google.cloud.beyondcorp.appconnectors.v1.GetAppConnectorRequest + */ +class GetAppConnectorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. BeyondCorp AppConnector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. BeyondCorp AppConnector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * Please see {@see AppConnectorsServiceClient::appConnectorName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\GetAppConnectorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. BeyondCorp AppConnector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. BeyondCorp AppConnector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. BeyondCorp AppConnector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/HealthStatus.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/HealthStatus.php new file mode 100644 index 000000000000..4c2c7b1895f9 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/HealthStatus.php @@ -0,0 +1,75 @@ +google.cloud.beyondcorp.appconnectors.v1.HealthStatus + */ +class HealthStatus +{ + /** + * Health status is unknown: not initialized or failed to retrieve. + * + * Generated from protobuf enum HEALTH_STATUS_UNSPECIFIED = 0; + */ + const HEALTH_STATUS_UNSPECIFIED = 0; + /** + * The resource is healthy. + * + * Generated from protobuf enum HEALTHY = 1; + */ + const HEALTHY = 1; + /** + * The resource is unhealthy. + * + * Generated from protobuf enum UNHEALTHY = 2; + */ + const UNHEALTHY = 2; + /** + * The resource is unresponsive. + * + * Generated from protobuf enum UNRESPONSIVE = 3; + */ + const UNRESPONSIVE = 3; + /** + * Some sub-resources are UNHEALTHY. + * + * Generated from protobuf enum DEGRADED = 4; + */ + const DEGRADED = 4; + + private static $valueToName = [ + self::HEALTH_STATUS_UNSPECIFIED => 'HEALTH_STATUS_UNSPECIFIED', + self::HEALTHY => 'HEALTHY', + self::UNHEALTHY => 'UNHEALTHY', + self::UNRESPONSIVE => 'UNRESPONSIVE', + self::DEGRADED => 'DEGRADED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ImageConfig.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ImageConfig.php new file mode 100644 index 000000000000..f31d9006cf66 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ImageConfig.php @@ -0,0 +1,109 @@ +google.cloud.beyondcorp.appconnectors.v1.ImageConfig + */ +class ImageConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The initial image the remote agent will attempt to run for the control + * plane. + * + * Generated from protobuf field string target_image = 1; + */ + protected $target_image = ''; + /** + * The stable image that the remote agent will fallback to if the target image + * fails. + * + * Generated from protobuf field string stable_image = 2; + */ + protected $stable_image = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $target_image + * The initial image the remote agent will attempt to run for the control + * plane. + * @type string $stable_image + * The stable image that the remote agent will fallback to if the target image + * fails. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorInstanceConfig::initOnce(); + parent::__construct($data); + } + + /** + * The initial image the remote agent will attempt to run for the control + * plane. + * + * Generated from protobuf field string target_image = 1; + * @return string + */ + public function getTargetImage() + { + return $this->target_image; + } + + /** + * The initial image the remote agent will attempt to run for the control + * plane. + * + * Generated from protobuf field string target_image = 1; + * @param string $var + * @return $this + */ + public function setTargetImage($var) + { + GPBUtil::checkString($var, True); + $this->target_image = $var; + + return $this; + } + + /** + * The stable image that the remote agent will fallback to if the target image + * fails. + * + * Generated from protobuf field string stable_image = 2; + * @return string + */ + public function getStableImage() + { + return $this->stable_image; + } + + /** + * The stable image that the remote agent will fallback to if the target image + * fails. + * + * Generated from protobuf field string stable_image = 2; + * @param string $var + * @return $this + */ + public function setStableImage($var) + { + GPBUtil::checkString($var, True); + $this->stable_image = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ListAppConnectorsRequest.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ListAppConnectorsRequest.php new file mode 100644 index 000000000000..eb6639769249 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ListAppConnectorsRequest.php @@ -0,0 +1,258 @@ +google.cloud.beyondcorp.appconnectors.v1.ListAppConnectorsRequest + */ +class ListAppConnectorsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the AppConnector location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppConnectorsResponse.next_page_token] to + * determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous + * ListAppConnectorsRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter specifying constraints of a list operation. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The resource name of the AppConnector location using the form: + * `projects/{project_id}/locations/{location_id}` + * Please see {@see AppConnectorsServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\ListAppConnectorsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the AppConnector location using the form: + * `projects/{project_id}/locations/{location_id}` + * @type int $page_size + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppConnectorsResponse.next_page_token] to + * determine if there are more instances left to be queried. + * @type string $page_token + * Optional. The next_page_token value returned from a previous + * ListAppConnectorsRequest, if any. + * @type string $filter + * Optional. A filter specifying constraints of a list operation. + * @type string $order_by + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the AppConnector location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the AppConnector location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppConnectorsResponse.next_page_token] to + * determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppConnectorsResponse.next_page_token] to + * determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous + * ListAppConnectorsRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous + * ListAppConnectorsRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter specifying constraints of a list operation. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter specifying constraints of a list operation. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ListAppConnectorsResponse.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ListAppConnectorsResponse.php new file mode 100644 index 000000000000..4dd5d6387e1b --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ListAppConnectorsResponse.php @@ -0,0 +1,139 @@ +google.cloud.beyondcorp.appconnectors.v1.ListAppConnectorsResponse + */ +class ListAppConnectorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of BeyondCorp AppConnectors in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnectors.v1.AppConnector app_connectors = 1; + */ + private $app_connectors; + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector>|\Google\Protobuf\Internal\RepeatedField $app_connectors + * A list of BeyondCorp AppConnectors in the project. + * @type string $next_page_token + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * A list of locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorsService::initOnce(); + parent::__construct($data); + } + + /** + * A list of BeyondCorp AppConnectors in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnectors.v1.AppConnector app_connectors = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppConnectors() + { + return $this->app_connectors; + } + + /** + * A list of BeyondCorp AppConnectors in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnectors.v1.AppConnector app_connectors = 1; + * @param array<\Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppConnectors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector::class); + $this->app_connectors = $arr; + + return $this; + } + + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/NotificationConfig.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/NotificationConfig.php new file mode 100644 index 000000000000..0ab5679cdf95 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/NotificationConfig.php @@ -0,0 +1,75 @@ +google.cloud.beyondcorp.appconnectors.v1.NotificationConfig + */ +class NotificationConfig extends \Google\Protobuf\Internal\Message +{ + protected $config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BeyondCorp\AppConnectors\V1\NotificationConfig\CloudPubSubNotificationConfig $pubsub_notification + * Cloud Pub/Sub Configuration to receive notifications. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorInstanceConfig::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Pub/Sub Configuration to receive notifications. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.NotificationConfig.CloudPubSubNotificationConfig pubsub_notification = 1; + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\NotificationConfig\CloudPubSubNotificationConfig|null + */ + public function getPubsubNotification() + { + return $this->readOneof(1); + } + + public function hasPubsubNotification() + { + return $this->hasOneof(1); + } + + /** + * Cloud Pub/Sub Configuration to receive notifications. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.NotificationConfig.CloudPubSubNotificationConfig pubsub_notification = 1; + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\NotificationConfig\CloudPubSubNotificationConfig $var + * @return $this + */ + public function setPubsubNotification($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnectors\V1\NotificationConfig\CloudPubSubNotificationConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getConfig() + { + return $this->whichOneof("config"); + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/NotificationConfig/CloudPubSubNotificationConfig.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/NotificationConfig/CloudPubSubNotificationConfig.php new file mode 100644 index 000000000000..b4a622dabefe --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/NotificationConfig/CloudPubSubNotificationConfig.php @@ -0,0 +1,70 @@ +google.cloud.beyondcorp.appconnectors.v1.NotificationConfig.CloudPubSubNotificationConfig + */ +class CloudPubSubNotificationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The Pub/Sub subscription the AppConnector uses to receive notifications. + * + * Generated from protobuf field string pubsub_subscription = 1; + */ + protected $pubsub_subscription = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $pubsub_subscription + * The Pub/Sub subscription the AppConnector uses to receive notifications. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorInstanceConfig::initOnce(); + parent::__construct($data); + } + + /** + * The Pub/Sub subscription the AppConnector uses to receive notifications. + * + * Generated from protobuf field string pubsub_subscription = 1; + * @return string + */ + public function getPubsubSubscription() + { + return $this->pubsub_subscription; + } + + /** + * The Pub/Sub subscription the AppConnector uses to receive notifications. + * + * Generated from protobuf field string pubsub_subscription = 1; + * @param string $var + * @return $this + */ + public function setPubsubSubscription($var) + { + GPBUtil::checkString($var, True); + $this->pubsub_subscription = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CloudPubSubNotificationConfig::class, \Google\Cloud\BeyondCorp\AppConnectors\V1\NotificationConfig_CloudPubSubNotificationConfig::class); + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ReportStatusRequest.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ReportStatusRequest.php new file mode 100644 index 000000000000..15a4889b3bc3 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ReportStatusRequest.php @@ -0,0 +1,244 @@ +google.cloud.beyondcorp.appconnectors.v1.ReportStatusRequest + */ +class ReportStatusRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/connectors/{connector}` + * + * Generated from protobuf field string app_connector = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $app_connector = ''; + /** + * Required. Resource info of the connector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.ResourceInfo resource_info = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_info = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $appConnector Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/connectors/{connector}` + * Please see {@see AppConnectorsServiceClient::appConnectorName()} for help formatting this field. + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo $resourceInfo Required. Resource info of the connector. + * + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\ReportStatusRequest + * + * @experimental + */ + public static function build(string $appConnector, \Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo $resourceInfo): self + { + return (new self()) + ->setAppConnector($appConnector) + ->setResourceInfo($resourceInfo); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $app_connector + * Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/connectors/{connector}` + * @type \Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo $resource_info + * Required. Resource info of the connector. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/connectors/{connector}` + * + * Generated from protobuf field string app_connector = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAppConnector() + { + return $this->app_connector; + } + + /** + * Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/connectors/{connector}` + * + * Generated from protobuf field string app_connector = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAppConnector($var) + { + GPBUtil::checkString($var, True); + $this->app_connector = $var; + + return $this; + } + + /** + * Required. Resource info of the connector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.ResourceInfo resource_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo|null + */ + public function getResourceInfo() + { + return $this->resource_info; + } + + public function hasResourceInfo() + { + return isset($this->resource_info); + } + + public function clearResourceInfo() + { + unset($this->resource_info); + } + + /** + * Required. Resource info of the connector. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.ResourceInfo resource_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo $var + * @return $this + */ + public function setResourceInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo::class); + $this->resource_info = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ResourceInfo.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ResourceInfo.php new file mode 100644 index 000000000000..e2ea6c977df7 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/ResourceInfo.php @@ -0,0 +1,240 @@ +google.cloud.beyondcorp.appconnectors.v1.ResourceInfo + */ +class ResourceInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Unique Id for the resource. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $id = ''; + /** + * Overall health status. Overall status is derived based on the status of + * each sub level resources. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.HealthStatus status = 2; + */ + protected $status = 0; + /** + * Specific details for the resource. This is for internal use only. + * + * Generated from protobuf field .google.protobuf.Any resource = 3; + */ + protected $resource = null; + /** + * The timestamp to collect the info. It is suggested to be set by + * the topmost level resource only. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 4; + */ + protected $time = null; + /** + * List of Info for the sub level resources. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnectors.v1.ResourceInfo sub = 5; + */ + private $sub; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Required. Unique Id for the resource. + * @type int $status + * Overall health status. Overall status is derived based on the status of + * each sub level resources. + * @type \Google\Protobuf\Any $resource + * Specific details for the resource. This is for internal use only. + * @type \Google\Protobuf\Timestamp $time + * The timestamp to collect the info. It is suggested to be set by + * the topmost level resource only. + * @type array<\Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo>|\Google\Protobuf\Internal\RepeatedField $sub + * List of Info for the sub level resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\ResourceInfo::initOnce(); + parent::__construct($data); + } + + /** + * Required. Unique Id for the resource. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Required. Unique Id for the resource. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Overall health status. Overall status is derived based on the status of + * each sub level resources. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.HealthStatus status = 2; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Overall health status. Overall status is derived based on the status of + * each sub level resources. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.HealthStatus status = 2; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BeyondCorp\AppConnectors\V1\HealthStatus::class); + $this->status = $var; + + return $this; + } + + /** + * Specific details for the resource. This is for internal use only. + * + * Generated from protobuf field .google.protobuf.Any resource = 3; + * @return \Google\Protobuf\Any|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * Specific details for the resource. This is for internal use only. + * + * Generated from protobuf field .google.protobuf.Any resource = 3; + * @param \Google\Protobuf\Any $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); + $this->resource = $var; + + return $this; + } + + /** + * The timestamp to collect the info. It is suggested to be set by + * the topmost level resource only. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTime() + { + return $this->time; + } + + public function hasTime() + { + return isset($this->time); + } + + public function clearTime() + { + unset($this->time); + } + + /** + * The timestamp to collect the info. It is suggested to be set by + * the topmost level resource only. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->time = $var; + + return $this; + } + + /** + * List of Info for the sub level resources. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnectors.v1.ResourceInfo sub = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSub() + { + return $this->sub; + } + + /** + * List of Info for the sub level resources. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appconnectors.v1.ResourceInfo sub = 5; + * @param array<\Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSub($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BeyondCorp\AppConnectors\V1\ResourceInfo::class); + $this->sub = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/UpdateAppConnectorRequest.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/UpdateAppConnectorRequest.php new file mode 100644 index 000000000000..eb3293b86e4f --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/proto/src/Google/Cloud/BeyondCorp/AppConnectors/V1/UpdateAppConnectorRequest.php @@ -0,0 +1,273 @@ +google.cloud.beyondcorp.appconnectors.v1.UpdateAppConnectorRequest + */ +class UpdateAppConnectorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [BeyondCorp.AppConnector]: + * * `labels` + * * `display_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. AppConnector message with updated fields. Only supported fields + * specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector app_connector = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $app_connector = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector $appConnector Required. AppConnector message with updated fields. Only supported fields + * specified in update_mask are updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [BeyondCorp.AppConnector]: + * * `labels` + * * `display_name` + * + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\UpdateAppConnectorRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector $appConnector, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAppConnector($appConnector) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [BeyondCorp.AppConnector]: + * * `labels` + * * `display_name` + * @type \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector $app_connector + * Required. AppConnector message with updated fields. Only supported fields + * specified in update_mask are updated. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appconnectors\V1\AppConnectorsService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [BeyondCorp.AppConnector]: + * * `labels` + * * `display_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [BeyondCorp.AppConnector]: + * * `labels` + * * `display_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. AppConnector message with updated fields. Only supported fields + * specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector app_connector = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector|null + */ + public function getAppConnector() + { + return $this->app_connector; + } + + public function hasAppConnector() + { + return isset($this->app_connector); + } + + public function clearAppConnector() + { + unset($this->app_connector); + } + + /** + * Required. AppConnector message with updated fields. Only supported fields + * specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.beyondcorp.appconnectors.v1.AppConnector app_connector = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector $var + * @return $this + */ + public function setAppConnector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector::class); + $this->app_connector = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/create_app_connector.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/create_app_connector.php new file mode 100644 index 000000000000..afcd71875d67 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/create_app_connector.php @@ -0,0 +1,93 @@ +setName($appConnectorName) + ->setPrincipalInfo($appConnectorPrincipalInfo); + $request = (new CreateAppConnectorRequest()) + ->setParent($formattedParent) + ->setAppConnector($appConnector); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $appConnectorsServiceClient->createAppConnector($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AppConnector $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AppConnectorsServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $appConnectorName = '[NAME]'; + + create_app_connector_sample($formattedParent, $appConnectorName); +} +// [END beyondcorp_v1_generated_AppConnectorsService_CreateAppConnector_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/delete_app_connector.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/delete_app_connector.php new file mode 100644 index 000000000000..578ff6e18307 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/delete_app_connector.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $appConnectorsServiceClient->deleteAppConnector($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AppConnectorsServiceClient::appConnectorName( + '[PROJECT]', + '[LOCATION]', + '[APP_CONNECTOR]' + ); + + delete_app_connector_sample($formattedName); +} +// [END beyondcorp_v1_generated_AppConnectorsService_DeleteAppConnector_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/get_app_connector.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/get_app_connector.php new file mode 100644 index 000000000000..82dbca68241d --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/get_app_connector.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AppConnector $response */ + $response = $appConnectorsServiceClient->getAppConnector($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AppConnectorsServiceClient::appConnectorName( + '[PROJECT]', + '[LOCATION]', + '[APP_CONNECTOR]' + ); + + get_app_connector_sample($formattedName); +} +// [END beyondcorp_v1_generated_AppConnectorsService_GetAppConnector_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/get_iam_policy.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..2d9971aefff9 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $appConnectorsServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END beyondcorp_v1_generated_AppConnectorsService_GetIamPolicy_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/get_location.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/get_location.php new file mode 100644 index 000000000000..fcce3ca9f51e --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END beyondcorp_v1_generated_AppConnectorsService_GetLocation_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/list_app_connectors.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/list_app_connectors.php new file mode 100644 index 000000000000..56398737f929 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/list_app_connectors.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $appConnectorsServiceClient->listAppConnectors($request); + + /** @var AppConnector $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AppConnectorsServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_app_connectors_sample($formattedParent); +} +// [END beyondcorp_v1_generated_AppConnectorsService_ListAppConnectors_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/list_locations.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/list_locations.php new file mode 100644 index 000000000000..17965a132c46 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END beyondcorp_v1_generated_AppConnectorsService_ListLocations_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/report_status.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/report_status.php new file mode 100644 index 000000000000..39edd3236cae --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/report_status.php @@ -0,0 +1,94 @@ +setId($resourceInfoId); + $request = (new ReportStatusRequest()) + ->setAppConnector($formattedAppConnector) + ->setResourceInfo($resourceInfo); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $appConnectorsServiceClient->reportStatus($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AppConnector $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedAppConnector = AppConnectorsServiceClient::appConnectorName( + '[PROJECT]', + '[LOCATION]', + '[APP_CONNECTOR]' + ); + $resourceInfoId = '[ID]'; + + report_status_sample($formattedAppConnector, $resourceInfoId); +} +// [END beyondcorp_v1_generated_AppConnectorsService_ReportStatus_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/set_iam_policy.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..8ad3b35214b3 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $appConnectorsServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END beyondcorp_v1_generated_AppConnectorsService_SetIamPolicy_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/test_iam_permissions.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..b4d27f651a4a --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $appConnectorsServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END beyondcorp_v1_generated_AppConnectorsService_TestIamPermissions_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/update_app_connector.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/update_app_connector.php new file mode 100644 index 000000000000..bb76d70d3a8e --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/samples/V1/AppConnectorsServiceClient/update_app_connector.php @@ -0,0 +1,91 @@ +setName($appConnectorName) + ->setPrincipalInfo($appConnectorPrincipalInfo); + $request = (new UpdateAppConnectorRequest()) + ->setUpdateMask($updateMask) + ->setAppConnector($appConnector); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $appConnectorsServiceClient->updateAppConnector($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AppConnector $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $appConnectorName = '[NAME]'; + + update_app_connector_sample($appConnectorName); +} +// [END beyondcorp_v1_generated_AppConnectorsService_UpdateAppConnector_sync] diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/Client/AppConnectorsServiceClient.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/Client/AppConnectorsServiceClient.php new file mode 100644 index 000000000000..c97f15090282 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/Client/AppConnectorsServiceClient.php @@ -0,0 +1,628 @@ + createAppConnectorAsync(CreateAppConnectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAppConnectorAsync(DeleteAppConnectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAppConnectorAsync(GetAppConnectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAppConnectorsAsync(ListAppConnectorsRequest $request, array $optionalArgs = []) + * @method PromiseInterface reportStatusAsync(ReportStatusRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAppConnectorAsync(UpdateAppConnectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class AppConnectorsServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'beyondcorp.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'beyondcorp.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/app_connectors_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/app_connectors_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/app_connectors_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/app_connectors_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * app_connector resource. + * + * @param string $project + * @param string $location + * @param string $appConnector + * + * @return string The formatted app_connector resource. + */ + public static function appConnectorName(string $project, string $location, string $appConnector): string + { + return self::getPathTemplate('appConnector')->render([ + 'project' => $project, + 'location' => $location, + 'app_connector' => $appConnector, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - appConnector: projects/{project}/locations/{location}/appConnectors/{app_connector} + * - location: projects/{project}/locations/{location} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'beyondcorp.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new AppConnector in a given project and location. + * + * The async variant is + * {@see AppConnectorsServiceClient::createAppConnectorAsync()} . + * + * @example samples/V1/AppConnectorsServiceClient/create_app_connector.php + * + * @param CreateAppConnectorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAppConnector(CreateAppConnectorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateAppConnector', $request, $callOptions)->wait(); + } + + /** + * Deletes a single AppConnector. + * + * The async variant is + * {@see AppConnectorsServiceClient::deleteAppConnectorAsync()} . + * + * @example samples/V1/AppConnectorsServiceClient/delete_app_connector.php + * + * @param DeleteAppConnectorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAppConnector(DeleteAppConnectorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteAppConnector', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single AppConnector. + * + * The async variant is {@see AppConnectorsServiceClient::getAppConnectorAsync()} . + * + * @example samples/V1/AppConnectorsServiceClient/get_app_connector.php + * + * @param GetAppConnectorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AppConnector + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAppConnector(GetAppConnectorRequest $request, array $callOptions = []): AppConnector + { + return $this->startApiCall('GetAppConnector', $request, $callOptions)->wait(); + } + + /** + * Lists AppConnectors in a given project and location. + * + * The async variant is {@see AppConnectorsServiceClient::listAppConnectorsAsync()} + * . + * + * @example samples/V1/AppConnectorsServiceClient/list_app_connectors.php + * + * @param ListAppConnectorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAppConnectors(ListAppConnectorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAppConnectors', $request, $callOptions); + } + + /** + * Report status for a given connector. + * + * The async variant is {@see AppConnectorsServiceClient::reportStatusAsync()} . + * + * @example samples/V1/AppConnectorsServiceClient/report_status.php + * + * @param ReportStatusRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function reportStatus(ReportStatusRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ReportStatus', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a single AppConnector. + * + * The async variant is + * {@see AppConnectorsServiceClient::updateAppConnectorAsync()} . + * + * @example samples/V1/AppConnectorsServiceClient/update_app_connector.php + * + * @param UpdateAppConnectorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAppConnector(UpdateAppConnectorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateAppConnector', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AppConnectorsServiceClient::getLocationAsync()} . + * + * @example samples/V1/AppConnectorsServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see AppConnectorsServiceClient::listLocationsAsync()} . + * + * @example samples/V1/AppConnectorsServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see AppConnectorsServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/AppConnectorsServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see AppConnectorsServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/AppConnectorsServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is + * {@see AppConnectorsServiceClient::testIamPermissionsAsync()} . + * + * @example samples/V1/AppConnectorsServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..45b46c7018ad --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/gapic_metadata.json @@ -0,0 +1,73 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.beyondcorp.appconnectors.v1", + "libraryPackage": "Google\\Cloud\\BeyondCorp\\AppConnectors\\V1", + "services": { + "AppConnectorsService": { + "clients": { + "grpc": { + "libraryClient": "AppConnectorsServiceGapicClient", + "rpcs": { + "CreateAppConnector": { + "methods": [ + "createAppConnector" + ] + }, + "DeleteAppConnector": { + "methods": [ + "deleteAppConnector" + ] + }, + "GetAppConnector": { + "methods": [ + "getAppConnector" + ] + }, + "ListAppConnectors": { + "methods": [ + "listAppConnectors" + ] + }, + "ReportStatus": { + "methods": [ + "reportStatus" + ] + }, + "UpdateAppConnector": { + "methods": [ + "updateAppConnector" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/resources/app_connectors_service_client_config.json b/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/resources/app_connectors_service_client_config.json new file mode 100644 index 000000000000..6a2292abae69 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/resources/app_connectors_service_client_config.json @@ -0,0 +1,77 @@ +{ + "interfaces": { + "google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateAppConnector": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteAppConnector": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetAppConnector": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListAppConnectors": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ReportStatus": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateAppConnector": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/resources/app_connectors_service_descriptor_config.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/resources/app_connectors_service_descriptor_config.php new file mode 100644 index 000000000000..6de05317288a --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/resources/app_connectors_service_descriptor_config.php @@ -0,0 +1,214 @@ + [ + 'google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService' => [ + 'CreateAppConnector' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnectorOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAppConnector' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnectorOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ReportStatus' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnectorOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'app_connector', + 'fieldAccessors' => [ + 'getAppConnector', + ], + ], + ], + ], + 'UpdateAppConnector' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnectorOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'app_connector.name', + 'fieldAccessors' => [ + 'getAppConnector', + 'getName', + ], + ], + ], + ], + 'GetAppConnector' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BeyondCorp\AppConnectors\V1\AppConnector', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAppConnectors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAppConnectors', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BeyondCorp\AppConnectors\V1\ListAppConnectorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'appConnector' => 'projects/{project}/locations/{location}/appConnectors/{app_connector}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/resources/app_connectors_service_rest_client_config.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/resources/app_connectors_service_rest_client_config.php new file mode 100644 index 000000000000..4eb4516f5c91 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/src/V1/resources/app_connectors_service_rest_client_config.php @@ -0,0 +1,272 @@ + [ + 'google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService' => [ + 'CreateAppConnector' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/appConnectors', + 'body' => 'app_connector', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAppConnector' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/appConnectors/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAppConnector' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/appConnectors/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListAppConnectors' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/appConnectors', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ReportStatus' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{app_connector=projects/*/locations/*/appConnectors/*}:reportStatus', + 'body' => '*', + 'placeholders' => [ + 'app_connector' => [ + 'getters' => [ + 'getAppConnector', + ], + ], + ], + ], + 'UpdateAppConnector' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{app_connector.name=projects/*/locations/*/appConnectors/*}', + 'body' => 'app_connector', + 'placeholders' => [ + 'app_connector.name' => [ + 'getters' => [ + 'getAppConnector', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/BeyondCorpAppConnectors/v1/tests/Unit/V1/Client/AppConnectorsServiceClientTest.php b/owl-bot-staging/BeyondCorpAppConnectors/v1/tests/Unit/V1/Client/AppConnectorsServiceClientTest.php new file mode 100644 index 000000000000..a8d24ec734d7 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppConnectors/v1/tests/Unit/V1/Client/AppConnectorsServiceClientTest.php @@ -0,0 +1,1173 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AppConnectorsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AppConnectorsServiceClient($options); + } + + /** @test */ + public function createAppConnectorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createAppConnectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new AppConnector(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAppConnectorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $appConnector = new AppConnector(); + $appConnectorName = 'appConnectorName-1263736873'; + $appConnector->setName($appConnectorName); + $appConnectorPrincipalInfo = new PrincipalInfo(); + $appConnector->setPrincipalInfo($appConnectorPrincipalInfo); + $request = (new CreateAppConnectorRequest()) + ->setParent($formattedParent) + ->setAppConnector($appConnector); + $response = $gapicClient->createAppConnector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService/CreateAppConnector', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAppConnector(); + $this->assertProtobufEquals($appConnector, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAppConnectorTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createAppConnectorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createAppConnectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $appConnector = new AppConnector(); + $appConnectorName = 'appConnectorName-1263736873'; + $appConnector->setName($appConnectorName); + $appConnectorPrincipalInfo = new PrincipalInfo(); + $appConnector->setPrincipalInfo($appConnectorPrincipalInfo); + $request = (new CreateAppConnectorRequest()) + ->setParent($formattedParent) + ->setAppConnector($appConnector); + $response = $gapicClient->createAppConnector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAppConnectorTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteAppConnectorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteAppConnectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteAppConnectorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->appConnectorName('[PROJECT]', '[LOCATION]', '[APP_CONNECTOR]'); + $request = (new DeleteAppConnectorRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteAppConnector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService/DeleteAppConnector', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteAppConnectorTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteAppConnectorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteAppConnectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->appConnectorName('[PROJECT]', '[LOCATION]', '[APP_CONNECTOR]'); + $request = (new DeleteAppConnectorRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteAppConnector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteAppConnectorTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getAppConnectorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new AppConnector(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->appConnectorName('[PROJECT]', '[LOCATION]', '[APP_CONNECTOR]'); + $request = (new GetAppConnectorRequest()) + ->setName($formattedName); + $response = $gapicClient->getAppConnector($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService/GetAppConnector', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAppConnectorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->appConnectorName('[PROJECT]', '[LOCATION]', '[APP_CONNECTOR]'); + $request = (new GetAppConnectorRequest()) + ->setName($formattedName); + try { + $gapicClient->getAppConnector($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAppConnectorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $appConnectorsElement = new AppConnector(); + $appConnectors = [ + $appConnectorsElement, + ]; + $expectedResponse = new ListAppConnectorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAppConnectors($appConnectors); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListAppConnectorsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listAppConnectors($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAppConnectors()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService/ListAppConnectors', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAppConnectorsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListAppConnectorsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listAppConnectors($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reportStatusTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/reportStatusTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new AppConnector(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/reportStatusTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedAppConnector = $gapicClient->appConnectorName('[PROJECT]', '[LOCATION]', '[APP_CONNECTOR]'); + $resourceInfo = new ResourceInfo(); + $resourceInfoId = 'resourceInfoId-332404713'; + $resourceInfo->setId($resourceInfoId); + $request = (new ReportStatusRequest()) + ->setAppConnector($formattedAppConnector) + ->setResourceInfo($resourceInfo); + $response = $gapicClient->reportStatus($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService/ReportStatus', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAppConnector(); + $this->assertProtobufEquals($formattedAppConnector, $actualValue); + $actualValue = $actualApiRequestObject->getResourceInfo(); + $this->assertProtobufEquals($resourceInfo, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reportStatusTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function reportStatusExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/reportStatusTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedAppConnector = $gapicClient->appConnectorName('[PROJECT]', '[LOCATION]', '[APP_CONNECTOR]'); + $resourceInfo = new ResourceInfo(); + $resourceInfoId = 'resourceInfoId-332404713'; + $resourceInfo->setId($resourceInfoId); + $request = (new ReportStatusRequest()) + ->setAppConnector($formattedAppConnector) + ->setResourceInfo($resourceInfo); + $response = $gapicClient->reportStatus($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reportStatusTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateAppConnectorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateAppConnectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new AppConnector(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateAppConnectorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $appConnector = new AppConnector(); + $appConnectorName = 'appConnectorName-1263736873'; + $appConnector->setName($appConnectorName); + $appConnectorPrincipalInfo = new PrincipalInfo(); + $appConnector->setPrincipalInfo($appConnectorPrincipalInfo); + $request = (new UpdateAppConnectorRequest()) + ->setUpdateMask($updateMask) + ->setAppConnector($appConnector); + $response = $gapicClient->updateAppConnector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService/UpdateAppConnector', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getAppConnector(); + $this->assertProtobufEquals($appConnector, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAppConnectorTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateAppConnectorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateAppConnectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $appConnector = new AppConnector(); + $appConnectorName = 'appConnectorName-1263736873'; + $appConnector->setName($appConnectorName); + $appConnectorPrincipalInfo = new PrincipalInfo(); + $appConnector->setPrincipalInfo($appConnectorPrincipalInfo); + $request = (new UpdateAppConnectorRequest()) + ->setUpdateMask($updateMask) + ->setAppConnector($appConnector); + $response = $gapicClient->updateAppConnector($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAppConnectorTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createAppConnectorAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createAppConnectorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new AppConnector(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAppConnectorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $appConnector = new AppConnector(); + $appConnectorName = 'appConnectorName-1263736873'; + $appConnector->setName($appConnectorName); + $appConnectorPrincipalInfo = new PrincipalInfo(); + $appConnector->setPrincipalInfo($appConnectorPrincipalInfo); + $request = (new CreateAppConnectorRequest()) + ->setParent($formattedParent) + ->setAppConnector($appConnector); + $response = $gapicClient->createAppConnectorAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService/CreateAppConnector', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAppConnector(); + $this->assertProtobufEquals($appConnector, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAppConnectorTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appgateways/V1/AppGatewaysService.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appgateways/V1/AppGatewaysService.php new file mode 100644 index 000000000000..2dd093d5d5bb Binary files /dev/null and b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Appgateways/V1/AppGatewaysService.php differ diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway.php new file mode 100644 index 000000000000..37dbc13aa53e --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway.php @@ -0,0 +1,442 @@ +google.cloud.beyondcorp.appgateways.v1.AppGateway + */ +class AppGateway extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Unique resource name of the AppGateway. + * The name is ignored when creating an AppGateway. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Timestamp when the resource was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Resource labels to represent user provided metadata. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed + * 64 characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Output only. A unique identifier for the instance generated by the + * system. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Required. The type of network connectivity used by the AppGateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + /** + * Output only. The current state of the AppGateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Server-defined URI for this resource. + * + * Generated from protobuf field string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uri = ''; + /** + * Output only. A list of connections allocated for the Gateway + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $allocated_connections; + /** + * Required. The type of hosting used by the AppGateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $host_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Unique resource name of the AppGateway. + * The name is ignored when creating an AppGateway. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp when the resource was last modified. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels to represent user provided metadata. + * @type string $display_name + * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed + * 64 characters. + * @type string $uid + * Output only. A unique identifier for the instance generated by the + * system. + * @type int $type + * Required. The type of network connectivity used by the AppGateway. + * @type int $state + * Output only. The current state of the AppGateway. + * @type string $uri + * Output only. Server-defined URI for this resource. + * @type array<\Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway\AllocatedConnection>|\Google\Protobuf\Internal\RepeatedField $allocated_connections + * Output only. A list of connections allocated for the Gateway + * @type int $host_type + * Required. The type of hosting used by the AppGateway. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appgateways\V1\AppGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Unique resource name of the AppGateway. + * The name is ignored when creating an AppGateway. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Unique resource name of the AppGateway. + * The name is ignored when creating an AppGateway. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Timestamp when the resource was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Timestamp when the resource was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed + * 64 characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed + * 64 characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. A unique identifier for the instance generated by the + * system. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A unique identifier for the instance generated by the + * system. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Required. The type of network connectivity used by the AppGateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The type of network connectivity used by the AppGateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. The current state of the AppGateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the AppGateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Server-defined URI for this resource. + * + * Generated from protobuf field string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Output only. Server-defined URI for this resource. + * + * Generated from protobuf field string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Output only. A list of connections allocated for the Gateway + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllocatedConnections() + { + return $this->allocated_connections; + } + + /** + * Output only. A list of connections allocated for the Gateway + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway\AllocatedConnection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllocatedConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway\AllocatedConnection::class); + $this->allocated_connections = $arr; + + return $this; + } + + /** + * Required. The type of hosting used by the AppGateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getHostType() + { + return $this->host_type; + } + + /** + * Required. The type of hosting used by the AppGateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setHostType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway\HostType::class); + $this->host_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/AllocatedConnection.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/AllocatedConnection.php new file mode 100644 index 000000000000..ae86af600c62 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/AllocatedConnection.php @@ -0,0 +1,104 @@ +google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + */ +class AllocatedConnection extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The PSC uri of an allocated connection + * + * Generated from protobuf field string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $psc_uri = ''; + /** + * Required. The ingress port of an allocated connection + * + * Generated from protobuf field int32 ingress_port = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ingress_port = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $psc_uri + * Required. The PSC uri of an allocated connection + * @type int $ingress_port + * Required. The ingress port of an allocated connection + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appgateways\V1\AppGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The PSC uri of an allocated connection + * + * Generated from protobuf field string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPscUri() + { + return $this->psc_uri; + } + + /** + * Required. The PSC uri of an allocated connection + * + * Generated from protobuf field string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPscUri($var) + { + GPBUtil::checkString($var, True); + $this->psc_uri = $var; + + return $this; + } + + /** + * Required. The ingress port of an allocated connection + * + * Generated from protobuf field int32 ingress_port = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getIngressPort() + { + return $this->ingress_port; + } + + /** + * Required. The ingress port of an allocated connection + * + * Generated from protobuf field int32 ingress_port = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setIngressPort($var) + { + GPBUtil::checkInt32($var); + $this->ingress_port = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllocatedConnection::class, \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway_AllocatedConnection::class); + diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/HostType.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/HostType.php new file mode 100644 index 000000000000..0be7ad2a31c9 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/HostType.php @@ -0,0 +1,58 @@ +google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType + */ +class HostType +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum HOST_TYPE_UNSPECIFIED = 0; + */ + const HOST_TYPE_UNSPECIFIED = 0; + /** + * AppGateway hosted in a GCP regional managed instance group. + * + * Generated from protobuf enum GCP_REGIONAL_MIG = 1; + */ + const GCP_REGIONAL_MIG = 1; + + private static $valueToName = [ + self::HOST_TYPE_UNSPECIFIED => 'HOST_TYPE_UNSPECIFIED', + self::GCP_REGIONAL_MIG => 'GCP_REGIONAL_MIG', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HostType::class, \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway_HostType::class); + diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/State.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/State.php new file mode 100644 index 000000000000..ab280c73a846 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/State.php @@ -0,0 +1,86 @@ +google.cloud.beyondcorp.appgateways.v1.AppGateway.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * AppGateway is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * AppGateway has been created. + * + * Generated from protobuf enum CREATED = 2; + */ + const CREATED = 2; + /** + * AppGateway's configuration is being updated. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * AppGateway is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * AppGateway is down and may be restored in the future. + * This happens when CCFE sends ProjectState = OFF. + * + * Generated from protobuf enum DOWN = 5; + */ + const DOWN = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::CREATED => 'CREATED', + self::UPDATING => 'UPDATING', + self::DELETING => 'DELETING', + self::DOWN => 'DOWN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway_State::class); + diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/Type.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/Type.php new file mode 100644 index 000000000000..237bf4a3fd35 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGateway/Type.php @@ -0,0 +1,58 @@ +google.cloud.beyondcorp.appgateways.v1.AppGateway.Type + */ +class Type +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * TCP Proxy based BeyondCorp Connection. API will default to this if unset. + * + * Generated from protobuf enum TCP_PROXY = 1; + */ + const TCP_PROXY = 1; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::TCP_PROXY => 'TCP_PROXY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway_Type::class); + diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGatewayOperationMetadata.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGatewayOperationMetadata.php new file mode 100644 index 000000000000..cc45976fe154 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/AppGatewayOperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata + */ +class AppGatewayOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appgateways\V1\AppGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/CreateAppGatewayRequest.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/CreateAppGatewayRequest.php new file mode 100644 index 000000000000..1462f6d587f3 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/CreateAppGatewayRequest.php @@ -0,0 +1,295 @@ +google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest + */ +class CreateAppGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource project name of the AppGateway location using the + * form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. User-settable AppGateway resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $app_gateway_id = ''; + /** + * Required. A BeyondCorp AppGateway resource. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $app_gateway = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The resource project name of the AppGateway location using the + * form: `projects/{project_id}/locations/{location_id}` + * Please see {@see AppGatewaysServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway $appGateway Required. A BeyondCorp AppGateway resource. + * @param string $appGatewayId Optional. User-settable AppGateway resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * @return \Google\Cloud\BeyondCorp\AppGateways\V1\CreateAppGatewayRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway $appGateway, string $appGatewayId): self + { + return (new self()) + ->setParent($parent) + ->setAppGateway($appGateway) + ->setAppGatewayId($appGatewayId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource project name of the AppGateway location using the + * form: `projects/{project_id}/locations/{location_id}` + * @type string $app_gateway_id + * Optional. User-settable AppGateway resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * @type \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway $app_gateway + * Required. A BeyondCorp AppGateway resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appgateways\V1\AppGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource project name of the AppGateway location using the + * form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource project name of the AppGateway location using the + * form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. User-settable AppGateway resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAppGatewayId() + { + return $this->app_gateway_id; + } + + /** + * Optional. User-settable AppGateway resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAppGatewayId($var) + { + GPBUtil::checkString($var, True); + $this->app_gateway_id = $var; + + return $this; + } + + /** + * Required. A BeyondCorp AppGateway resource. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway|null + */ + public function getAppGateway() + { + return $this->app_gateway; + } + + public function hasAppGateway() + { + return isset($this->app_gateway); + } + + public function clearAppGateway() + { + unset($this->app_gateway); + } + + /** + * Required. A BeyondCorp AppGateway resource. + * + * Generated from protobuf field .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway $var + * @return $this + */ + public function setAppGateway($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway::class); + $this->app_gateway = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/DeleteAppGatewayRequest.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/DeleteAppGatewayRequest.php new file mode 100644 index 000000000000..0dd9bed3f1c3 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/DeleteAppGatewayRequest.php @@ -0,0 +1,198 @@ +google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest + */ +class DeleteAppGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * Please see {@see AppGatewaysServiceClient::appGatewayName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\AppGateways\V1\DeleteAppGatewayRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appgateways\V1\AppGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/GetAppGatewayRequest.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/GetAppGatewayRequest.php new file mode 100644 index 000000000000..f19a8b563b82 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/GetAppGatewayRequest.php @@ -0,0 +1,86 @@ +google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest + */ +class GetAppGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * Please see {@see AppGatewaysServiceClient::appGatewayName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\AppGateways\V1\GetAppGatewayRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appgateways\V1\AppGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/ListAppGatewaysRequest.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/ListAppGatewaysRequest.php new file mode 100644 index 000000000000..7fde412ec54b --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/ListAppGatewaysRequest.php @@ -0,0 +1,258 @@ +google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest + */ +class ListAppGatewaysRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the AppGateway location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppGatewaysResponse.next_page_token] to + * determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous + * ListAppGatewaysRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter specifying constraints of a list operation. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The resource name of the AppGateway location using the form: + * `projects/{project_id}/locations/{location_id}` + * Please see {@see AppGatewaysServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\AppGateways\V1\ListAppGatewaysRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the AppGateway location using the form: + * `projects/{project_id}/locations/{location_id}` + * @type int $page_size + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppGatewaysResponse.next_page_token] to + * determine if there are more instances left to be queried. + * @type string $page_token + * Optional. The next_page_token value returned from a previous + * ListAppGatewaysRequest, if any. + * @type string $filter + * Optional. A filter specifying constraints of a list operation. + * @type string $order_by + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appgateways\V1\AppGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the AppGateway location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the AppGateway location using the form: + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppGatewaysResponse.next_page_token] to + * determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return. + * If not specified, a default value of 50 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [next_page_token][BeyondCorp.ListAppGatewaysResponse.next_page_token] to + * determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous + * ListAppGatewaysRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous + * ListAppGatewaysRequest, if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter specifying constraints of a list operation. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter specifying constraints of a list operation. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Specifies the ordering of results. See + * [Sorting + * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * for more information. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/ListAppGatewaysResponse.php b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/ListAppGatewaysResponse.php new file mode 100644 index 000000000000..757bac5b484a --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/proto/src/Google/Cloud/BeyondCorp/AppGateways/V1/ListAppGatewaysResponse.php @@ -0,0 +1,139 @@ +google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse + */ +class ListAppGatewaysResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of BeyondCorp AppGateways in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + private $app_gateways; + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway>|\Google\Protobuf\Internal\RepeatedField $app_gateways + * A list of BeyondCorp AppGateways in the project. + * @type string $next_page_token + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * A list of locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Appgateways\V1\AppGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * A list of BeyondCorp AppGateways in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppGateways() + { + return $this->app_gateways; + } + + /** + * A list of BeyondCorp AppGateways in the project. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + * @param array<\Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppGateways($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway::class); + $this->app_gateways = $arr; + + return $this; + } + + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * A list of locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/create_app_gateway.php b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/create_app_gateway.php new file mode 100644 index 000000000000..cc4f12844f92 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/create_app_gateway.php @@ -0,0 +1,102 @@ +setName($appGatewayName) + ->setType($appGatewayType) + ->setHostType($appGatewayHostType); + $request = (new CreateAppGatewayRequest()) + ->setParent($formattedParent) + ->setAppGateway($appGateway); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $appGatewaysServiceClient->createAppGateway($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AppGateway $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AppGatewaysServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $appGatewayName = '[NAME]'; + $appGatewayType = Type::TYPE_UNSPECIFIED; + $appGatewayHostType = HostType::HOST_TYPE_UNSPECIFIED; + + create_app_gateway_sample($formattedParent, $appGatewayName, $appGatewayType, $appGatewayHostType); +} +// [END beyondcorp_v1_generated_AppGatewaysService_CreateAppGateway_sync] diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/delete_app_gateway.php b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/delete_app_gateway.php new file mode 100644 index 000000000000..cbe88510a8d9 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/delete_app_gateway.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $appGatewaysServiceClient->deleteAppGateway($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AppGatewaysServiceClient::appGatewayName( + '[PROJECT]', + '[LOCATION]', + '[APP_GATEWAY]' + ); + + delete_app_gateway_sample($formattedName); +} +// [END beyondcorp_v1_generated_AppGatewaysService_DeleteAppGateway_sync] diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/get_app_gateway.php b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/get_app_gateway.php new file mode 100644 index 000000000000..70f628baa129 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/get_app_gateway.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AppGateway $response */ + $response = $appGatewaysServiceClient->getAppGateway($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AppGatewaysServiceClient::appGatewayName( + '[PROJECT]', + '[LOCATION]', + '[APP_GATEWAY]' + ); + + get_app_gateway_sample($formattedName); +} +// [END beyondcorp_v1_generated_AppGatewaysService_GetAppGateway_sync] diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/get_iam_policy.php b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..996fa9d50caf --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $appGatewaysServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END beyondcorp_v1_generated_AppGatewaysService_GetIamPolicy_sync] diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/get_location.php b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/get_location.php new file mode 100644 index 000000000000..cb466ac0f4c5 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END beyondcorp_v1_generated_AppGatewaysService_GetLocation_sync] diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/list_app_gateways.php b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/list_app_gateways.php new file mode 100644 index 000000000000..a1838da39d45 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/list_app_gateways.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $appGatewaysServiceClient->listAppGateways($request); + + /** @var AppGateway $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AppGatewaysServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_app_gateways_sample($formattedParent); +} +// [END beyondcorp_v1_generated_AppGatewaysService_ListAppGateways_sync] diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/list_locations.php b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/list_locations.php new file mode 100644 index 000000000000..2bff3d26f2b9 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END beyondcorp_v1_generated_AppGatewaysService_ListLocations_sync] diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/set_iam_policy.php b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..083c84078eee --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $appGatewaysServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END beyondcorp_v1_generated_AppGatewaysService_SetIamPolicy_sync] diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/test_iam_permissions.php b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..d1dcf2c86d2a --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/samples/V1/AppGatewaysServiceClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $appGatewaysServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END beyondcorp_v1_generated_AppGatewaysService_TestIamPermissions_sync] diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/Client/AppGatewaysServiceClient.php b/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/Client/AppGatewaysServiceClient.php new file mode 100644 index 000000000000..dd0afca155d4 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/Client/AppGatewaysServiceClient.php @@ -0,0 +1,568 @@ + createAppGatewayAsync(CreateAppGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAppGatewayAsync(DeleteAppGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAppGatewayAsync(GetAppGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAppGatewaysAsync(ListAppGatewaysRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class AppGatewaysServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.beyondcorp.appgateways.v1.AppGatewaysService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'beyondcorp.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'beyondcorp.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/app_gateways_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/app_gateways_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/app_gateways_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/app_gateways_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a app_gateway + * resource. + * + * @param string $project + * @param string $location + * @param string $appGateway + * + * @return string The formatted app_gateway resource. + */ + public static function appGatewayName(string $project, string $location, string $appGateway): string + { + return self::getPathTemplate('appGateway')->render([ + 'project' => $project, + 'location' => $location, + 'app_gateway' => $appGateway, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - appGateway: projects/{project}/locations/{location}/appGateways/{app_gateway} + * - location: projects/{project}/locations/{location} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'beyondcorp.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new AppGateway in a given project and location. + * + * The async variant is {@see AppGatewaysServiceClient::createAppGatewayAsync()} . + * + * @example samples/V1/AppGatewaysServiceClient/create_app_gateway.php + * + * @param CreateAppGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAppGateway(CreateAppGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateAppGateway', $request, $callOptions)->wait(); + } + + /** + * Deletes a single AppGateway. + * + * The async variant is {@see AppGatewaysServiceClient::deleteAppGatewayAsync()} . + * + * @example samples/V1/AppGatewaysServiceClient/delete_app_gateway.php + * + * @param DeleteAppGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAppGateway(DeleteAppGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteAppGateway', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single AppGateway. + * + * The async variant is {@see AppGatewaysServiceClient::getAppGatewayAsync()} . + * + * @example samples/V1/AppGatewaysServiceClient/get_app_gateway.php + * + * @param GetAppGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AppGateway + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAppGateway(GetAppGatewayRequest $request, array $callOptions = []): AppGateway + { + return $this->startApiCall('GetAppGateway', $request, $callOptions)->wait(); + } + + /** + * Lists AppGateways in a given project and location. + * + * The async variant is {@see AppGatewaysServiceClient::listAppGatewaysAsync()} . + * + * @example samples/V1/AppGatewaysServiceClient/list_app_gateways.php + * + * @param ListAppGatewaysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAppGateways(ListAppGatewaysRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAppGateways', $request, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AppGatewaysServiceClient::getLocationAsync()} . + * + * @example samples/V1/AppGatewaysServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see AppGatewaysServiceClient::listLocationsAsync()} . + * + * @example samples/V1/AppGatewaysServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see AppGatewaysServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/AppGatewaysServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see AppGatewaysServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/AppGatewaysServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is {@see AppGatewaysServiceClient::testIamPermissionsAsync()} + * . + * + * @example samples/V1/AppGatewaysServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..7a4405a3cc86 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/gapic_metadata.json @@ -0,0 +1,63 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.beyondcorp.appgateways.v1", + "libraryPackage": "Google\\Cloud\\BeyondCorp\\AppGateways\\V1", + "services": { + "AppGatewaysService": { + "clients": { + "grpc": { + "libraryClient": "AppGatewaysServiceGapicClient", + "rpcs": { + "CreateAppGateway": { + "methods": [ + "createAppGateway" + ] + }, + "DeleteAppGateway": { + "methods": [ + "deleteAppGateway" + ] + }, + "GetAppGateway": { + "methods": [ + "getAppGateway" + ] + }, + "ListAppGateways": { + "methods": [ + "listAppGateways" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/resources/app_gateways_service_client_config.json b/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/resources/app_gateways_service_client_config.json new file mode 100644 index 000000000000..17dd44bd7ca4 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/resources/app_gateways_service_client_config.json @@ -0,0 +1,67 @@ +{ + "interfaces": { + "google.cloud.beyondcorp.appgateways.v1.AppGatewaysService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateAppGateway": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteAppGateway": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetAppGateway": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListAppGateways": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/resources/app_gateways_service_descriptor_config.php b/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/resources/app_gateways_service_descriptor_config.php new file mode 100644 index 000000000000..8100e79b67a2 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/resources/app_gateways_service_descriptor_config.php @@ -0,0 +1,175 @@ + [ + 'google.cloud.beyondcorp.appgateways.v1.AppGatewaysService' => [ + 'CreateAppGateway' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\AppGateways\V1\AppGatewayOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAppGateway' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\AppGateways\V1\AppGatewayOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetAppGateway' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BeyondCorp\AppGateways\V1\AppGateway', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAppGateways' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAppGateways', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BeyondCorp\AppGateways\V1\ListAppGatewaysResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'appGateway' => 'projects/{project}/locations/{location}/appGateways/{app_gateway}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/resources/app_gateways_service_rest_client_config.php b/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/resources/app_gateways_service_rest_client_config.php new file mode 100644 index 000000000000..b1d9ab39bc31 --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/src/V1/resources/app_gateways_service_rest_client_config.php @@ -0,0 +1,244 @@ + [ + 'google.cloud.beyondcorp.appgateways.v1.AppGatewaysService' => [ + 'CreateAppGateway' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/appGateways', + 'body' => 'app_gateway', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAppGateway' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/appGateways/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAppGateway' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/appGateways/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListAppGateways' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/appGateways', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/BeyondCorpAppGateways/v1/tests/Unit/V1/Client/AppGatewaysServiceClientTest.php b/owl-bot-staging/BeyondCorpAppGateways/v1/tests/Unit/V1/Client/AppGatewaysServiceClientTest.php new file mode 100644 index 000000000000..70fdb804f5ce --- /dev/null +++ b/owl-bot-staging/BeyondCorpAppGateways/v1/tests/Unit/V1/Client/AppGatewaysServiceClientTest.php @@ -0,0 +1,904 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AppGatewaysServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AppGatewaysServiceClient($options); + } + + /** @test */ + public function createAppGatewayTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createAppGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $uri = 'uri116076'; + $expectedResponse = new AppGateway(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setUri($uri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAppGatewayTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $appGateway = new AppGateway(); + $appGatewayName = 'appGatewayName-1786203634'; + $appGateway->setName($appGatewayName); + $appGatewayType = Type::TYPE_UNSPECIFIED; + $appGateway->setType($appGatewayType); + $appGatewayHostType = HostType::HOST_TYPE_UNSPECIFIED; + $appGateway->setHostType($appGatewayHostType); + $request = (new CreateAppGatewayRequest()) + ->setParent($formattedParent) + ->setAppGateway($appGateway); + $response = $gapicClient->createAppGateway($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appgateways.v1.AppGatewaysService/CreateAppGateway', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAppGateway(); + $this->assertProtobufEquals($appGateway, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAppGatewayTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createAppGatewayExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createAppGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $appGateway = new AppGateway(); + $appGatewayName = 'appGatewayName-1786203634'; + $appGateway->setName($appGatewayName); + $appGatewayType = Type::TYPE_UNSPECIFIED; + $appGateway->setType($appGatewayType); + $appGatewayHostType = HostType::HOST_TYPE_UNSPECIFIED; + $appGateway->setHostType($appGatewayHostType); + $request = (new CreateAppGatewayRequest()) + ->setParent($formattedParent) + ->setAppGateway($appGateway); + $response = $gapicClient->createAppGateway($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAppGatewayTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteAppGatewayTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteAppGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteAppGatewayTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->appGatewayName('[PROJECT]', '[LOCATION]', '[APP_GATEWAY]'); + $request = (new DeleteAppGatewayRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteAppGateway($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appgateways.v1.AppGatewaysService/DeleteAppGateway', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteAppGatewayTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteAppGatewayExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteAppGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->appGatewayName('[PROJECT]', '[LOCATION]', '[APP_GATEWAY]'); + $request = (new DeleteAppGatewayRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteAppGateway($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteAppGatewayTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getAppGatewayTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $uri = 'uri116076'; + $expectedResponse = new AppGateway(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setUri($uri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->appGatewayName('[PROJECT]', '[LOCATION]', '[APP_GATEWAY]'); + $request = (new GetAppGatewayRequest()) + ->setName($formattedName); + $response = $gapicClient->getAppGateway($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appgateways.v1.AppGatewaysService/GetAppGateway', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAppGatewayExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->appGatewayName('[PROJECT]', '[LOCATION]', '[APP_GATEWAY]'); + $request = (new GetAppGatewayRequest()) + ->setName($formattedName); + try { + $gapicClient->getAppGateway($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAppGatewaysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $appGatewaysElement = new AppGateway(); + $appGateways = [ + $appGatewaysElement, + ]; + $expectedResponse = new ListAppGatewaysResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAppGateways($appGateways); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListAppGatewaysRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listAppGateways($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAppGateways()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appgateways.v1.AppGatewaysService/ListAppGateways', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAppGatewaysExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListAppGatewaysRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listAppGateways($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createAppGatewayAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createAppGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $uri = 'uri116076'; + $expectedResponse = new AppGateway(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setUri($uri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAppGatewayTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $appGateway = new AppGateway(); + $appGatewayName = 'appGatewayName-1786203634'; + $appGateway->setName($appGatewayName); + $appGatewayType = Type::TYPE_UNSPECIFIED; + $appGateway->setType($appGatewayType); + $appGatewayHostType = HostType::HOST_TYPE_UNSPECIFIED; + $appGateway->setHostType($appGatewayHostType); + $request = (new CreateAppGatewayRequest()) + ->setParent($formattedParent) + ->setAppGateway($appGateway); + $response = $gapicClient->createAppGatewayAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.appgateways.v1.AppGatewaysService/CreateAppGateway', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAppGateway(); + $this->assertProtobufEquals($appGateway, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAppGatewayTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Clientconnectorservices/V1/ClientConnectorServicesService.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Clientconnectorservices/V1/ClientConnectorServicesService.php new file mode 100644 index 000000000000..6282c792c478 Binary files /dev/null and b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Clientconnectorservices/V1/ClientConnectorServicesService.php differ diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService.php new file mode 100644 index 000000000000..bb20f193a989 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService.php @@ -0,0 +1,327 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService + */ +class ClientConnectorService extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of resource. The name is ignored during creation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. [Output only] Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. [Output only] Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. User-provided name. + * The display name should follow certain format. + * * Must be 6 to 30 characters in length. + * * Can only contain lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * + * Generated from protobuf field string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Required. The details of the ingress settings. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress ingress = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ingress = null; + /** + * Required. The details of the egress settings. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Egress egress = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $egress = null; + /** + * Output only. The operational state of the ClientConnectorService. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of resource. The name is ignored during creation. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. [Output only] Create time stamp. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. [Output only] Update time stamp. + * @type string $display_name + * Optional. User-provided name. + * The display name should follow certain format. + * * Must be 6 to 30 characters in length. + * * Can only contain lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * @type \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress $ingress + * Required. The details of the ingress settings. + * @type \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Egress $egress + * Required. The details of the egress settings. + * @type int $state + * Output only. The operational state of the ClientConnectorService. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of resource. The name is ignored during creation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of resource. The name is ignored during creation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. [Output only] Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. [Output only] Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. [Output only] Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. [Output only] Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. User-provided name. + * The display name should follow certain format. + * * Must be 6 to 30 characters in length. + * * Can only contain lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * + * Generated from protobuf field string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. User-provided name. + * The display name should follow certain format. + * * Must be 6 to 30 characters in length. + * * Can only contain lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * + * Generated from protobuf field string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. The details of the ingress settings. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress ingress = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress|null + */ + public function getIngress() + { + return $this->ingress; + } + + public function hasIngress() + { + return isset($this->ingress); + } + + public function clearIngress() + { + unset($this->ingress); + } + + /** + * Required. The details of the ingress settings. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress ingress = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress $var + * @return $this + */ + public function setIngress($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress::class); + $this->ingress = $var; + + return $this; + } + + /** + * Required. The details of the egress settings. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Egress egress = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Egress|null + */ + public function getEgress() + { + return $this->egress; + } + + public function hasEgress() + { + return isset($this->egress); + } + + public function clearEgress() + { + unset($this->egress); + } + + /** + * Required. The details of the egress settings. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Egress egress = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Egress $var + * @return $this + */ + public function setEgress($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Egress::class); + $this->egress = $var; + + return $this; + } + + /** + * Output only. The operational state of the ClientConnectorService. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The operational state of the ClientConnectorService. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Egress.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Egress.php new file mode 100644 index 000000000000..44f15504298f --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Egress.php @@ -0,0 +1,78 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Egress + */ +class Egress extends \Google\Protobuf\Internal\Message +{ + protected $destination_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Egress\PeeredVpc $peered_vpc + * A VPC from the consumer project. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * A VPC from the consumer project. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Egress.PeeredVpc peered_vpc = 1; + * @return \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Egress\PeeredVpc|null + */ + public function getPeeredVpc() + { + return $this->readOneof(1); + } + + public function hasPeeredVpc() + { + return $this->hasOneof(1); + } + + /** + * A VPC from the consumer project. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Egress.PeeredVpc peered_vpc = 1; + * @param \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Egress\PeeredVpc $var + * @return $this + */ + public function setPeeredVpc($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Egress\PeeredVpc::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestinationType() + { + return $this->whichOneof("destination_type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Egress::class, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService_Egress::class); + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Egress/PeeredVpc.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Egress/PeeredVpc.php new file mode 100644 index 000000000000..cb600f930cf7 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Egress/PeeredVpc.php @@ -0,0 +1,70 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Egress.PeeredVpc + */ +class PeeredVpc extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the peered VPC owned by the consumer project. + * + * Generated from protobuf field string network_vpc = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_vpc = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_vpc + * Required. The name of the peered VPC owned by the consumer project. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the peered VPC owned by the consumer project. + * + * Generated from protobuf field string network_vpc = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkVpc() + { + return $this->network_vpc; + } + + /** + * Required. The name of the peered VPC owned by the consumer project. + * + * Generated from protobuf field string network_vpc = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkVpc($var) + { + GPBUtil::checkString($var, True); + $this->network_vpc = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PeeredVpc::class, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService_Egress_PeeredVpc::class); + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress.php new file mode 100644 index 000000000000..3d5145bd439d --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress.php @@ -0,0 +1,79 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress + */ +class Ingress extends \Google\Protobuf\Internal\Message +{ + protected $ingress_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress\Config $config + * The basic ingress config for ClientGateways. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * The basic ingress config for ClientGateways. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress.Config config = 1; + * @return \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress\Config|null + */ + public function getConfig() + { + return $this->readOneof(1); + } + + public function hasConfig() + { + return $this->hasOneof(1); + } + + /** + * The basic ingress config for ClientGateways. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress.Config config = 1; + * @param \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress\Config $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress\Config::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getIngressConfig() + { + return $this->whichOneof("ingress_config"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Ingress::class, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService_Ingress::class); + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress/Config.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress/Config.php new file mode 100644 index 000000000000..ed18102df8ba --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress/Config.php @@ -0,0 +1,108 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress.Config + */ +class Config extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. The transport protocol used between the client and + * the server. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress.Config.TransportProtocol transport_protocol = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $transport_protocol = 0; + /** + * Required. The settings used to configure basic ClientGateways. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress.Config.DestinationRoute destination_routes = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $destination_routes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $transport_protocol + * Required. Immutable. The transport protocol used between the client and + * the server. + * @type array<\Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress\Config\DestinationRoute>|\Google\Protobuf\Internal\RepeatedField $destination_routes + * Required. The settings used to configure basic ClientGateways. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. The transport protocol used between the client and + * the server. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress.Config.TransportProtocol transport_protocol = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getTransportProtocol() + { + return $this->transport_protocol; + } + + /** + * Required. Immutable. The transport protocol used between the client and + * the server. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress.Config.TransportProtocol transport_protocol = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setTransportProtocol($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress\Config\TransportProtocol::class); + $this->transport_protocol = $var; + + return $this; + } + + /** + * Required. The settings used to configure basic ClientGateways. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress.Config.DestinationRoute destination_routes = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestinationRoutes() + { + return $this->destination_routes; + } + + /** + * Required. The settings used to configure basic ClientGateways. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress.Config.DestinationRoute destination_routes = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress\Config\DestinationRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestinationRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService\Ingress\Config\DestinationRoute::class); + $this->destination_routes = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Config::class, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService_Ingress_Config::class); + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress/Config/DestinationRoute.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress/Config/DestinationRoute.php new file mode 100644 index 000000000000..42f139cc3904 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress/Config/DestinationRoute.php @@ -0,0 +1,114 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress.Config.DestinationRoute + */ +class DestinationRoute extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The network address of the subnet + * for which the packet is routed to the ClientGateway. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $address = ''; + /** + * Required. The network mask of the subnet + * for which the packet is routed to the ClientGateway. + * + * Generated from protobuf field string netmask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $netmask = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * Required. The network address of the subnet + * for which the packet is routed to the ClientGateway. + * @type string $netmask + * Required. The network mask of the subnet + * for which the packet is routed to the ClientGateway. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The network address of the subnet + * for which the packet is routed to the ClientGateway. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Required. The network address of the subnet + * for which the packet is routed to the ClientGateway. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * Required. The network mask of the subnet + * for which the packet is routed to the ClientGateway. + * + * Generated from protobuf field string netmask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetmask() + { + return $this->netmask; + } + + /** + * Required. The network mask of the subnet + * for which the packet is routed to the ClientGateway. + * + * Generated from protobuf field string netmask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetmask($var) + { + GPBUtil::checkString($var, True); + $this->netmask = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DestinationRoute::class, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService_Ingress_Config_DestinationRoute::class); + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress/Config/TransportProtocol.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress/Config/TransportProtocol.php new file mode 100644 index 000000000000..988fe0a16327 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/Ingress/Config/TransportProtocol.php @@ -0,0 +1,57 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.Ingress.Config.TransportProtocol + */ +class TransportProtocol +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TRANSPORT_PROTOCOL_UNSPECIFIED = 0; + */ + const TRANSPORT_PROTOCOL_UNSPECIFIED = 0; + /** + * TCP protocol. + * + * Generated from protobuf enum TCP = 1; + */ + const TCP = 1; + + private static $valueToName = [ + self::TRANSPORT_PROTOCOL_UNSPECIFIED => 'TRANSPORT_PROTOCOL_UNSPECIFIED', + self::TCP => 'TCP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TransportProtocol::class, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService_Ingress_Config_TransportProtocol::class); + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/State.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/State.php new file mode 100644 index 000000000000..effe28bb052a --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorService/State.php @@ -0,0 +1,94 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * ClientConnectorService is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * ClientConnectorService is being updated. + * + * Generated from protobuf enum UPDATING = 2; + */ + const UPDATING = 2; + /** + * ClientConnectorService is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * ClientConnectorService is running. + * + * Generated from protobuf enum RUNNING = 4; + */ + const RUNNING = 4; + /** + * ClientConnectorService is down and may be restored in the future. + * This happens when CCFE sends ProjectState = OFF. + * + * Generated from protobuf enum DOWN = 5; + */ + const DOWN = 5; + /** + * ClientConnectorService encountered an error and is in an indeterministic + * state. + * + * Generated from protobuf enum ERROR = 6; + */ + const ERROR = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::UPDATING => 'UPDATING', + self::DELETING => 'DELETING', + self::RUNNING => 'RUNNING', + self::DOWN => 'DOWN', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService_State::class); + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorServiceOperationMetadata.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorServiceOperationMetadata.php new file mode 100644 index 000000000000..844551d17009 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ClientConnectorServiceOperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServiceOperationMetadata + */ +class ClientConnectorServiceOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/CreateClientConnectorServiceRequest.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/CreateClientConnectorServiceRequest.php new file mode 100644 index 000000000000..0a95214649da --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/CreateClientConnectorServiceRequest.php @@ -0,0 +1,301 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.CreateClientConnectorServiceRequest + */ +class CreateClientConnectorServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. User-settable client connector service resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * A random system generated name will be assigned + * if not specified by the user. + * + * Generated from protobuf field string client_connector_service_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $client_connector_service_id = ''; + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService client_connector_service = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $client_connector_service = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see ClientConnectorServicesServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService $clientConnectorService Required. The resource being created. + * @param string $clientConnectorServiceId Optional. User-settable client connector service resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * A random system generated name will be assigned + * if not specified by the user. + * + * @return \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\CreateClientConnectorServiceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService $clientConnectorService, string $clientConnectorServiceId): self + { + return (new self()) + ->setParent($parent) + ->setClientConnectorService($clientConnectorService) + ->setClientConnectorServiceId($clientConnectorServiceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $client_connector_service_id + * Optional. User-settable client connector service resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * A random system generated name will be assigned + * if not specified by the user. + * @type \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService $client_connector_service + * Required. The resource being created. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. User-settable client connector service resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * A random system generated name will be assigned + * if not specified by the user. + * + * Generated from protobuf field string client_connector_service_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getClientConnectorServiceId() + { + return $this->client_connector_service_id; + } + + /** + * Optional. User-settable client connector service resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * A random system generated name will be assigned + * if not specified by the user. + * + * Generated from protobuf field string client_connector_service_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setClientConnectorServiceId($var) + { + GPBUtil::checkString($var, True); + $this->client_connector_service_id = $var; + + return $this; + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService client_connector_service = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService|null + */ + public function getClientConnectorService() + { + return $this->client_connector_service; + } + + public function hasClientConnectorService() + { + return isset($this->client_connector_service); + } + + public function clearClientConnectorService() + { + unset($this->client_connector_service); + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService client_connector_service = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService $var + * @return $this + */ + public function setClientConnectorService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService::class); + $this->client_connector_service = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/DeleteClientConnectorServiceRequest.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/DeleteClientConnectorServiceRequest.php new file mode 100644 index 000000000000..191baa3fdc0e --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/DeleteClientConnectorServiceRequest.php @@ -0,0 +1,193 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.DeleteClientConnectorServiceRequest + */ +class DeleteClientConnectorServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see ClientConnectorServicesServiceClient::clientConnectorServiceName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\DeleteClientConnectorServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/GetClientConnectorServiceRequest.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/GetClientConnectorServiceRequest.php new file mode 100644 index 000000000000..375cdd935d62 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/GetClientConnectorServiceRequest.php @@ -0,0 +1,81 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.GetClientConnectorServiceRequest + */ +class GetClientConnectorServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see ClientConnectorServicesServiceClient::clientConnectorServiceName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\GetClientConnectorServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ListClientConnectorServicesRequest.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ListClientConnectorServicesRequest.php new file mode 100644 index 000000000000..5f92bfb0a749 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ListClientConnectorServicesRequest.php @@ -0,0 +1,221 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.ListClientConnectorServicesRequest + */ +class ListClientConnectorServicesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListClientConnectorServicesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListClientConnectorServicesRequest. Please see + * {@see ClientConnectorServicesServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ListClientConnectorServicesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListClientConnectorServicesRequest. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListClientConnectorServicesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListClientConnectorServicesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ListClientConnectorServicesResponse.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ListClientConnectorServicesResponse.php new file mode 100644 index 000000000000..606e1598f06e --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/ListClientConnectorServicesResponse.php @@ -0,0 +1,135 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.ListClientConnectorServicesResponse + */ +class ListClientConnectorServicesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of ClientConnectorService. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService client_connector_services = 1; + */ + private $client_connector_services; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService>|\Google\Protobuf\Internal\RepeatedField $client_connector_services + * The list of ClientConnectorService. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * The list of ClientConnectorService. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService client_connector_services = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClientConnectorServices() + { + return $this->client_connector_services; + } + + /** + * The list of ClientConnectorService. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService client_connector_services = 1; + * @param array<\Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClientConnectorServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService::class); + $this->client_connector_services = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/UpdateClientConnectorServiceRequest.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/UpdateClientConnectorServiceRequest.php new file mode 100644 index 000000000000..d972d609914e --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/proto/src/Google/Cloud/BeyondCorp/ClientConnectorServices/V1/UpdateClientConnectorServiceRequest.php @@ -0,0 +1,308 @@ +google.cloud.beyondcorp.clientconnectorservices.v1.UpdateClientConnectorServiceRequest + */ +class UpdateClientConnectorServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * ClientConnectorService resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * Mutable fields: display_name. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService client_connector_service = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $client_connector_service = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set as true, will create the resource if it is not found. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService $clientConnectorService Required. The resource being updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * ClientConnectorService resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Mutable fields: display_name. + * + * @return \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\UpdateClientConnectorServiceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService $clientConnectorService, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setClientConnectorService($clientConnectorService) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * ClientConnectorService resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * Mutable fields: display_name. + * @type \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService $client_connector_service + * Required. The resource being updated. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * @type bool $allow_missing + * Optional. If set as true, will create the resource if it is not found. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientconnectorservices\V1\ClientConnectorServicesService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * ClientConnectorService resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * Mutable fields: display_name. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * ClientConnectorService resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * Mutable fields: display_name. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService client_connector_service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService|null + */ + public function getClientConnectorService() + { + return $this->client_connector_service; + } + + public function hasClientConnectorService() + { + return isset($this->client_connector_service); + } + + public function clearClientConnectorService() + { + unset($this->client_connector_service); + } + + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService client_connector_service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService $var + * @return $this + */ + public function setClientConnectorService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService::class); + $this->client_connector_service = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set as true, will create the resource if it is not found. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set as true, will create the resource if it is not found. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/create_client_connector_service.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/create_client_connector_service.php new file mode 100644 index 000000000000..470f65418ff7 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/create_client_connector_service.php @@ -0,0 +1,96 @@ +setName($clientConnectorServiceName) + ->setIngress($clientConnectorServiceIngress) + ->setEgress($clientConnectorServiceEgress); + $request = (new CreateClientConnectorServiceRequest()) + ->setParent($formattedParent) + ->setClientConnectorService($clientConnectorService); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $clientConnectorServicesServiceClient->createClientConnectorService($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ClientConnectorService $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ClientConnectorServicesServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $clientConnectorServiceName = '[NAME]'; + + create_client_connector_service_sample($formattedParent, $clientConnectorServiceName); +} +// [END beyondcorp_v1_generated_ClientConnectorServicesService_CreateClientConnectorService_sync] diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/delete_client_connector_service.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/delete_client_connector_service.php new file mode 100644 index 000000000000..32795152c60a --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/delete_client_connector_service.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $clientConnectorServicesServiceClient->deleteClientConnectorService($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ClientConnectorServicesServiceClient::clientConnectorServiceName( + '[PROJECT]', + '[LOCATION]', + '[CLIENT_CONNECTOR_SERVICE]' + ); + + delete_client_connector_service_sample($formattedName); +} +// [END beyondcorp_v1_generated_ClientConnectorServicesService_DeleteClientConnectorService_sync] diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/get_client_connector_service.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/get_client_connector_service.php new file mode 100644 index 000000000000..df0d1d1beb4f --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/get_client_connector_service.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ClientConnectorService $response */ + $response = $clientConnectorServicesServiceClient->getClientConnectorService($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ClientConnectorServicesServiceClient::clientConnectorServiceName( + '[PROJECT]', + '[LOCATION]', + '[CLIENT_CONNECTOR_SERVICE]' + ); + + get_client_connector_service_sample($formattedName); +} +// [END beyondcorp_v1_generated_ClientConnectorServicesService_GetClientConnectorService_sync] diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/get_iam_policy.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..b341bdb728ed --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $clientConnectorServicesServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END beyondcorp_v1_generated_ClientConnectorServicesService_GetIamPolicy_sync] diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/get_location.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/get_location.php new file mode 100644 index 000000000000..a6d52b4a274a --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END beyondcorp_v1_generated_ClientConnectorServicesService_GetLocation_sync] diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/list_client_connector_services.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/list_client_connector_services.php new file mode 100644 index 000000000000..7ef63bc8ddb1 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/list_client_connector_services.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $clientConnectorServicesServiceClient->listClientConnectorServices($request); + + /** @var ClientConnectorService $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ClientConnectorServicesServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_client_connector_services_sample($formattedParent); +} +// [END beyondcorp_v1_generated_ClientConnectorServicesService_ListClientConnectorServices_sync] diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/list_locations.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/list_locations.php new file mode 100644 index 000000000000..f4b343381f1b --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END beyondcorp_v1_generated_ClientConnectorServicesService_ListLocations_sync] diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/set_iam_policy.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..f9dbbecda9bb --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $clientConnectorServicesServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END beyondcorp_v1_generated_ClientConnectorServicesService_SetIamPolicy_sync] diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/test_iam_permissions.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..59dd05dccdb7 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $clientConnectorServicesServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END beyondcorp_v1_generated_ClientConnectorServicesService_TestIamPermissions_sync] diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/update_client_connector_service.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/update_client_connector_service.php new file mode 100644 index 000000000000..270ef0c9aaef --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/samples/V1/ClientConnectorServicesServiceClient/update_client_connector_service.php @@ -0,0 +1,93 @@ +setName($clientConnectorServiceName) + ->setIngress($clientConnectorServiceIngress) + ->setEgress($clientConnectorServiceEgress); + $request = (new UpdateClientConnectorServiceRequest()) + ->setUpdateMask($updateMask) + ->setClientConnectorService($clientConnectorService); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $clientConnectorServicesServiceClient->updateClientConnectorService($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ClientConnectorService $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $clientConnectorServiceName = '[NAME]'; + + update_client_connector_service_sample($clientConnectorServiceName); +} +// [END beyondcorp_v1_generated_ClientConnectorServicesService_UpdateClientConnectorService_sync] diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/Client/ClientConnectorServicesServiceClient.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/Client/ClientConnectorServicesServiceClient.php new file mode 100644 index 000000000000..10de006a8e07 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/Client/ClientConnectorServicesServiceClient.php @@ -0,0 +1,606 @@ + createClientConnectorServiceAsync(CreateClientConnectorServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteClientConnectorServiceAsync(DeleteClientConnectorServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getClientConnectorServiceAsync(GetClientConnectorServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface listClientConnectorServicesAsync(ListClientConnectorServicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateClientConnectorServiceAsync(UpdateClientConnectorServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class ClientConnectorServicesServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServicesService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'beyondcorp.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'beyondcorp.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/client_connector_services_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/client_connector_services_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/client_connector_services_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/client_connector_services_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * client_connector_service resource. + * + * @param string $project + * @param string $location + * @param string $clientConnectorService + * + * @return string The formatted client_connector_service resource. + */ + public static function clientConnectorServiceName(string $project, string $location, string $clientConnectorService): string + { + return self::getPathTemplate('clientConnectorService')->render([ + 'project' => $project, + 'location' => $location, + 'client_connector_service' => $clientConnectorService, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - clientConnectorService: projects/{project}/locations/{location}/clientConnectorServices/{client_connector_service} + * - location: projects/{project}/locations/{location} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'beyondcorp.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new ClientConnectorService in a given project and location. + * + * The async variant is + * {@see ClientConnectorServicesServiceClient::createClientConnectorServiceAsync()} + * . + * + * @example samples/V1/ClientConnectorServicesServiceClient/create_client_connector_service.php + * + * @param CreateClientConnectorServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createClientConnectorService(CreateClientConnectorServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateClientConnectorService', $request, $callOptions)->wait(); + } + + /** + * Deletes a single ClientConnectorService. + * + * The async variant is + * {@see ClientConnectorServicesServiceClient::deleteClientConnectorServiceAsync()} + * . + * + * @example samples/V1/ClientConnectorServicesServiceClient/delete_client_connector_service.php + * + * @param DeleteClientConnectorServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteClientConnectorService(DeleteClientConnectorServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteClientConnectorService', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single ClientConnectorService. + * + * The async variant is + * {@see ClientConnectorServicesServiceClient::getClientConnectorServiceAsync()} . + * + * @example samples/V1/ClientConnectorServicesServiceClient/get_client_connector_service.php + * + * @param GetClientConnectorServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ClientConnectorService + * + * @throws ApiException Thrown if the API call fails. + */ + public function getClientConnectorService(GetClientConnectorServiceRequest $request, array $callOptions = []): ClientConnectorService + { + return $this->startApiCall('GetClientConnectorService', $request, $callOptions)->wait(); + } + + /** + * Lists ClientConnectorServices in a given project and location. + * + * The async variant is + * {@see ClientConnectorServicesServiceClient::listClientConnectorServicesAsync()} + * . + * + * @example samples/V1/ClientConnectorServicesServiceClient/list_client_connector_services.php + * + * @param ListClientConnectorServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listClientConnectorServices(ListClientConnectorServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListClientConnectorServices', $request, $callOptions); + } + + /** + * Updates the parameters of a single ClientConnectorService. + * + * The async variant is + * {@see ClientConnectorServicesServiceClient::updateClientConnectorServiceAsync()} + * . + * + * @example samples/V1/ClientConnectorServicesServiceClient/update_client_connector_service.php + * + * @param UpdateClientConnectorServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateClientConnectorService(UpdateClientConnectorServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateClientConnectorService', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is + * {@see ClientConnectorServicesServiceClient::getLocationAsync()} . + * + * @example samples/V1/ClientConnectorServicesServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is + * {@see ClientConnectorServicesServiceClient::listLocationsAsync()} . + * + * @example samples/V1/ClientConnectorServicesServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is + * {@see ClientConnectorServicesServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/ClientConnectorServicesServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is + * {@see ClientConnectorServicesServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/ClientConnectorServicesServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is + * {@see ClientConnectorServicesServiceClient::testIamPermissionsAsync()} . + * + * @example samples/V1/ClientConnectorServicesServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..720b69b26a56 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/gapic_metadata.json @@ -0,0 +1,68 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.beyondcorp.clientconnectorservices.v1", + "libraryPackage": "Google\\Cloud\\BeyondCorp\\ClientConnectorServices\\V1", + "services": { + "ClientConnectorServicesService": { + "clients": { + "grpc": { + "libraryClient": "ClientConnectorServicesServiceGapicClient", + "rpcs": { + "CreateClientConnectorService": { + "methods": [ + "createClientConnectorService" + ] + }, + "DeleteClientConnectorService": { + "methods": [ + "deleteClientConnectorService" + ] + }, + "GetClientConnectorService": { + "methods": [ + "getClientConnectorService" + ] + }, + "ListClientConnectorServices": { + "methods": [ + "listClientConnectorServices" + ] + }, + "UpdateClientConnectorService": { + "methods": [ + "updateClientConnectorService" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/resources/client_connector_services_service_client_config.json b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/resources/client_connector_services_service_client_config.json new file mode 100644 index 000000000000..28b8380f1ff7 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/resources/client_connector_services_service_client_config.json @@ -0,0 +1,72 @@ +{ + "interfaces": { + "google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServicesService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateClientConnectorService": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteClientConnectorService": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetClientConnectorService": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListClientConnectorServices": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateClientConnectorService": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/resources/client_connector_services_service_descriptor_config.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/resources/client_connector_services_service_descriptor_config.php new file mode 100644 index 000000000000..0dbda905ab14 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/resources/client_connector_services_service_descriptor_config.php @@ -0,0 +1,195 @@ + [ + 'google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServicesService' => [ + 'CreateClientConnectorService' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorServiceOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteClientConnectorService' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorServiceOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateClientConnectorService' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorServiceOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'client_connector_service.name', + 'fieldAccessors' => [ + 'getClientConnectorService', + 'getName', + ], + ], + ], + ], + 'GetClientConnectorService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ClientConnectorService', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListClientConnectorServices' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getClientConnectorServices', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BeyondCorp\ClientConnectorServices\V1\ListClientConnectorServicesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'clientConnectorService' => 'projects/{project}/locations/{location}/clientConnectorServices/{client_connector_service}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/resources/client_connector_services_service_rest_client_config.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/resources/client_connector_services_service_rest_client_config.php new file mode 100644 index 000000000000..ae310fcb8790 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/src/V1/resources/client_connector_services_service_rest_client_config.php @@ -0,0 +1,260 @@ + [ + 'google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServicesService' => [ + 'CreateClientConnectorService' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clientConnectorServices', + 'body' => 'client_connector_service', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteClientConnectorService' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clientConnectorServices/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetClientConnectorService' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clientConnectorServices/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListClientConnectorServices' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clientConnectorServices', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateClientConnectorService' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{client_connector_service.name=projects/*/locations/*/clientConnectorServices/*}', + 'body' => 'client_connector_service', + 'placeholders' => [ + 'client_connector_service.name' => [ + 'getters' => [ + 'getClientConnectorService', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/BeyondCorpClientConnectorServices/v1/tests/Unit/V1/Client/ClientConnectorServicesServiceClientTest.php b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/tests/Unit/V1/Client/ClientConnectorServicesServiceClientTest.php new file mode 100644 index 000000000000..df045ae7b20d --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientConnectorServices/v1/tests/Unit/V1/Client/ClientConnectorServicesServiceClientTest.php @@ -0,0 +1,1037 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ClientConnectorServicesServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ClientConnectorServicesServiceClient($options); + } + + /** @test */ + public function createClientConnectorServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClientConnectorServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new ClientConnectorService(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClientConnectorServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clientConnectorService = new ClientConnectorService(); + $clientConnectorServiceName = 'clientConnectorServiceName1804966078'; + $clientConnectorService->setName($clientConnectorServiceName); + $clientConnectorServiceIngress = new Ingress(); + $clientConnectorService->setIngress($clientConnectorServiceIngress); + $clientConnectorServiceEgress = new Egress(); + $clientConnectorService->setEgress($clientConnectorServiceEgress); + $request = (new CreateClientConnectorServiceRequest()) + ->setParent($formattedParent) + ->setClientConnectorService($clientConnectorService); + $response = $gapicClient->createClientConnectorService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServicesService/CreateClientConnectorService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClientConnectorService(); + $this->assertProtobufEquals($clientConnectorService, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClientConnectorServiceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createClientConnectorServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClientConnectorServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clientConnectorService = new ClientConnectorService(); + $clientConnectorServiceName = 'clientConnectorServiceName1804966078'; + $clientConnectorService->setName($clientConnectorServiceName); + $clientConnectorServiceIngress = new Ingress(); + $clientConnectorService->setIngress($clientConnectorServiceIngress); + $clientConnectorServiceEgress = new Egress(); + $clientConnectorService->setEgress($clientConnectorServiceEgress); + $request = (new CreateClientConnectorServiceRequest()) + ->setParent($formattedParent) + ->setClientConnectorService($clientConnectorService); + $response = $gapicClient->createClientConnectorService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClientConnectorServiceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteClientConnectorServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteClientConnectorServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteClientConnectorServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clientConnectorServiceName('[PROJECT]', '[LOCATION]', '[CLIENT_CONNECTOR_SERVICE]'); + $request = (new DeleteClientConnectorServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteClientConnectorService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServicesService/DeleteClientConnectorService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClientConnectorServiceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteClientConnectorServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteClientConnectorServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clientConnectorServiceName('[PROJECT]', '[LOCATION]', '[CLIENT_CONNECTOR_SERVICE]'); + $request = (new DeleteClientConnectorServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteClientConnectorService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClientConnectorServiceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getClientConnectorServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new ClientConnectorService(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clientConnectorServiceName('[PROJECT]', '[LOCATION]', '[CLIENT_CONNECTOR_SERVICE]'); + $request = (new GetClientConnectorServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->getClientConnectorService($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServicesService/GetClientConnectorService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClientConnectorServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clientConnectorServiceName('[PROJECT]', '[LOCATION]', '[CLIENT_CONNECTOR_SERVICE]'); + $request = (new GetClientConnectorServiceRequest()) + ->setName($formattedName); + try { + $gapicClient->getClientConnectorService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClientConnectorServicesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $clientConnectorServicesElement = new ClientConnectorService(); + $clientConnectorServices = [ + $clientConnectorServicesElement, + ]; + $expectedResponse = new ListClientConnectorServicesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setClientConnectorServices($clientConnectorServices); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClientConnectorServicesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listClientConnectorServices($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getClientConnectorServices()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServicesService/ListClientConnectorServices', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClientConnectorServicesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClientConnectorServicesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listClientConnectorServices($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateClientConnectorServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateClientConnectorServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new ClientConnectorService(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateClientConnectorServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $clientConnectorService = new ClientConnectorService(); + $clientConnectorServiceName = 'clientConnectorServiceName1804966078'; + $clientConnectorService->setName($clientConnectorServiceName); + $clientConnectorServiceIngress = new Ingress(); + $clientConnectorService->setIngress($clientConnectorServiceIngress); + $clientConnectorServiceEgress = new Egress(); + $clientConnectorService->setEgress($clientConnectorServiceEgress); + $request = (new UpdateClientConnectorServiceRequest()) + ->setUpdateMask($updateMask) + ->setClientConnectorService($clientConnectorService); + $response = $gapicClient->updateClientConnectorService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServicesService/UpdateClientConnectorService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getClientConnectorService(); + $this->assertProtobufEquals($clientConnectorService, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClientConnectorServiceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateClientConnectorServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateClientConnectorServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $clientConnectorService = new ClientConnectorService(); + $clientConnectorServiceName = 'clientConnectorServiceName1804966078'; + $clientConnectorService->setName($clientConnectorServiceName); + $clientConnectorServiceIngress = new Ingress(); + $clientConnectorService->setIngress($clientConnectorServiceIngress); + $clientConnectorServiceEgress = new Egress(); + $clientConnectorService->setEgress($clientConnectorServiceEgress); + $request = (new UpdateClientConnectorServiceRequest()) + ->setUpdateMask($updateMask) + ->setClientConnectorService($clientConnectorService); + $response = $gapicClient->updateClientConnectorService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClientConnectorServiceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createClientConnectorServiceAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClientConnectorServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new ClientConnectorService(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClientConnectorServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clientConnectorService = new ClientConnectorService(); + $clientConnectorServiceName = 'clientConnectorServiceName1804966078'; + $clientConnectorService->setName($clientConnectorServiceName); + $clientConnectorServiceIngress = new Ingress(); + $clientConnectorService->setIngress($clientConnectorServiceIngress); + $clientConnectorServiceEgress = new Egress(); + $clientConnectorService->setEgress($clientConnectorServiceEgress); + $request = (new CreateClientConnectorServiceRequest()) + ->setParent($formattedParent) + ->setClientConnectorService($clientConnectorService); + $response = $gapicClient->createClientConnectorServiceAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServicesService/CreateClientConnectorService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClientConnectorService(); + $this->assertProtobufEquals($clientConnectorService, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClientConnectorServiceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Clientgateways/V1/ClientGatewaysService.php b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Clientgateways/V1/ClientGatewaysService.php new file mode 100644 index 000000000000..64586f6a1acb Binary files /dev/null and b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/GPBMetadata/Google/Cloud/Beyondcorp/Clientgateways/V1/ClientGatewaysService.php differ diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ClientGateway.php b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ClientGateway.php new file mode 100644 index 000000000000..720bc7d33494 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ClientGateway.php @@ -0,0 +1,265 @@ +google.cloud.beyondcorp.clientgateways.v1.ClientGateway + */ +class ClientGateway extends \Google\Protobuf\Internal\Message +{ + /** + * Required. name of resource. The name is ignored during creation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. [Output only] Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. [Output only] Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The operational state of the gateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. A unique identifier for the instance generated by the system. + * + * Generated from protobuf field string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $id = ''; + /** + * Output only. The client connector service name that the client gateway is + * associated to. Client Connector Services, named as follows: + * `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`. + * + * Generated from protobuf field string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $client_connector_service = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. name of resource. The name is ignored during creation. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. [Output only] Create time stamp. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. [Output only] Update time stamp. + * @type int $state + * Output only. The operational state of the gateway. + * @type string $id + * Output only. A unique identifier for the instance generated by the system. + * @type string $client_connector_service + * Output only. The client connector service name that the client gateway is + * associated to. Client Connector Services, named as follows: + * `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientgateways\V1\ClientGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Required. name of resource. The name is ignored during creation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. name of resource. The name is ignored during creation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. [Output only] Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. [Output only] Create time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. [Output only] Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. [Output only] Update time stamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The operational state of the gateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The operational state of the gateway. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. A unique identifier for the instance generated by the system. + * + * Generated from protobuf field string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Output only. A unique identifier for the instance generated by the system. + * + * Generated from protobuf field string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Output only. The client connector service name that the client gateway is + * associated to. Client Connector Services, named as follows: + * `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`. + * + * Generated from protobuf field string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getClientConnectorService() + { + return $this->client_connector_service; + } + + /** + * Output only. The client connector service name that the client gateway is + * associated to. Client Connector Services, named as follows: + * `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`. + * + * Generated from protobuf field string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setClientConnectorService($var) + { + GPBUtil::checkString($var, True); + $this->client_connector_service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ClientGateway/State.php b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ClientGateway/State.php new file mode 100644 index 000000000000..f22273017c96 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ClientGateway/State.php @@ -0,0 +1,93 @@ +google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Gateway is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * Gateway is being updated. + * + * Generated from protobuf enum UPDATING = 2; + */ + const UPDATING = 2; + /** + * Gateway is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * Gateway is running. + * + * Generated from protobuf enum RUNNING = 4; + */ + const RUNNING = 4; + /** + * Gateway is down and may be restored in the future. + * This happens when CCFE sends ProjectState = OFF. + * + * Generated from protobuf enum DOWN = 5; + */ + const DOWN = 5; + /** + * ClientGateway encountered an error and is in indeterministic state. + * + * Generated from protobuf enum ERROR = 6; + */ + const ERROR = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::UPDATING => 'UPDATING', + self::DELETING => 'DELETING', + self::RUNNING => 'RUNNING', + self::DOWN => 'DOWN', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway_State::class); + diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ClientGatewayOperationMetadata.php b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ClientGatewayOperationMetadata.php new file mode 100644 index 000000000000..eebce8959553 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ClientGatewayOperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + */ +class ClientGatewayOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_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`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @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`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientgateways\V1\ClientGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * 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`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->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`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/CreateClientGatewayRequest.php b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/CreateClientGatewayRequest.php new file mode 100644 index 000000000000..09b409646d7a --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/CreateClientGatewayRequest.php @@ -0,0 +1,290 @@ +google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest + */ +class CreateClientGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. User-settable client gateway resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $client_gateway_id = ''; + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $client_gateway = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see ClientGatewaysServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway $clientGateway Required. The resource being created. + * @param string $clientGatewayId Optional. User-settable client gateway resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * @return \Google\Cloud\BeyondCorp\ClientGateways\V1\CreateClientGatewayRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway $clientGateway, string $clientGatewayId): self + { + return (new self()) + ->setParent($parent) + ->setClientGateway($clientGateway) + ->setClientGatewayId($clientGatewayId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $client_gateway_id + * Optional. User-settable client gateway resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * @type \Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway $client_gateway + * Required. The resource being created. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientgateways\V1\ClientGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. User-settable client gateway resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getClientGatewayId() + { + return $this->client_gateway_id; + } + + /** + * Optional. User-settable client gateway resource ID. + * * Must start with a letter. + * * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + * * Must end with a number or a letter. + * + * Generated from protobuf field string client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setClientGatewayId($var) + { + GPBUtil::checkString($var, True); + $this->client_gateway_id = $var; + + return $this; + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway|null + */ + public function getClientGateway() + { + return $this->client_gateway; + } + + public function hasClientGateway() + { + return isset($this->client_gateway); + } + + public function clearClientGateway() + { + unset($this->client_gateway); + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway $var + * @return $this + */ + public function setClientGateway($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway::class); + $this->client_gateway = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/DeleteClientGatewayRequest.php b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/DeleteClientGatewayRequest.php new file mode 100644 index 000000000000..4ebd3346210c --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/DeleteClientGatewayRequest.php @@ -0,0 +1,193 @@ +google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest + */ +class DeleteClientGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. Name of the resource + * Please see {@see ClientGatewaysServiceClient::clientGatewayName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\ClientGateways\V1\DeleteClientGatewayRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientgateways\V1\ClientGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validates request by executing a dry-run which would not + * alter the resource in any way. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/GetClientGatewayRequest.php b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/GetClientGatewayRequest.php new file mode 100644 index 000000000000..34aa28bf8694 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/GetClientGatewayRequest.php @@ -0,0 +1,81 @@ +google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest + */ +class GetClientGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see ClientGatewaysServiceClient::clientGatewayName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\ClientGateways\V1\GetClientGatewayRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientgateways\V1\ClientGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ListClientGatewaysRequest.php b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ListClientGatewaysRequest.php new file mode 100644 index 000000000000..4c7efdb4e0d1 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ListClientGatewaysRequest.php @@ -0,0 +1,221 @@ +google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest + */ +class ListClientGatewaysRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListClientGatewaysRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListClientGatewaysRequest. Please see + * {@see ClientGatewaysServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BeyondCorp\ClientGateways\V1\ListClientGatewaysRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListClientGatewaysRequest. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientgateways\V1\ClientGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListClientGatewaysRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListClientGatewaysRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ListClientGatewaysResponse.php b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ListClientGatewaysResponse.php new file mode 100644 index 000000000000..41559467cdc4 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/proto/src/Google/Cloud/BeyondCorp/ClientGateways/V1/ListClientGatewaysResponse.php @@ -0,0 +1,135 @@ +google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse + */ +class ListClientGatewaysResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of ClientGateway. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + */ + private $client_gateways; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway>|\Google\Protobuf\Internal\RepeatedField $client_gateways + * The list of ClientGateway. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Beyondcorp\Clientgateways\V1\ClientGatewaysService::initOnce(); + parent::__construct($data); + } + + /** + * The list of ClientGateway. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClientGateways() + { + return $this->client_gateways; + } + + /** + * The list of ClientGateway. + * + * Generated from protobuf field repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * @param array<\Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClientGateways($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway::class); + $this->client_gateways = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/create_client_gateway.php b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/create_client_gateway.php new file mode 100644 index 000000000000..97a045e3ce95 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/create_client_gateway.php @@ -0,0 +1,88 @@ +setName($clientGatewayName); + $request = (new CreateClientGatewayRequest()) + ->setParent($formattedParent) + ->setClientGateway($clientGateway); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $clientGatewaysServiceClient->createClientGateway($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ClientGateway $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ClientGatewaysServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $clientGatewayName = '[NAME]'; + + create_client_gateway_sample($formattedParent, $clientGatewayName); +} +// [END beyondcorp_v1_generated_ClientGatewaysService_CreateClientGateway_sync] diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/delete_client_gateway.php b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/delete_client_gateway.php new file mode 100644 index 000000000000..7ff430162461 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/delete_client_gateway.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $clientGatewaysServiceClient->deleteClientGateway($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ClientGatewaysServiceClient::clientGatewayName( + '[PROJECT]', + '[LOCATION]', + '[CLIENT_GATEWAY]' + ); + + delete_client_gateway_sample($formattedName); +} +// [END beyondcorp_v1_generated_ClientGatewaysService_DeleteClientGateway_sync] diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/get_client_gateway.php b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/get_client_gateway.php new file mode 100644 index 000000000000..1e113cbd841f --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/get_client_gateway.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ClientGateway $response */ + $response = $clientGatewaysServiceClient->getClientGateway($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ClientGatewaysServiceClient::clientGatewayName( + '[PROJECT]', + '[LOCATION]', + '[CLIENT_GATEWAY]' + ); + + get_client_gateway_sample($formattedName); +} +// [END beyondcorp_v1_generated_ClientGatewaysService_GetClientGateway_sync] diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/get_iam_policy.php b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..eb57c1d037ba --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $clientGatewaysServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END beyondcorp_v1_generated_ClientGatewaysService_GetIamPolicy_sync] diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/get_location.php b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/get_location.php new file mode 100644 index 000000000000..1596f24d637c --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END beyondcorp_v1_generated_ClientGatewaysService_GetLocation_sync] diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/list_client_gateways.php b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/list_client_gateways.php new file mode 100644 index 000000000000..668f730cde0b --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/list_client_gateways.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $clientGatewaysServiceClient->listClientGateways($request); + + /** @var ClientGateway $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ClientGatewaysServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_client_gateways_sample($formattedParent); +} +// [END beyondcorp_v1_generated_ClientGatewaysService_ListClientGateways_sync] diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/list_locations.php b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/list_locations.php new file mode 100644 index 000000000000..621532f73343 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END beyondcorp_v1_generated_ClientGatewaysService_ListLocations_sync] diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/set_iam_policy.php b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..f9bbc4cb80d6 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $clientGatewaysServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END beyondcorp_v1_generated_ClientGatewaysService_SetIamPolicy_sync] diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/test_iam_permissions.php b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..15cad423794d --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/samples/V1/ClientGatewaysServiceClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $clientGatewaysServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END beyondcorp_v1_generated_ClientGatewaysService_TestIamPermissions_sync] diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/Client/ClientGatewaysServiceClient.php b/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/Client/ClientGatewaysServiceClient.php new file mode 100644 index 000000000000..29106161e7bc --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/Client/ClientGatewaysServiceClient.php @@ -0,0 +1,569 @@ + createClientGatewayAsync(CreateClientGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteClientGatewayAsync(DeleteClientGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface getClientGatewayAsync(GetClientGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface listClientGatewaysAsync(ListClientGatewaysRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class ClientGatewaysServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'beyondcorp.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'beyondcorp.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/client_gateways_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/client_gateways_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/client_gateways_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/client_gateways_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * client_gateway resource. + * + * @param string $project + * @param string $location + * @param string $clientGateway + * + * @return string The formatted client_gateway resource. + */ + public static function clientGatewayName(string $project, string $location, string $clientGateway): string + { + return self::getPathTemplate('clientGateway')->render([ + 'project' => $project, + 'location' => $location, + 'client_gateway' => $clientGateway, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - clientGateway: projects/{project}/locations/{location}/clientGateways/{client_gateway} + * - location: projects/{project}/locations/{location} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'beyondcorp.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new ClientGateway in a given project and location. + * + * The async variant is + * {@see ClientGatewaysServiceClient::createClientGatewayAsync()} . + * + * @example samples/V1/ClientGatewaysServiceClient/create_client_gateway.php + * + * @param CreateClientGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createClientGateway(CreateClientGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateClientGateway', $request, $callOptions)->wait(); + } + + /** + * Deletes a single ClientGateway. + * + * The async variant is + * {@see ClientGatewaysServiceClient::deleteClientGatewayAsync()} . + * + * @example samples/V1/ClientGatewaysServiceClient/delete_client_gateway.php + * + * @param DeleteClientGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteClientGateway(DeleteClientGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteClientGateway', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single ClientGateway. + * + * The async variant is {@see ClientGatewaysServiceClient::getClientGatewayAsync()} + * . + * + * @example samples/V1/ClientGatewaysServiceClient/get_client_gateway.php + * + * @param GetClientGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ClientGateway + * + * @throws ApiException Thrown if the API call fails. + */ + public function getClientGateway(GetClientGatewayRequest $request, array $callOptions = []): ClientGateway + { + return $this->startApiCall('GetClientGateway', $request, $callOptions)->wait(); + } + + /** + * Lists ClientGateways in a given project and location. + * + * The async variant is + * {@see ClientGatewaysServiceClient::listClientGatewaysAsync()} . + * + * @example samples/V1/ClientGatewaysServiceClient/list_client_gateways.php + * + * @param ListClientGatewaysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listClientGateways(ListClientGatewaysRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListClientGateways', $request, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ClientGatewaysServiceClient::getLocationAsync()} . + * + * @example samples/V1/ClientGatewaysServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ClientGatewaysServiceClient::listLocationsAsync()} . + * + * @example samples/V1/ClientGatewaysServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see ClientGatewaysServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/ClientGatewaysServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see ClientGatewaysServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/ClientGatewaysServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is + * {@see ClientGatewaysServiceClient::testIamPermissionsAsync()} . + * + * @example samples/V1/ClientGatewaysServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..cb3b63e30fc4 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/gapic_metadata.json @@ -0,0 +1,63 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.beyondcorp.clientgateways.v1", + "libraryPackage": "Google\\Cloud\\BeyondCorp\\ClientGateways\\V1", + "services": { + "ClientGatewaysService": { + "clients": { + "grpc": { + "libraryClient": "ClientGatewaysServiceGapicClient", + "rpcs": { + "CreateClientGateway": { + "methods": [ + "createClientGateway" + ] + }, + "DeleteClientGateway": { + "methods": [ + "deleteClientGateway" + ] + }, + "GetClientGateway": { + "methods": [ + "getClientGateway" + ] + }, + "ListClientGateways": { + "methods": [ + "listClientGateways" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/resources/client_gateways_service_client_config.json b/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/resources/client_gateways_service_client_config.json new file mode 100644 index 000000000000..582868412a6b --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/resources/client_gateways_service_client_config.json @@ -0,0 +1,67 @@ +{ + "interfaces": { + "google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateClientGateway": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteClientGateway": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetClientGateway": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListClientGateways": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/resources/client_gateways_service_descriptor_config.php b/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/resources/client_gateways_service_descriptor_config.php new file mode 100644 index 000000000000..feae5f92322d --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/resources/client_gateways_service_descriptor_config.php @@ -0,0 +1,175 @@ + [ + 'google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService' => [ + 'CreateClientGateway' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGatewayOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteClientGateway' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGatewayOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetClientGateway' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BeyondCorp\ClientGateways\V1\ClientGateway', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListClientGateways' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getClientGateways', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BeyondCorp\ClientGateways\V1\ListClientGatewaysResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'clientGateway' => 'projects/{project}/locations/{location}/clientGateways/{client_gateway}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/resources/client_gateways_service_rest_client_config.php b/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/resources/client_gateways_service_rest_client_config.php new file mode 100644 index 000000000000..903cf45ad886 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/src/V1/resources/client_gateways_service_rest_client_config.php @@ -0,0 +1,244 @@ + [ + 'google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService' => [ + 'CreateClientGateway' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clientGateways', + 'body' => 'client_gateway', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteClientGateway' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clientGateways/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetClientGateway' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clientGateways/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListClientGateways' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clientGateways', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnections/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appConnectors/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/appGateways/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientConnectorServices/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientGateways/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/BeyondCorpClientGateways/v1/tests/Unit/V1/Client/ClientGatewaysServiceClientTest.php b/owl-bot-staging/BeyondCorpClientGateways/v1/tests/Unit/V1/Client/ClientGatewaysServiceClientTest.php new file mode 100644 index 000000000000..10b4c88e9557 --- /dev/null +++ b/owl-bot-staging/BeyondCorpClientGateways/v1/tests/Unit/V1/Client/ClientGatewaysServiceClientTest.php @@ -0,0 +1,884 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ClientGatewaysServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ClientGatewaysServiceClient($options); + } + + /** @test */ + public function createClientGatewayTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClientGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $id = 'id3355'; + $clientConnectorService = 'clientConnectorService-1152817841'; + $expectedResponse = new ClientGateway(); + $expectedResponse->setName($name); + $expectedResponse->setId($id); + $expectedResponse->setClientConnectorService($clientConnectorService); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClientGatewayTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clientGateway = new ClientGateway(); + $clientGatewayName = 'clientGatewayName-1795593692'; + $clientGateway->setName($clientGatewayName); + $request = (new CreateClientGatewayRequest()) + ->setParent($formattedParent) + ->setClientGateway($clientGateway); + $response = $gapicClient->createClientGateway($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/CreateClientGateway', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClientGateway(); + $this->assertProtobufEquals($clientGateway, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClientGatewayTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createClientGatewayExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClientGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clientGateway = new ClientGateway(); + $clientGatewayName = 'clientGatewayName-1795593692'; + $clientGateway->setName($clientGatewayName); + $request = (new CreateClientGatewayRequest()) + ->setParent($formattedParent) + ->setClientGateway($clientGateway); + $response = $gapicClient->createClientGateway($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClientGatewayTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteClientGatewayTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteClientGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteClientGatewayTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clientGatewayName('[PROJECT]', '[LOCATION]', '[CLIENT_GATEWAY]'); + $request = (new DeleteClientGatewayRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteClientGateway($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/DeleteClientGateway', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClientGatewayTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteClientGatewayExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteClientGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clientGatewayName('[PROJECT]', '[LOCATION]', '[CLIENT_GATEWAY]'); + $request = (new DeleteClientGatewayRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteClientGateway($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClientGatewayTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getClientGatewayTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $id = 'id3355'; + $clientConnectorService = 'clientConnectorService-1152817841'; + $expectedResponse = new ClientGateway(); + $expectedResponse->setName($name2); + $expectedResponse->setId($id); + $expectedResponse->setClientConnectorService($clientConnectorService); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clientGatewayName('[PROJECT]', '[LOCATION]', '[CLIENT_GATEWAY]'); + $request = (new GetClientGatewayRequest()) + ->setName($formattedName); + $response = $gapicClient->getClientGateway($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/GetClientGateway', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClientGatewayExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clientGatewayName('[PROJECT]', '[LOCATION]', '[CLIENT_GATEWAY]'); + $request = (new GetClientGatewayRequest()) + ->setName($formattedName); + try { + $gapicClient->getClientGateway($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClientGatewaysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $clientGatewaysElement = new ClientGateway(); + $clientGateways = [ + $clientGatewaysElement, + ]; + $expectedResponse = new ListClientGatewaysResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setClientGateways($clientGateways); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClientGatewaysRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listClientGateways($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getClientGateways()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/ListClientGateways', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClientGatewaysExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClientGatewaysRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listClientGateways($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createClientGatewayAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClientGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $id = 'id3355'; + $clientConnectorService = 'clientConnectorService-1152817841'; + $expectedResponse = new ClientGateway(); + $expectedResponse->setName($name); + $expectedResponse->setId($id); + $expectedResponse->setClientConnectorService($clientConnectorService); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClientGatewayTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clientGateway = new ClientGateway(); + $clientGatewayName = 'clientGatewayName-1795593692'; + $clientGateway->setName($clientGatewayName); + $request = (new CreateClientGatewayRequest()) + ->setParent($formattedParent) + ->setClientGateway($clientGateway); + $response = $gapicClient->createClientGatewayAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/CreateClientGateway', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClientGateway(); + $this->assertProtobufEquals($clientGateway, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClientGatewayTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Analyticshub/V1/Analyticshub.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Analyticshub/V1/Analyticshub.php new file mode 100644 index 000000000000..91016b17f551 Binary files /dev/null and b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Analyticshub/V1/Analyticshub.php differ diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/CreateDataExchangeRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/CreateDataExchangeRequest.php new file mode 100644 index 000000000000..b5c50a9432c0 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/CreateDataExchangeRequest.php @@ -0,0 +1,182 @@ +google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest + */ +class CreateDataExchangeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ID of the data exchange. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_exchange_id = ''; + /** + * Required. The data exchange to create. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_exchange = null; + + /** + * @param string $parent Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. Please see + * {@see AnalyticsHubServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange $dataExchange Required. The data exchange to create. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\CreateDataExchangeRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange $dataExchange): self + { + return (new self()) + ->setParent($parent) + ->setDataExchange($dataExchange); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. + * @type string $data_exchange_id + * Required. The ID of the data exchange. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange $data_exchange + * Required. The data exchange to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The ID of the data exchange. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataExchangeId() + { + return $this->data_exchange_id; + } + + /** + * Required. The ID of the data exchange. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataExchangeId($var) + { + GPBUtil::checkString($var, True); + $this->data_exchange_id = $var; + + return $this; + } + + /** + * Required. The data exchange to create. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange|null + */ + public function getDataExchange() + { + return $this->data_exchange; + } + + public function hasDataExchange() + { + return isset($this->data_exchange); + } + + public function clearDataExchange() + { + unset($this->data_exchange); + } + + /** + * Required. The data exchange to create. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange $var + * @return $this + */ + public function setDataExchange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange::class); + $this->data_exchange = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/CreateListingRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/CreateListingRequest.php new file mode 100644 index 000000000000..e7fe7aa5bd6c --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/CreateListingRequest.php @@ -0,0 +1,182 @@ +google.cloud.bigquery.analyticshub.v1.CreateListingRequest + */ +class CreateListingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ID of the listing to create. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $listing_id = ''; + /** + * Required. The listing to create. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $listing = null; + + /** + * @param string $parent Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. Please see + * {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing $listing Required. The listing to create. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\CreateListingRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing $listing): self + { + return (new self()) + ->setParent($parent) + ->setListing($listing); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @type string $listing_id + * Required. The ID of the listing to create. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing $listing + * Required. The listing to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The ID of the listing to create. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getListingId() + { + return $this->listing_id; + } + + /** + * Required. The ID of the listing to create. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setListingId($var) + { + GPBUtil::checkString($var, True); + $this->listing_id = $var; + + return $this; + } + + /** + * Required. The listing to create. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing|null + */ + public function getListing() + { + return $this->listing; + } + + public function hasListing() + { + return isset($this->listing); + } + + public function clearListing() + { + unset($this->listing); + } + + /** + * Required. The listing to create. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing $var + * @return $this + */ + public function setListing($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing::class); + $this->listing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DataExchange.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DataExchange.php new file mode 100644 index 000000000000..c8eefaa39b1f --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DataExchange.php @@ -0,0 +1,421 @@ +google.cloud.bigquery.analyticshub.v1.DataExchange + */ +class DataExchange extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. Human-readable display name of the data exchange. The display + * name must contain only Unicode letters, numbers (0-9), underscores (_), + * dashes (-), spaces ( ), ampersands (&) and must not start or end with + * spaces. Default value is an empty string. Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. Description of the data exchange. The description must not + * contain Unicode non-characters as well as C0 and C1 control codes except + * tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Email or URL of the primary point of contact of the data + * exchange. Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $primary_contact = ''; + /** + * Optional. Documentation describing the data exchange. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $documentation = ''; + /** + * Output only. Number of listings contained in the data exchange. + * + * Generated from protobuf field int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $listing_count = 0; + /** + * Optional. Base64 encoded image representing the data exchange. Max + * Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API + * only performs validation on size of the encoded data. Note: For byte + * fields, the content of the fields are base64-encoded (which increases the + * size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $icon = ''; + /** + * Optional. Configurable data sharing environment option for a data exchange. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig sharing_environment_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sharing_environment_config = null; + /** + * Optional. Type of discovery on the discovery page for all the listings + * under this exchange. Updating this field also updates (overwrites) the + * discovery_type field for all the listings under this exchange. + * + * Generated from protobuf field optional .google.cloud.bigquery.analyticshub.v1.DiscoveryType discovery_type = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $discovery_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @type string $display_name + * Required. Human-readable display name of the data exchange. The display + * name must contain only Unicode letters, numbers (0-9), underscores (_), + * dashes (-), spaces ( ), ampersands (&) and must not start or end with + * spaces. Default value is an empty string. Max length: 63 bytes. + * @type string $description + * Optional. Description of the data exchange. The description must not + * contain Unicode non-characters as well as C0 and C1 control codes except + * tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * @type string $primary_contact + * Optional. Email or URL of the primary point of contact of the data + * exchange. Max Length: 1000 bytes. + * @type string $documentation + * Optional. Documentation describing the data exchange. + * @type int $listing_count + * Output only. Number of listings contained in the data exchange. + * @type string $icon + * Optional. Base64 encoded image representing the data exchange. Max + * Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API + * only performs validation on size of the encoded data. Note: For byte + * fields, the content of the fields are base64-encoded (which increases the + * size of the data by 33-36%) when using JSON on the wire. + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig $sharing_environment_config + * Optional. Configurable data sharing environment option for a data exchange. + * @type int $discovery_type + * Optional. Type of discovery on the discovery page for all the listings + * under this exchange. Updating this field also updates (overwrites) the + * discovery_type field for all the listings under this exchange. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Human-readable display name of the data exchange. The display + * name must contain only Unicode letters, numbers (0-9), underscores (_), + * dashes (-), spaces ( ), ampersands (&) and must not start or end with + * spaces. Default value is an empty string. Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. Human-readable display name of the data exchange. The display + * name must contain only Unicode letters, numbers (0-9), underscores (_), + * dashes (-), spaces ( ), ampersands (&) and must not start or end with + * spaces. Default value is an empty string. Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. Description of the data exchange. The description must not + * contain Unicode non-characters as well as C0 and C1 control codes except + * tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of the data exchange. The description must not + * contain Unicode non-characters as well as C0 and C1 control codes except + * tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Email or URL of the primary point of contact of the data + * exchange. Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPrimaryContact() + { + return $this->primary_contact; + } + + /** + * Optional. Email or URL of the primary point of contact of the data + * exchange. Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPrimaryContact($var) + { + GPBUtil::checkString($var, True); + $this->primary_contact = $var; + + return $this; + } + + /** + * Optional. Documentation describing the data exchange. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDocumentation() + { + return $this->documentation; + } + + /** + * Optional. Documentation describing the data exchange. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDocumentation($var) + { + GPBUtil::checkString($var, True); + $this->documentation = $var; + + return $this; + } + + /** + * Output only. Number of listings contained in the data exchange. + * + * Generated from protobuf field int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getListingCount() + { + return $this->listing_count; + } + + /** + * Output only. Number of listings contained in the data exchange. + * + * Generated from protobuf field int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setListingCount($var) + { + GPBUtil::checkInt32($var); + $this->listing_count = $var; + + return $this; + } + + /** + * Optional. Base64 encoded image representing the data exchange. Max + * Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API + * only performs validation on size of the encoded data. Note: For byte + * fields, the content of the fields are base64-encoded (which increases the + * size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getIcon() + { + return $this->icon; + } + + /** + * Optional. Base64 encoded image representing the data exchange. Max + * Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API + * only performs validation on size of the encoded data. Note: For byte + * fields, the content of the fields are base64-encoded (which increases the + * size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setIcon($var) + { + GPBUtil::checkString($var, False); + $this->icon = $var; + + return $this; + } + + /** + * Optional. Configurable data sharing environment option for a data exchange. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig sharing_environment_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig|null + */ + public function getSharingEnvironmentConfig() + { + return $this->sharing_environment_config; + } + + public function hasSharingEnvironmentConfig() + { + return isset($this->sharing_environment_config); + } + + public function clearSharingEnvironmentConfig() + { + unset($this->sharing_environment_config); + } + + /** + * Optional. Configurable data sharing environment option for a data exchange. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig sharing_environment_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig $var + * @return $this + */ + public function setSharingEnvironmentConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig::class); + $this->sharing_environment_config = $var; + + return $this; + } + + /** + * Optional. Type of discovery on the discovery page for all the listings + * under this exchange. Updating this field also updates (overwrites) the + * discovery_type field for all the listings under this exchange. + * + * Generated from protobuf field optional .google.cloud.bigquery.analyticshub.v1.DiscoveryType discovery_type = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDiscoveryType() + { + return isset($this->discovery_type) ? $this->discovery_type : 0; + } + + public function hasDiscoveryType() + { + return isset($this->discovery_type); + } + + public function clearDiscoveryType() + { + unset($this->discovery_type); + } + + /** + * Optional. Type of discovery on the discovery page for all the listings + * under this exchange. Updating this field also updates (overwrites) the + * discovery_type field for all the listings under this exchange. + * + * Generated from protobuf field optional .google.cloud.bigquery.analyticshub.v1.DiscoveryType discovery_type = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDiscoveryType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\DiscoveryType::class); + $this->discovery_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DataProvider.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DataProvider.php new file mode 100644 index 000000000000..ae0efbfc4a0e --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DataProvider.php @@ -0,0 +1,105 @@ +google.cloud.bigquery.analyticshub.v1.DataProvider + */ +class DataProvider extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the data provider. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. Email or URL of the data provider. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $primary_contact = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. Name of the data provider. + * @type string $primary_contact + * Optional. Email or URL of the data provider. + * Max Length: 1000 bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the data provider. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Name of the data provider. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Email or URL of the data provider. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPrimaryContact() + { + return $this->primary_contact; + } + + /** + * Optional. Email or URL of the data provider. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPrimaryContact($var) + { + GPBUtil::checkString($var, True); + $this->primary_contact = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DeleteDataExchangeRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DeleteDataExchangeRequest.php new file mode 100644 index 000000000000..714ba25e08f4 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DeleteDataExchangeRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest + */ +class DeleteDataExchangeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the data exchange resource that you want to + * delete. For example, `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the data exchange resource that you want to + * delete. For example, `projects/myproject/locations/US/dataExchanges/123`. Please see + * {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteDataExchangeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the data exchange resource that you want to + * delete. For example, `projects/myproject/locations/US/dataExchanges/123`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the data exchange resource that you want to + * delete. For example, `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full name of the data exchange resource that you want to + * delete. For example, `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DeleteListingRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DeleteListingRequest.php new file mode 100644 index 000000000000..630e70a33f4e --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DeleteListingRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.analyticshub.v1.DeleteListingRequest + */ +class DeleteListingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. Please see + * {@see AnalyticsHubServiceClient::listingName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteListingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DeleteSubscriptionRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DeleteSubscriptionRequest.php new file mode 100644 index 000000000000..7bfd5a0f13f4 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DeleteSubscriptionRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.analyticshub.v1.DeleteSubscriptionRequest + */ +class DeleteSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the subscription to delete. + * e.g. projects/123/locations/US/subscriptions/456 + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the subscription to delete. + * e.g. projects/123/locations/US/subscriptions/456 + * Please see {@see AnalyticsHubServiceClient::subscriptionName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteSubscriptionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the subscription to delete. + * e.g. projects/123/locations/US/subscriptions/456 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the subscription to delete. + * e.g. projects/123/locations/US/subscriptions/456 + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the subscription to delete. + * e.g. projects/123/locations/US/subscriptions/456 + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DestinationDataset.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DestinationDataset.php new file mode 100644 index 000000000000..05c16ab5c7e9 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DestinationDataset.php @@ -0,0 +1,311 @@ +google.cloud.bigquery.analyticshub.v1.DestinationDataset + */ +class DestinationDataset extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A reference that identifies the destination dataset. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset_reference = null; + /** + * Optional. A descriptive name for the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $friendly_name = null; + /** + * Optional. A user-friendly description of the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = null; + /** + * Optional. The labels associated with this dataset. You can use these + * to organize and group your datasets. + * You can set this property when inserting or updating a dataset. + * See https://cloud.google.com/resource-manager/docs/creating-managing-labels + * for more information. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. The geographic location where the dataset should reside. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * + * Generated from protobuf field string location = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $location = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\DestinationDatasetReference $dataset_reference + * Required. A reference that identifies the destination dataset. + * @type \Google\Protobuf\StringValue $friendly_name + * Optional. A descriptive name for the dataset. + * @type \Google\Protobuf\StringValue $description + * Optional. A user-friendly description of the dataset. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels associated with this dataset. You can use these + * to organize and group your datasets. + * You can set this property when inserting or updating a dataset. + * See https://cloud.google.com/resource-manager/docs/creating-managing-labels + * for more information. + * @type string $location + * Required. The geographic location where the dataset should reside. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. A reference that identifies the destination dataset. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\DestinationDatasetReference|null + */ + public function getDatasetReference() + { + return $this->dataset_reference; + } + + public function hasDatasetReference() + { + return isset($this->dataset_reference); + } + + public function clearDatasetReference() + { + unset($this->dataset_reference); + } + + /** + * Required. A reference that identifies the destination dataset. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\DestinationDatasetReference $var + * @return $this + */ + public function setDatasetReference($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\DestinationDatasetReference::class); + $this->dataset_reference = $var; + + return $this; + } + + /** + * Optional. A descriptive name for the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\StringValue|null + */ + public function getFriendlyName() + { + return $this->friendly_name; + } + + public function hasFriendlyName() + { + return isset($this->friendly_name); + } + + public function clearFriendlyName() + { + unset($this->friendly_name); + } + + /** + * Returns the unboxed value from getFriendlyName() + + * Optional. A descriptive name for the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string|null + */ + public function getFriendlyNameUnwrapped() + { + return $this->readWrapperValue("friendly_name"); + } + + /** + * Optional. A descriptive name for the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\StringValue $var + * @return $this + */ + public function setFriendlyName($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class); + $this->friendly_name = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object. + + * Optional. A descriptive name for the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string|null $var + * @return $this + */ + public function setFriendlyNameUnwrapped($var) + { + $this->writeWrapperValue("friendly_name", $var); + return $this;} + + /** + * Optional. A user-friendly description of the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\StringValue|null + */ + public function getDescription() + { + return $this->description; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Returns the unboxed value from getDescription() + + * Optional. A user-friendly description of the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string|null + */ + public function getDescriptionUnwrapped() + { + return $this->readWrapperValue("description"); + } + + /** + * Optional. A user-friendly description of the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\StringValue $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class); + $this->description = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object. + + * Optional. A user-friendly description of the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string|null $var + * @return $this + */ + public function setDescriptionUnwrapped($var) + { + $this->writeWrapperValue("description", $var); + return $this;} + + /** + * Optional. The labels associated with this dataset. You can use these + * to organize and group your datasets. + * You can set this property when inserting or updating a dataset. + * See https://cloud.google.com/resource-manager/docs/creating-managing-labels + * for more information. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels associated with this dataset. You can use these + * to organize and group your datasets. + * You can set this property when inserting or updating a dataset. + * See https://cloud.google.com/resource-manager/docs/creating-managing-labels + * for more information. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Required. The geographic location where the dataset should reside. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * + * Generated from protobuf field string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Required. The geographic location where the dataset should reside. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * + * Generated from protobuf field string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DestinationDatasetReference.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DestinationDatasetReference.php new file mode 100644 index 000000000000..0158d1b6c937 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DestinationDatasetReference.php @@ -0,0 +1,109 @@ +google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference + */ +class DestinationDatasetReference extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A unique ID for this dataset, without the project name. The ID + * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + * The maximum length is 1,024 characters. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset_id = ''; + /** + * Required. The ID of the project containing this dataset. + * + * Generated from protobuf field string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset_id + * Required. A unique ID for this dataset, without the project name. The ID + * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + * The maximum length is 1,024 characters. + * @type string $project_id + * Required. The ID of the project containing this dataset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. A unique ID for this dataset, without the project name. The ID + * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + * The maximum length is 1,024 characters. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * Required. A unique ID for this dataset, without the project name. The ID + * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + * The maximum length is 1,024 characters. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * Required. The ID of the project containing this dataset. + * + * Generated from protobuf field string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The ID of the project containing this dataset. + * + * Generated from protobuf field string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DiscoveryType.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DiscoveryType.php new file mode 100644 index 000000000000..2726ed751e8a --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/DiscoveryType.php @@ -0,0 +1,65 @@ +google.cloud.bigquery.analyticshub.v1.DiscoveryType + */ +class DiscoveryType +{ + /** + * Unspecified. Defaults to DISCOVERY_TYPE_PRIVATE. + * + * Generated from protobuf enum DISCOVERY_TYPE_UNSPECIFIED = 0; + */ + const DISCOVERY_TYPE_UNSPECIFIED = 0; + /** + * The Data exchange/listing can be discovered in the 'Private' results + * list. + * + * Generated from protobuf enum DISCOVERY_TYPE_PRIVATE = 1; + */ + const DISCOVERY_TYPE_PRIVATE = 1; + /** + * The Data exchange/listing can be discovered in the 'Public' results + * list. + * + * Generated from protobuf enum DISCOVERY_TYPE_PUBLIC = 2; + */ + const DISCOVERY_TYPE_PUBLIC = 2; + + private static $valueToName = [ + self::DISCOVERY_TYPE_UNSPECIFIED => 'DISCOVERY_TYPE_UNSPECIFIED', + self::DISCOVERY_TYPE_PRIVATE => 'DISCOVERY_TYPE_PRIVATE', + self::DISCOVERY_TYPE_PUBLIC => 'DISCOVERY_TYPE_PUBLIC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/GetDataExchangeRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/GetDataExchangeRequest.php new file mode 100644 index 000000000000..ac579385d217 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/GetDataExchangeRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest + */ +class GetDataExchangeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. Please see + * {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\GetDataExchangeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/GetListingRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/GetListingRequest.php new file mode 100644 index 000000000000..a8e2c2523961 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/GetListingRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.analyticshub.v1.GetListingRequest + */ +class GetListingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. Please see + * {@see AnalyticsHubServiceClient::listingName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\GetListingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/GetSubscriptionRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/GetSubscriptionRequest.php new file mode 100644 index 000000000000..8978d37ca8e6 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/GetSubscriptionRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.analyticshub.v1.GetSubscriptionRequest + */ +class GetSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the subscription. + * e.g. projects/123/locations/US/subscriptions/456 + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the subscription. + * e.g. projects/123/locations/US/subscriptions/456 + * Please see {@see AnalyticsHubServiceClient::subscriptionName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\GetSubscriptionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the subscription. + * e.g. projects/123/locations/US/subscriptions/456 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the subscription. + * e.g. projects/123/locations/US/subscriptions/456 + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the subscription. + * e.g. projects/123/locations/US/subscriptions/456 + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListDataExchangesRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListDataExchangesRequest.php new file mode 100644 index 000000000000..fe9ae5f2f822 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListDataExchangesRequest.php @@ -0,0 +1,162 @@ +google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest + */ +class ListDataExchangesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. Please see + * {@see AnalyticsHubServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\ListDataExchangesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * @type int $page_size + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @type string $page_token + * Page token, returned by a previous call, to request the next page of + * results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListDataExchangesResponse.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListDataExchangesResponse.php new file mode 100644 index 000000000000..fb8bbdccd266 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListDataExchangesResponse.php @@ -0,0 +1,101 @@ +google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse + */ +class ListDataExchangesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + private $data_exchanges; + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange>|\Google\Protobuf\Internal\RepeatedField $data_exchanges + * The list of data exchanges. + * @type string $next_page_token + * A token to request the next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataExchanges() + { + return $this->data_exchanges; + } + + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + * @param array<\Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataExchanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange::class); + $this->data_exchanges = $arr; + + return $this; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListListingsRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListListingsRequest.php new file mode 100644 index 000000000000..acff05320794 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListListingsRequest.php @@ -0,0 +1,162 @@ +google.cloud.bigquery.analyticshub.v1.ListListingsRequest + */ +class ListListingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. Please see + * {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\ListListingsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @type int $page_size + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @type string $page_token + * Page token, returned by a previous call, to request the next page of + * results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListListingsResponse.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListListingsResponse.php new file mode 100644 index 000000000000..2a35739b95ea --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListListingsResponse.php @@ -0,0 +1,101 @@ +google.cloud.bigquery.analyticshub.v1.ListListingsResponse + */ +class ListListingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Listing. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + private $listings; + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\AnalyticsHub\V1\Listing>|\Google\Protobuf\Internal\RepeatedField $listings + * The list of Listing. + * @type string $next_page_token + * A token to request the next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * The list of Listing. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getListings() + { + return $this->listings; + } + + /** + * The list of Listing. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + * @param array<\Google\Cloud\BigQuery\AnalyticsHub\V1\Listing>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setListings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing::class); + $this->listings = $arr; + + return $this; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListOrgDataExchangesRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListOrgDataExchangesRequest.php new file mode 100644 index 000000000000..71eca67a2bd9 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListOrgDataExchangesRequest.php @@ -0,0 +1,162 @@ +google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest + */ +class ListOrgDataExchangesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The organization resource path of the projects containing + * DataExchanges. e.g. `organizations/myorg/locations/US`. + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $organization = ''; + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $organization Required. The organization resource path of the projects containing + * DataExchanges. e.g. `organizations/myorg/locations/US`. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\ListOrgDataExchangesRequest + * + * @experimental + */ + public static function build(string $organization): self + { + return (new self()) + ->setOrganization($organization); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $organization + * Required. The organization resource path of the projects containing + * DataExchanges. e.g. `organizations/myorg/locations/US`. + * @type int $page_size + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @type string $page_token + * Page token, returned by a previous call, to request the next page of + * results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The organization resource path of the projects containing + * DataExchanges. e.g. `organizations/myorg/locations/US`. + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * Required. The organization resource path of the projects containing + * DataExchanges. e.g. `organizations/myorg/locations/US`. + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListOrgDataExchangesResponse.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListOrgDataExchangesResponse.php new file mode 100644 index 000000000000..d33782786693 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListOrgDataExchangesResponse.php @@ -0,0 +1,102 @@ +google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse + */ +class ListOrgDataExchangesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + private $data_exchanges; + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange>|\Google\Protobuf\Internal\RepeatedField $data_exchanges + * The list of data exchanges. + * @type string $next_page_token + * A token to request the next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataExchanges() + { + return $this->data_exchanges; + } + + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + * @param array<\Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataExchanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange::class); + $this->data_exchanges = $arr; + + return $this; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSharedResourceSubscriptionsRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSharedResourceSubscriptionsRequest.php new file mode 100644 index 000000000000..7868a7a49226 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSharedResourceSubscriptionsRequest.php @@ -0,0 +1,201 @@ +google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsRequest + */ +class ListSharedResourceSubscriptionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the requested target. This resource may be + * either a Listing or a DataExchange. e.g. + * projects/123/locations/US/dataExchanges/456 OR e.g. + * projects/123/locations/US/dataExchanges/456/listings/789 + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $resource = ''; + /** + * If selected, includes deleted subscriptions in the response + * (up to 63 days after deletion). + * + * Generated from protobuf field bool include_deleted_subscriptions = 2; + */ + protected $include_deleted_subscriptions = false; + /** + * The maximum number of results to return in a single response page. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * Page token, returned by a previous call. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $resource Required. Resource name of the requested target. This resource may be + * either a Listing or a DataExchange. e.g. + * projects/123/locations/US/dataExchanges/456 OR e.g. + * projects/123/locations/US/dataExchanges/456/listings/789 + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\ListSharedResourceSubscriptionsRequest + * + * @experimental + */ + public static function build(string $resource): self + { + return (new self()) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * Required. Resource name of the requested target. This resource may be + * either a Listing or a DataExchange. e.g. + * projects/123/locations/US/dataExchanges/456 OR e.g. + * projects/123/locations/US/dataExchanges/456/listings/789 + * @type bool $include_deleted_subscriptions + * If selected, includes deleted subscriptions in the response + * (up to 63 days after deletion). + * @type int $page_size + * The maximum number of results to return in a single response page. + * @type string $page_token + * Page token, returned by a previous call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the requested target. This resource may be + * either a Listing or a DataExchange. e.g. + * projects/123/locations/US/dataExchanges/456 OR e.g. + * projects/123/locations/US/dataExchanges/456/listings/789 + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Required. Resource name of the requested target. This resource may be + * either a Listing or a DataExchange. e.g. + * projects/123/locations/US/dataExchanges/456 OR e.g. + * projects/123/locations/US/dataExchanges/456/listings/789 + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * If selected, includes deleted subscriptions in the response + * (up to 63 days after deletion). + * + * Generated from protobuf field bool include_deleted_subscriptions = 2; + * @return bool + */ + public function getIncludeDeletedSubscriptions() + { + return $this->include_deleted_subscriptions; + } + + /** + * If selected, includes deleted subscriptions in the response + * (up to 63 days after deletion). + * + * Generated from protobuf field bool include_deleted_subscriptions = 2; + * @param bool $var + * @return $this + */ + public function setIncludeDeletedSubscriptions($var) + { + GPBUtil::checkBool($var); + $this->include_deleted_subscriptions = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response page. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response page. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token, returned by a previous call. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token, returned by a previous call. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSharedResourceSubscriptionsResponse.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSharedResourceSubscriptionsResponse.php new file mode 100644 index 000000000000..6dd58edfff9a --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSharedResourceSubscriptionsResponse.php @@ -0,0 +1,101 @@ +google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsResponse + */ +class ListSharedResourceSubscriptionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of subscriptions. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Subscription shared_resource_subscriptions = 1; + */ + private $shared_resource_subscriptions; + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription>|\Google\Protobuf\Internal\RepeatedField $shared_resource_subscriptions + * The list of subscriptions. + * @type string $next_page_token + * Next page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * The list of subscriptions. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Subscription shared_resource_subscriptions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSharedResourceSubscriptions() + { + return $this->shared_resource_subscriptions; + } + + /** + * The list of subscriptions. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Subscription shared_resource_subscriptions = 1; + * @param array<\Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSharedResourceSubscriptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription::class); + $this->shared_resource_subscriptions = $arr; + + return $this; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSubscriptionsRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSubscriptionsRequest.php new file mode 100644 index 000000000000..eb2bf9d45198 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSubscriptionsRequest.php @@ -0,0 +1,228 @@ +google.cloud.bigquery.analyticshub.v1.ListSubscriptionsRequest + */ +class ListSubscriptionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource path of the subscription. + * e.g. projects/myproject/locations/US + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * An expression for filtering the results of the request. Eligible + * fields for filtering are: + * * `listing` + * * `data_exchange` + * Alternatively, a literal wrapped in double quotes may be provided. + * This will be checked for an exact match against both fields above. + * In all cases, the full Data Exchange or Listing resource name must + * be provided. Some example of using filters: + * * data_exchange="projects/myproject/locations/us/dataExchanges/123" + * * listing="projects/123/locations/us/dataExchanges/456/listings/789" + * * "projects/myproject/locations/us/dataExchanges/123" + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * The maximum number of results to return in a single response page. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * Page token, returned by a previous call. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent resource path of the subscription. + * e.g. projects/myproject/locations/US + * Please see {@see AnalyticsHubServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\ListSubscriptionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource path of the subscription. + * e.g. projects/myproject/locations/US + * @type string $filter + * An expression for filtering the results of the request. Eligible + * fields for filtering are: + * * `listing` + * * `data_exchange` + * Alternatively, a literal wrapped in double quotes may be provided. + * This will be checked for an exact match against both fields above. + * In all cases, the full Data Exchange or Listing resource name must + * be provided. Some example of using filters: + * * data_exchange="projects/myproject/locations/us/dataExchanges/123" + * * listing="projects/123/locations/us/dataExchanges/456/listings/789" + * * "projects/myproject/locations/us/dataExchanges/123" + * @type int $page_size + * The maximum number of results to return in a single response page. + * @type string $page_token + * Page token, returned by a previous call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource path of the subscription. + * e.g. projects/myproject/locations/US + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource path of the subscription. + * e.g. projects/myproject/locations/US + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * An expression for filtering the results of the request. Eligible + * fields for filtering are: + * * `listing` + * * `data_exchange` + * Alternatively, a literal wrapped in double quotes may be provided. + * This will be checked for an exact match against both fields above. + * In all cases, the full Data Exchange or Listing resource name must + * be provided. Some example of using filters: + * * data_exchange="projects/myproject/locations/us/dataExchanges/123" + * * listing="projects/123/locations/us/dataExchanges/456/listings/789" + * * "projects/myproject/locations/us/dataExchanges/123" + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * An expression for filtering the results of the request. Eligible + * fields for filtering are: + * * `listing` + * * `data_exchange` + * Alternatively, a literal wrapped in double quotes may be provided. + * This will be checked for an exact match against both fields above. + * In all cases, the full Data Exchange or Listing resource name must + * be provided. Some example of using filters: + * * data_exchange="projects/myproject/locations/us/dataExchanges/123" + * * listing="projects/123/locations/us/dataExchanges/456/listings/789" + * * "projects/myproject/locations/us/dataExchanges/123" + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response page. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response page. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token, returned by a previous call. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token, returned by a previous call. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSubscriptionsResponse.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSubscriptionsResponse.php new file mode 100644 index 000000000000..6e5f3062d8a2 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/ListSubscriptionsResponse.php @@ -0,0 +1,101 @@ +google.cloud.bigquery.analyticshub.v1.ListSubscriptionsResponse + */ +class ListSubscriptionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of subscriptions. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Subscription subscriptions = 1; + */ + private $subscriptions; + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription>|\Google\Protobuf\Internal\RepeatedField $subscriptions + * The list of subscriptions. + * @type string $next_page_token + * Next page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * The list of subscriptions. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Subscription subscriptions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubscriptions() + { + return $this->subscriptions; + } + + /** + * The list of subscriptions. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Subscription subscriptions = 1; + * @param array<\Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubscriptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription::class); + $this->subscriptions = $arr; + + return $this; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing.php new file mode 100644 index 000000000000..6119711f11d3 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing.php @@ -0,0 +1,624 @@ +google.cloud.bigquery.analyticshub.v1.Listing + */ +class Listing extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. Human-readable display name of the listing. The display name must + * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), + * spaces ( ), ampersands (&) and can't start or end with spaces. Default + * value is an empty string. Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. Short description of the listing. The description must not + * contain Unicode non-characters and C0 and C1 control codes except tabs + * (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default + * value is an empty string. Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Email or URL of the primary point of contact of the listing. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $primary_contact = ''; + /** + * Optional. Documentation describing the listing. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $documentation = ''; + /** + * Output only. Current state of the listing. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the contents of the field are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $icon = ''; + /** + * Optional. Details of the data provider who owns the source data. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $data_provider = null; + /** + * Optional. Categories of the listing. Up to two categories are allowed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $categories; + /** + * Optional. Details of the publisher who owns the listing and who can share + * the source data. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $publisher = null; + /** + * Optional. Email or URL of the request access of the listing. + * Subscribers can use this reference to request access. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_access = ''; + /** + * Optional. If set, restricted export configuration will be propagated and + * enforced on the linked dataset. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.RestrictedExportConfig restricted_export_config = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $restricted_export_config = null; + /** + * Optional. Type of discovery of the listing on the discovery page. + * + * Generated from protobuf field optional .google.cloud.bigquery.analyticshub.v1.DiscoveryType discovery_type = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $discovery_type = null; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource $bigquery_dataset + * Required. Shared dataset i.e. BigQuery dataset source. + * @type string $name + * Output only. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456` + * @type string $display_name + * Required. Human-readable display name of the listing. The display name must + * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), + * spaces ( ), ampersands (&) and can't start or end with spaces. Default + * value is an empty string. Max length: 63 bytes. + * @type string $description + * Optional. Short description of the listing. The description must not + * contain Unicode non-characters and C0 and C1 control codes except tabs + * (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default + * value is an empty string. Max length: 2000 bytes. + * @type string $primary_contact + * Optional. Email or URL of the primary point of contact of the listing. + * Max Length: 1000 bytes. + * @type string $documentation + * Optional. Documentation describing the listing. + * @type int $state + * Output only. Current state of the listing. + * @type string $icon + * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the contents of the field are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\DataProvider $data_provider + * Optional. Details of the data provider who owns the source data. + * @type array|\Google\Protobuf\Internal\RepeatedField $categories + * Optional. Categories of the listing. Up to two categories are allowed. + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Publisher $publisher + * Optional. Details of the publisher who owns the listing and who can share + * the source data. + * @type string $request_access + * Optional. Email or URL of the request access of the listing. + * Subscribers can use this reference to request access. + * Max Length: 1000 bytes. + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\RestrictedExportConfig $restricted_export_config + * Optional. If set, restricted export configuration will be propagated and + * enforced on the linked dataset. + * @type int $discovery_type + * Optional. Type of discovery of the listing on the discovery page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Shared dataset i.e. BigQuery dataset source. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource|null + */ + public function getBigqueryDataset() + { + return $this->readOneof(6); + } + + public function hasBigqueryDataset() + { + return $this->hasOneof(6); + } + + /** + * Required. Shared dataset i.e. BigQuery dataset source. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource $var + * @return $this + */ + public function setBigqueryDataset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Human-readable display name of the listing. The display name must + * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), + * spaces ( ), ampersands (&) and can't start or end with spaces. Default + * value is an empty string. Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. Human-readable display name of the listing. The display name must + * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), + * spaces ( ), ampersands (&) and can't start or end with spaces. Default + * value is an empty string. Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. Short description of the listing. The description must not + * contain Unicode non-characters and C0 and C1 control codes except tabs + * (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default + * value is an empty string. Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Short description of the listing. The description must not + * contain Unicode non-characters and C0 and C1 control codes except tabs + * (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default + * value is an empty string. Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Email or URL of the primary point of contact of the listing. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPrimaryContact() + { + return $this->primary_contact; + } + + /** + * Optional. Email or URL of the primary point of contact of the listing. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPrimaryContact($var) + { + GPBUtil::checkString($var, True); + $this->primary_contact = $var; + + return $this; + } + + /** + * Optional. Documentation describing the listing. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDocumentation() + { + return $this->documentation; + } + + /** + * Optional. Documentation describing the listing. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDocumentation($var) + { + GPBUtil::checkString($var, True); + $this->documentation = $var; + + return $this; + } + + /** + * Output only. Current state of the listing. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state of the listing. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the contents of the field are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getIcon() + { + return $this->icon; + } + + /** + * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the contents of the field are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setIcon($var) + { + GPBUtil::checkString($var, False); + $this->icon = $var; + + return $this; + } + + /** + * Optional. Details of the data provider who owns the source data. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\DataProvider|null + */ + public function getDataProvider() + { + return $this->data_provider; + } + + public function hasDataProvider() + { + return isset($this->data_provider); + } + + public function clearDataProvider() + { + unset($this->data_provider); + } + + /** + * Optional. Details of the data provider who owns the source data. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\DataProvider $var + * @return $this + */ + public function setDataProvider($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\DataProvider::class); + $this->data_provider = $var; + + return $this; + } + + /** + * Optional. Categories of the listing. Up to two categories are allowed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCategories() + { + return $this->categories; + } + + /** + * Optional. Categories of the listing. Up to two categories are allowed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCategories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\Category::class); + $this->categories = $arr; + + return $this; + } + + /** + * Optional. Details of the publisher who owns the listing and who can share + * the source data. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\Publisher|null + */ + public function getPublisher() + { + return $this->publisher; + } + + public function hasPublisher() + { + return isset($this->publisher); + } + + public function clearPublisher() + { + unset($this->publisher); + } + + /** + * Optional. Details of the publisher who owns the listing and who can share + * the source data. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Publisher $var + * @return $this + */ + public function setPublisher($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Publisher::class); + $this->publisher = $var; + + return $this; + } + + /** + * Optional. Email or URL of the request access of the listing. + * Subscribers can use this reference to request access. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestAccess() + { + return $this->request_access; + } + + /** + * Optional. Email or URL of the request access of the listing. + * Subscribers can use this reference to request access. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestAccess($var) + { + GPBUtil::checkString($var, True); + $this->request_access = $var; + + return $this; + } + + /** + * Optional. If set, restricted export configuration will be propagated and + * enforced on the linked dataset. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.RestrictedExportConfig restricted_export_config = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\RestrictedExportConfig|null + */ + public function getRestrictedExportConfig() + { + return $this->restricted_export_config; + } + + public function hasRestrictedExportConfig() + { + return isset($this->restricted_export_config); + } + + public function clearRestrictedExportConfig() + { + unset($this->restricted_export_config); + } + + /** + * Optional. If set, restricted export configuration will be propagated and + * enforced on the linked dataset. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.RestrictedExportConfig restricted_export_config = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\RestrictedExportConfig $var + * @return $this + */ + public function setRestrictedExportConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\RestrictedExportConfig::class); + $this->restricted_export_config = $var; + + return $this; + } + + /** + * Optional. Type of discovery of the listing on the discovery page. + * + * Generated from protobuf field optional .google.cloud.bigquery.analyticshub.v1.DiscoveryType discovery_type = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDiscoveryType() + { + return isset($this->discovery_type) ? $this->discovery_type : 0; + } + + public function hasDiscoveryType() + { + return isset($this->discovery_type); + } + + public function clearDiscoveryType() + { + unset($this->discovery_type); + } + + /** + * Optional. Type of discovery of the listing on the discovery page. + * + * Generated from protobuf field optional .google.cloud.bigquery.analyticshub.v1.DiscoveryType discovery_type = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDiscoveryType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\DiscoveryType::class); + $this->discovery_type = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/BigQueryDatasetSource.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/BigQueryDatasetSource.php new file mode 100644 index 000000000000..22bcb6dd0ed8 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/BigQueryDatasetSource.php @@ -0,0 +1,170 @@ +google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + */ +class BigQueryDatasetSource extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name of the dataset source for this listing. + * e.g. `projects/myproject/datasets/123` + * + * Generated from protobuf field string dataset = 1 [(.google.api.resource_reference) = { + */ + protected $dataset = ''; + /** + * Optional. Resources in this dataset that are selectively shared. + * If this field is empty, then the entire dataset (all resources) are + * shared. This field is only valid for data clean room exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.SelectedResource selected_resources = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $selected_resources; + /** + * Optional. If set, restricted export policy will be propagated and + * enforced on the linked dataset. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.RestrictedExportPolicy restricted_export_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $restricted_export_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset + * Resource name of the dataset source for this listing. + * e.g. `projects/myproject/datasets/123` + * @type array<\Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\SelectedResource>|\Google\Protobuf\Internal\RepeatedField $selected_resources + * Optional. Resources in this dataset that are selectively shared. + * If this field is empty, then the entire dataset (all resources) are + * shared. This field is only valid for data clean room exchanges. + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\RestrictedExportPolicy $restricted_export_policy + * Optional. If set, restricted export policy will be propagated and + * enforced on the linked dataset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Resource name of the dataset source for this listing. + * e.g. `projects/myproject/datasets/123` + * + * Generated from protobuf field string dataset = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getDataset() + { + return $this->dataset; + } + + /** + * Resource name of the dataset source for this listing. + * e.g. `projects/myproject/datasets/123` + * + * Generated from protobuf field string dataset = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkString($var, True); + $this->dataset = $var; + + return $this; + } + + /** + * Optional. Resources in this dataset that are selectively shared. + * If this field is empty, then the entire dataset (all resources) are + * shared. This field is only valid for data clean room exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.SelectedResource selected_resources = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSelectedResources() + { + return $this->selected_resources; + } + + /** + * Optional. Resources in this dataset that are selectively shared. + * If this field is empty, then the entire dataset (all resources) are + * shared. This field is only valid for data clean room exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.SelectedResource selected_resources = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\SelectedResource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSelectedResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\SelectedResource::class); + $this->selected_resources = $arr; + + return $this; + } + + /** + * Optional. If set, restricted export policy will be propagated and + * enforced on the linked dataset. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.RestrictedExportPolicy restricted_export_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\RestrictedExportPolicy|null + */ + public function getRestrictedExportPolicy() + { + return $this->restricted_export_policy; + } + + public function hasRestrictedExportPolicy() + { + return isset($this->restricted_export_policy); + } + + public function clearRestrictedExportPolicy() + { + unset($this->restricted_export_policy); + } + + /** + * Optional. If set, restricted export policy will be propagated and + * enforced on the linked dataset. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.RestrictedExportPolicy restricted_export_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\RestrictedExportPolicy $var + * @return $this + */ + public function setRestrictedExportPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\RestrictedExportPolicy::class); + $this->restricted_export_policy = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BigQueryDatasetSource::class, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing_BigQueryDatasetSource::class); + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/BigQueryDatasetSource/RestrictedExportPolicy.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/BigQueryDatasetSource/RestrictedExportPolicy.php new file mode 100644 index 000000000000..b3b09c13eff2 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/BigQueryDatasetSource/RestrictedExportPolicy.php @@ -0,0 +1,262 @@ +google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.RestrictedExportPolicy + */ +class RestrictedExportPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If true, enable restricted export. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enabled = null; + /** + * Optional. If true, restrict direct table access (read + * api/tabledata.list) on linked table. + * + * Generated from protobuf field .google.protobuf.BoolValue restrict_direct_table_access = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $restrict_direct_table_access = null; + /** + * Optional. If true, restrict export of query result derived from + * restricted linked dataset table. + * + * Generated from protobuf field .google.protobuf.BoolValue restrict_query_result = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $restrict_query_result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\BoolValue $enabled + * Optional. If true, enable restricted export. + * @type \Google\Protobuf\BoolValue $restrict_direct_table_access + * Optional. If true, restrict direct table access (read + * api/tabledata.list) on linked table. + * @type \Google\Protobuf\BoolValue $restrict_query_result + * Optional. If true, restrict export of query result derived from + * restricted linked dataset table. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If true, enable restricted export. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getEnabled() + { + return $this->enabled; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Returns the unboxed value from getEnabled() + + * Optional. If true, enable restricted export. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool|null + */ + public function getEnabledUnwrapped() + { + return $this->readWrapperValue("enabled"); + } + + /** + * Optional. If true, enable restricted export. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->enabled = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Optional. If true, enable restricted export. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool|null $var + * @return $this + */ + public function setEnabledUnwrapped($var) + { + $this->writeWrapperValue("enabled", $var); + return $this;} + + /** + * Optional. If true, restrict direct table access (read + * api/tabledata.list) on linked table. + * + * Generated from protobuf field .google.protobuf.BoolValue restrict_direct_table_access = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getRestrictDirectTableAccess() + { + return $this->restrict_direct_table_access; + } + + public function hasRestrictDirectTableAccess() + { + return isset($this->restrict_direct_table_access); + } + + public function clearRestrictDirectTableAccess() + { + unset($this->restrict_direct_table_access); + } + + /** + * Returns the unboxed value from getRestrictDirectTableAccess() + + * Optional. If true, restrict direct table access (read + * api/tabledata.list) on linked table. + * + * Generated from protobuf field .google.protobuf.BoolValue restrict_direct_table_access = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool|null + */ + public function getRestrictDirectTableAccessUnwrapped() + { + return $this->readWrapperValue("restrict_direct_table_access"); + } + + /** + * Optional. If true, restrict direct table access (read + * api/tabledata.list) on linked table. + * + * Generated from protobuf field .google.protobuf.BoolValue restrict_direct_table_access = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setRestrictDirectTableAccess($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->restrict_direct_table_access = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Optional. If true, restrict direct table access (read + * api/tabledata.list) on linked table. + * + * Generated from protobuf field .google.protobuf.BoolValue restrict_direct_table_access = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool|null $var + * @return $this + */ + public function setRestrictDirectTableAccessUnwrapped($var) + { + $this->writeWrapperValue("restrict_direct_table_access", $var); + return $this;} + + /** + * Optional. If true, restrict export of query result derived from + * restricted linked dataset table. + * + * Generated from protobuf field .google.protobuf.BoolValue restrict_query_result = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getRestrictQueryResult() + { + return $this->restrict_query_result; + } + + public function hasRestrictQueryResult() + { + return isset($this->restrict_query_result); + } + + public function clearRestrictQueryResult() + { + unset($this->restrict_query_result); + } + + /** + * Returns the unboxed value from getRestrictQueryResult() + + * Optional. If true, restrict export of query result derived from + * restricted linked dataset table. + * + * Generated from protobuf field .google.protobuf.BoolValue restrict_query_result = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool|null + */ + public function getRestrictQueryResultUnwrapped() + { + return $this->readWrapperValue("restrict_query_result"); + } + + /** + * Optional. If true, restrict export of query result derived from + * restricted linked dataset table. + * + * Generated from protobuf field .google.protobuf.BoolValue restrict_query_result = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setRestrictQueryResult($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->restrict_query_result = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Optional. If true, restrict export of query result derived from + * restricted linked dataset table. + * + * Generated from protobuf field .google.protobuf.BoolValue restrict_query_result = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool|null $var + * @return $this + */ + public function setRestrictQueryResultUnwrapped($var) + { + $this->writeWrapperValue("restrict_query_result", $var); + return $this;} + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RestrictedExportPolicy::class, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing_BigQueryDatasetSource_RestrictedExportPolicy::class); + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/BigQueryDatasetSource/SelectedResource.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/BigQueryDatasetSource/SelectedResource.php new file mode 100644 index 000000000000..babf97164a3b --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/BigQueryDatasetSource/SelectedResource.php @@ -0,0 +1,87 @@ +google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.SelectedResource + */ +class SelectedResource extends \Google\Protobuf\Internal\Message +{ + protected $resource; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table + * Optional. Format: + * For table: + * `projects/{projectId}/datasets/{datasetId}/tables/{tableId}` + * Example:"projects/test_project/datasets/test_dataset/tables/test_table" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Format: + * For table: + * `projects/{projectId}/datasets/{datasetId}/tables/{tableId}` + * Example:"projects/test_project/datasets/test_dataset/tables/test_table" + * + * Generated from protobuf field string table = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getTable() + { + return $this->readOneof(1); + } + + public function hasTable() + { + return $this->hasOneof(1); + } + + /** + * Optional. Format: + * For table: + * `projects/{projectId}/datasets/{datasetId}/tables/{tableId}` + * Example:"projects/test_project/datasets/test_dataset/tables/test_table" + * + * Generated from protobuf field string table = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTable($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getResource() + { + return $this->whichOneof("resource"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SelectedResource::class, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing_BigQueryDatasetSource_SelectedResource::class); + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/Category.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/Category.php new file mode 100644 index 000000000000..c16d7e7d770d --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/Category.php @@ -0,0 +1,143 @@ +google.cloud.bigquery.analyticshub.v1.Listing.Category + */ +class Category +{ + /** + * Generated from protobuf enum CATEGORY_UNSPECIFIED = 0; + */ + const CATEGORY_UNSPECIFIED = 0; + /** + * Generated from protobuf enum CATEGORY_OTHERS = 1; + */ + const CATEGORY_OTHERS = 1; + /** + * Generated from protobuf enum CATEGORY_ADVERTISING_AND_MARKETING = 2; + */ + const CATEGORY_ADVERTISING_AND_MARKETING = 2; + /** + * Generated from protobuf enum CATEGORY_COMMERCE = 3; + */ + const CATEGORY_COMMERCE = 3; + /** + * Generated from protobuf enum CATEGORY_CLIMATE_AND_ENVIRONMENT = 4; + */ + const CATEGORY_CLIMATE_AND_ENVIRONMENT = 4; + /** + * Generated from protobuf enum CATEGORY_DEMOGRAPHICS = 5; + */ + const CATEGORY_DEMOGRAPHICS = 5; + /** + * Generated from protobuf enum CATEGORY_ECONOMICS = 6; + */ + const CATEGORY_ECONOMICS = 6; + /** + * Generated from protobuf enum CATEGORY_EDUCATION = 7; + */ + const CATEGORY_EDUCATION = 7; + /** + * Generated from protobuf enum CATEGORY_ENERGY = 8; + */ + const CATEGORY_ENERGY = 8; + /** + * Generated from protobuf enum CATEGORY_FINANCIAL = 9; + */ + const CATEGORY_FINANCIAL = 9; + /** + * Generated from protobuf enum CATEGORY_GAMING = 10; + */ + const CATEGORY_GAMING = 10; + /** + * Generated from protobuf enum CATEGORY_GEOSPATIAL = 11; + */ + const CATEGORY_GEOSPATIAL = 11; + /** + * Generated from protobuf enum CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE = 12; + */ + const CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE = 12; + /** + * Generated from protobuf enum CATEGORY_MEDIA = 13; + */ + const CATEGORY_MEDIA = 13; + /** + * Generated from protobuf enum CATEGORY_PUBLIC_SECTOR = 14; + */ + const CATEGORY_PUBLIC_SECTOR = 14; + /** + * Generated from protobuf enum CATEGORY_RETAIL = 15; + */ + const CATEGORY_RETAIL = 15; + /** + * Generated from protobuf enum CATEGORY_SPORTS = 16; + */ + const CATEGORY_SPORTS = 16; + /** + * Generated from protobuf enum CATEGORY_SCIENCE_AND_RESEARCH = 17; + */ + const CATEGORY_SCIENCE_AND_RESEARCH = 17; + /** + * Generated from protobuf enum CATEGORY_TRANSPORTATION_AND_LOGISTICS = 18; + */ + const CATEGORY_TRANSPORTATION_AND_LOGISTICS = 18; + /** + * Generated from protobuf enum CATEGORY_TRAVEL_AND_TOURISM = 19; + */ + const CATEGORY_TRAVEL_AND_TOURISM = 19; + + private static $valueToName = [ + self::CATEGORY_UNSPECIFIED => 'CATEGORY_UNSPECIFIED', + self::CATEGORY_OTHERS => 'CATEGORY_OTHERS', + self::CATEGORY_ADVERTISING_AND_MARKETING => 'CATEGORY_ADVERTISING_AND_MARKETING', + self::CATEGORY_COMMERCE => 'CATEGORY_COMMERCE', + self::CATEGORY_CLIMATE_AND_ENVIRONMENT => 'CATEGORY_CLIMATE_AND_ENVIRONMENT', + self::CATEGORY_DEMOGRAPHICS => 'CATEGORY_DEMOGRAPHICS', + self::CATEGORY_ECONOMICS => 'CATEGORY_ECONOMICS', + self::CATEGORY_EDUCATION => 'CATEGORY_EDUCATION', + self::CATEGORY_ENERGY => 'CATEGORY_ENERGY', + self::CATEGORY_FINANCIAL => 'CATEGORY_FINANCIAL', + self::CATEGORY_GAMING => 'CATEGORY_GAMING', + self::CATEGORY_GEOSPATIAL => 'CATEGORY_GEOSPATIAL', + self::CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE => 'CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE', + self::CATEGORY_MEDIA => 'CATEGORY_MEDIA', + self::CATEGORY_PUBLIC_SECTOR => 'CATEGORY_PUBLIC_SECTOR', + self::CATEGORY_RETAIL => 'CATEGORY_RETAIL', + self::CATEGORY_SPORTS => 'CATEGORY_SPORTS', + self::CATEGORY_SCIENCE_AND_RESEARCH => 'CATEGORY_SCIENCE_AND_RESEARCH', + self::CATEGORY_TRANSPORTATION_AND_LOGISTICS => 'CATEGORY_TRANSPORTATION_AND_LOGISTICS', + self::CATEGORY_TRAVEL_AND_TOURISM => 'CATEGORY_TRAVEL_AND_TOURISM', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Category::class, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing_Category::class); + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/RestrictedExportConfig.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/RestrictedExportConfig.php new file mode 100644 index 000000000000..28343b512b3b --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/RestrictedExportConfig.php @@ -0,0 +1,147 @@ +google.cloud.bigquery.analyticshub.v1.Listing.RestrictedExportConfig + */ +class RestrictedExportConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If true, enable restricted export. + * + * Generated from protobuf field bool enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enabled = false; + /** + * Output only. If true, restrict direct table access(read + * api/tabledata.list) on linked table. + * + * Generated from protobuf field bool restrict_direct_table_access = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $restrict_direct_table_access = false; + /** + * Optional. If true, restrict export of query result derived from + * restricted linked dataset table. + * + * Generated from protobuf field bool restrict_query_result = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $restrict_query_result = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Optional. If true, enable restricted export. + * @type bool $restrict_direct_table_access + * Output only. If true, restrict direct table access(read + * api/tabledata.list) on linked table. + * @type bool $restrict_query_result + * Optional. If true, restrict export of query result derived from + * restricted linked dataset table. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If true, enable restricted export. + * + * Generated from protobuf field bool enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnabled() + { + return $this->enabled; + } + + /** + * Optional. If true, enable restricted export. + * + * Generated from protobuf field bool enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * Output only. If true, restrict direct table access(read + * api/tabledata.list) on linked table. + * + * Generated from protobuf field bool restrict_direct_table_access = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRestrictDirectTableAccess() + { + return $this->restrict_direct_table_access; + } + + /** + * Output only. If true, restrict direct table access(read + * api/tabledata.list) on linked table. + * + * Generated from protobuf field bool restrict_direct_table_access = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRestrictDirectTableAccess($var) + { + GPBUtil::checkBool($var); + $this->restrict_direct_table_access = $var; + + return $this; + } + + /** + * Optional. If true, restrict export of query result derived from + * restricted linked dataset table. + * + * Generated from protobuf field bool restrict_query_result = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRestrictQueryResult() + { + return $this->restrict_query_result; + } + + /** + * Optional. If true, restrict export of query result derived from + * restricted linked dataset table. + * + * Generated from protobuf field bool restrict_query_result = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRestrictQueryResult($var) + { + GPBUtil::checkBool($var); + $this->restrict_query_result = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RestrictedExportConfig::class, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing_RestrictedExportConfig::class); + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/State.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/State.php new file mode 100644 index 000000000000..67c97bcd62f1 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Listing/State.php @@ -0,0 +1,58 @@ +google.cloud.bigquery.analyticshub.v1.Listing.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Subscribable state. Users with dataexchange.listings.subscribe permission + * can subscribe to this listing. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing_State::class); + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/OperationMetadata.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/OperationMetadata.php new file mode 100644 index 000000000000..8f1689b049e3 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.bigquery.analyticshub.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [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 + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Publisher.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Publisher.php new file mode 100644 index 000000000000..7ee643e5a79f --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Publisher.php @@ -0,0 +1,105 @@ +google.cloud.bigquery.analyticshub.v1.Publisher + */ +class Publisher extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the listing publisher. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. Email or URL of the listing publisher. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $primary_contact = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. Name of the listing publisher. + * @type string $primary_contact + * Optional. Email or URL of the listing publisher. + * Max Length: 1000 bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the listing publisher. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Name of the listing publisher. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Email or URL of the listing publisher. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPrimaryContact() + { + return $this->primary_contact; + } + + /** + * Optional. Email or URL of the listing publisher. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPrimaryContact($var) + { + GPBUtil::checkString($var, True); + $this->primary_contact = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RefreshSubscriptionRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RefreshSubscriptionRequest.php new file mode 100644 index 000000000000..f9822739ea36 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RefreshSubscriptionRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionRequest + */ +class RefreshSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the Subscription to refresh. + * e.g. `projects/subscriberproject/locations/US/subscriptions/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the Subscription to refresh. + * e.g. `projects/subscriberproject/locations/US/subscriptions/123` + * Please see {@see AnalyticsHubServiceClient::subscriptionName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\RefreshSubscriptionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the Subscription to refresh. + * e.g. `projects/subscriberproject/locations/US/subscriptions/123` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the Subscription to refresh. + * e.g. `projects/subscriberproject/locations/US/subscriptions/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the Subscription to refresh. + * e.g. `projects/subscriberproject/locations/US/subscriptions/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RefreshSubscriptionResponse.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RefreshSubscriptionResponse.php new file mode 100644 index 000000000000..baa3de8019f6 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RefreshSubscriptionResponse.php @@ -0,0 +1,77 @@ +google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionResponse + */ +class RefreshSubscriptionResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The refreshed subscription resource. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription subscription = 1; + */ + protected $subscription = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription $subscription + * The refreshed subscription resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * The refreshed subscription resource. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription subscription = 1; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription|null + */ + public function getSubscription() + { + return $this->subscription; + } + + public function hasSubscription() + { + return isset($this->subscription); + } + + public function clearSubscription() + { + unset($this->subscription); + } + + /** + * The refreshed subscription resource. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription subscription = 1; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription::class); + $this->subscription = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RevokeSubscriptionRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RevokeSubscriptionRequest.php new file mode 100644 index 000000000000..1cc4e2365c1e --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RevokeSubscriptionRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionRequest + */ +class RevokeSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the subscription to revoke. + * e.g. projects/123/locations/US/subscriptions/456 + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the subscription to revoke. + * e.g. projects/123/locations/US/subscriptions/456 + * Please see {@see AnalyticsHubServiceClient::subscriptionName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\RevokeSubscriptionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the subscription to revoke. + * e.g. projects/123/locations/US/subscriptions/456 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the subscription to revoke. + * e.g. projects/123/locations/US/subscriptions/456 + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the subscription to revoke. + * e.g. projects/123/locations/US/subscriptions/456 + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RevokeSubscriptionResponse.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RevokeSubscriptionResponse.php new file mode 100644 index 000000000000..948f06a270ed --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/RevokeSubscriptionResponse.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionResponse + */ +class RevokeSubscriptionResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SharingEnvironmentConfig.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SharingEnvironmentConfig.php new file mode 100644 index 000000000000..2596b44bb334 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SharingEnvironmentConfig.php @@ -0,0 +1,109 @@ +google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig + */ +class SharingEnvironmentConfig extends \Google\Protobuf\Internal\Message +{ + protected $environment; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig\DefaultExchangeConfig $default_exchange_config + * Default Analytics Hub data exchange, used for secured data sharing. + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig\DcrExchangeConfig $dcr_exchange_config + * Data Clean Room (DCR), used for privacy-safe and secured data sharing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Default Analytics Hub data exchange, used for secured data sharing. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DefaultExchangeConfig default_exchange_config = 1; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig\DefaultExchangeConfig|null + */ + public function getDefaultExchangeConfig() + { + return $this->readOneof(1); + } + + public function hasDefaultExchangeConfig() + { + return $this->hasOneof(1); + } + + /** + * Default Analytics Hub data exchange, used for secured data sharing. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DefaultExchangeConfig default_exchange_config = 1; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig\DefaultExchangeConfig $var + * @return $this + */ + public function setDefaultExchangeConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig\DefaultExchangeConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Data Clean Room (DCR), used for privacy-safe and secured data sharing. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DcrExchangeConfig dcr_exchange_config = 2; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig\DcrExchangeConfig|null + */ + public function getDcrExchangeConfig() + { + return $this->readOneof(2); + } + + public function hasDcrExchangeConfig() + { + return $this->hasOneof(2); + } + + /** + * Data Clean Room (DCR), used for privacy-safe and secured data sharing. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DcrExchangeConfig dcr_exchange_config = 2; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig\DcrExchangeConfig $var + * @return $this + */ + public function setDcrExchangeConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig\DcrExchangeConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getEnvironment() + { + return $this->whichOneof("environment"); + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SharingEnvironmentConfig/DcrExchangeConfig.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SharingEnvironmentConfig/DcrExchangeConfig.php new file mode 100644 index 000000000000..e5dcfa6b2daa --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SharingEnvironmentConfig/DcrExchangeConfig.php @@ -0,0 +1,160 @@ +google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DcrExchangeConfig + */ +class DcrExchangeConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. If True, this DCR restricts the contributors to sharing + * only a single resource in a Listing. And no two resources should have the + * same IDs. So if a contributor adds a view with a conflicting name, the + * CreateListing API will reject the request. if False, the data contributor + * can publish an entire dataset (as before). This is not configurable, and + * by default, all new DCRs will have the restriction set to True. + * + * Generated from protobuf field optional bool single_selected_resource_sharing_restriction = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $single_selected_resource_sharing_restriction = null; + /** + * Output only. If True, when subscribing to this DCR, it will create only + * one linked dataset containing all resources shared within the + * cleanroom. If False, when subscribing to this DCR, it will + * create 1 linked dataset per listing. This is not configurable, and by + * default, all new DCRs will have the restriction set to True. + * + * Generated from protobuf field optional bool single_linked_dataset_per_cleanroom = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $single_linked_dataset_per_cleanroom = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $single_selected_resource_sharing_restriction + * Output only. If True, this DCR restricts the contributors to sharing + * only a single resource in a Listing. And no two resources should have the + * same IDs. So if a contributor adds a view with a conflicting name, the + * CreateListing API will reject the request. if False, the data contributor + * can publish an entire dataset (as before). This is not configurable, and + * by default, all new DCRs will have the restriction set to True. + * @type bool $single_linked_dataset_per_cleanroom + * Output only. If True, when subscribing to this DCR, it will create only + * one linked dataset containing all resources shared within the + * cleanroom. If False, when subscribing to this DCR, it will + * create 1 linked dataset per listing. This is not configurable, and by + * default, all new DCRs will have the restriction set to True. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Output only. If True, this DCR restricts the contributors to sharing + * only a single resource in a Listing. And no two resources should have the + * same IDs. So if a contributor adds a view with a conflicting name, the + * CreateListing API will reject the request. if False, the data contributor + * can publish an entire dataset (as before). This is not configurable, and + * by default, all new DCRs will have the restriction set to True. + * + * Generated from protobuf field optional bool single_selected_resource_sharing_restriction = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSingleSelectedResourceSharingRestriction() + { + return isset($this->single_selected_resource_sharing_restriction) ? $this->single_selected_resource_sharing_restriction : false; + } + + public function hasSingleSelectedResourceSharingRestriction() + { + return isset($this->single_selected_resource_sharing_restriction); + } + + public function clearSingleSelectedResourceSharingRestriction() + { + unset($this->single_selected_resource_sharing_restriction); + } + + /** + * Output only. If True, this DCR restricts the contributors to sharing + * only a single resource in a Listing. And no two resources should have the + * same IDs. So if a contributor adds a view with a conflicting name, the + * CreateListing API will reject the request. if False, the data contributor + * can publish an entire dataset (as before). This is not configurable, and + * by default, all new DCRs will have the restriction set to True. + * + * Generated from protobuf field optional bool single_selected_resource_sharing_restriction = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSingleSelectedResourceSharingRestriction($var) + { + GPBUtil::checkBool($var); + $this->single_selected_resource_sharing_restriction = $var; + + return $this; + } + + /** + * Output only. If True, when subscribing to this DCR, it will create only + * one linked dataset containing all resources shared within the + * cleanroom. If False, when subscribing to this DCR, it will + * create 1 linked dataset per listing. This is not configurable, and by + * default, all new DCRs will have the restriction set to True. + * + * Generated from protobuf field optional bool single_linked_dataset_per_cleanroom = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSingleLinkedDatasetPerCleanroom() + { + return isset($this->single_linked_dataset_per_cleanroom) ? $this->single_linked_dataset_per_cleanroom : false; + } + + public function hasSingleLinkedDatasetPerCleanroom() + { + return isset($this->single_linked_dataset_per_cleanroom); + } + + public function clearSingleLinkedDatasetPerCleanroom() + { + unset($this->single_linked_dataset_per_cleanroom); + } + + /** + * Output only. If True, when subscribing to this DCR, it will create only + * one linked dataset containing all resources shared within the + * cleanroom. If False, when subscribing to this DCR, it will + * create 1 linked dataset per listing. This is not configurable, and by + * default, all new DCRs will have the restriction set to True. + * + * Generated from protobuf field optional bool single_linked_dataset_per_cleanroom = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSingleLinkedDatasetPerCleanroom($var) + { + GPBUtil::checkBool($var); + $this->single_linked_dataset_per_cleanroom = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DcrExchangeConfig::class, \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig_DcrExchangeConfig::class); + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SharingEnvironmentConfig/DefaultExchangeConfig.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SharingEnvironmentConfig/DefaultExchangeConfig.php new file mode 100644 index 000000000000..8382587d4c61 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SharingEnvironmentConfig/DefaultExchangeConfig.php @@ -0,0 +1,36 @@ +google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DefaultExchangeConfig + */ +class DefaultExchangeConfig extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DefaultExchangeConfig::class, \Google\Cloud\BigQuery\AnalyticsHub\V1\SharingEnvironmentConfig_DefaultExchangeConfig::class); + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeDataExchangeRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeDataExchangeRequest.php new file mode 100644 index 000000000000..3647f2fefce4 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeDataExchangeRequest.php @@ -0,0 +1,196 @@ +google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeRequest + */ +class SubscribeDataExchangeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the Data Exchange. + * e.g. `projects/publisherproject/locations/US/dataExchanges/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The parent resource path of the Subscription. + * e.g. `projects/subscriberproject/locations/US` + * + * Generated from protobuf field string destination = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $destination = ''; + /** + * Required. Name of the subscription to create. + * e.g. `subscription1` + * + * Generated from protobuf field string subscription = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subscription = ''; + /** + * Email of the subscriber. + * + * Generated from protobuf field string subscriber_contact = 3; + */ + protected $subscriber_contact = ''; + + /** + * @param string $name Required. Resource name of the Data Exchange. + * e.g. `projects/publisherproject/locations/US/dataExchanges/123` + * Please see {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeDataExchangeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the Data Exchange. + * e.g. `projects/publisherproject/locations/US/dataExchanges/123` + * @type string $destination + * Required. The parent resource path of the Subscription. + * e.g. `projects/subscriberproject/locations/US` + * @type string $subscription + * Required. Name of the subscription to create. + * e.g. `subscription1` + * @type string $subscriber_contact + * Email of the subscriber. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the Data Exchange. + * e.g. `projects/publisherproject/locations/US/dataExchanges/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the Data Exchange. + * e.g. `projects/publisherproject/locations/US/dataExchanges/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The parent resource path of the Subscription. + * e.g. `projects/subscriberproject/locations/US` + * + * Generated from protobuf field string destination = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDestination() + { + return $this->destination; + } + + /** + * Required. The parent resource path of the Subscription. + * e.g. `projects/subscriberproject/locations/US` + * + * Generated from protobuf field string destination = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDestination($var) + { + GPBUtil::checkString($var, True); + $this->destination = $var; + + return $this; + } + + /** + * Required. Name of the subscription to create. + * e.g. `subscription1` + * + * Generated from protobuf field string subscription = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Required. Name of the subscription to create. + * e.g. `subscription1` + * + * Generated from protobuf field string subscription = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + + /** + * Email of the subscriber. + * + * Generated from protobuf field string subscriber_contact = 3; + * @return string + */ + public function getSubscriberContact() + { + return $this->subscriber_contact; + } + + /** + * Email of the subscriber. + * + * Generated from protobuf field string subscriber_contact = 3; + * @param string $var + * @return $this + */ + public function setSubscriberContact($var) + { + GPBUtil::checkString($var, True); + $this->subscriber_contact = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeDataExchangeResponse.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeDataExchangeResponse.php new file mode 100644 index 000000000000..f9c149b11580 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeDataExchangeResponse.php @@ -0,0 +1,77 @@ +google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeResponse + */ +class SubscribeDataExchangeResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Subscription object created from this subscribe action. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription subscription = 1; + */ + protected $subscription = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription $subscription + * Subscription object created from this subscribe action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Subscription object created from this subscribe action. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription subscription = 1; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription|null + */ + public function getSubscription() + { + return $this->subscription; + } + + public function hasSubscription() + { + return isset($this->subscription); + } + + public function clearSubscription() + { + unset($this->subscription); + } + + /** + * Subscription object created from this subscribe action. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription subscription = 1; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription::class); + $this->subscription = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeListingRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeListingRequest.php new file mode 100644 index 000000000000..bc95350a135c --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeListingRequest.php @@ -0,0 +1,128 @@ +google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest + */ +class SubscribeListingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + protected $destination; + + /** + * @param string $name Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. Please see + * {@see AnalyticsHubServiceClient::listingName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeListingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\DestinationDataset $destination_dataset + * Input only. BigQuery destination dataset to create for the subscriber. + * @type string $name + * Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Input only. BigQuery destination dataset to create for the subscriber. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\DestinationDataset|null + */ + public function getDestinationDataset() + { + return $this->readOneof(3); + } + + public function hasDestinationDataset() + { + return $this->hasOneof(3); + } + + /** + * Input only. BigQuery destination dataset to create for the subscriber. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\DestinationDataset $var + * @return $this + */ + public function setDestinationDataset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\DestinationDataset::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeListingResponse.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeListingResponse.php new file mode 100644 index 000000000000..25398a642d6b --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/SubscribeListingResponse.php @@ -0,0 +1,77 @@ +google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse + */ +class SubscribeListingResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Subscription object created from this subscribe action. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription subscription = 1; + */ + protected $subscription = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription $subscription + * Subscription object created from this subscribe action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Subscription object created from this subscribe action. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription subscription = 1; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription|null + */ + public function getSubscription() + { + return $this->subscription; + } + + public function hasSubscription() + { + return isset($this->subscription); + } + + public function clearSubscription() + { + unset($this->subscription); + } + + /** + * Subscription object created from this subscribe action. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription subscription = 1; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription::class); + $this->subscription = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Subscription.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Subscription.php new file mode 100644 index 000000000000..773d68ea160a --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Subscription.php @@ -0,0 +1,432 @@ +google.cloud.bigquery.analyticshub.v1.Subscription + */ +class Subscription extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the subscription. + * e.g. `projects/myproject/locations/US/subscriptions/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. Timestamp when the subscription was created. + * + * Generated from protobuf field .google.protobuf.Timestamp creation_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $creation_time = null; + /** + * Output only. Timestamp when the subscription was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp last_modify_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_modify_time = null; + /** + * Output only. Organization of the project this subscription belongs to. + * + * Generated from protobuf field string organization_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $organization_id = ''; + /** + * Output only. Display name of the project of this subscription. + * + * Generated from protobuf field string organization_display_name = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $organization_display_name = ''; + /** + * Output only. Current state of the subscription. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Map of listing resource names to associated linked resource, + * e.g. projects/123/locations/US/dataExchanges/456/listings/789 + * -> + * projects/123/datasets/my_dataset + * For listing-level subscriptions, this is a map of size 1. + * Only contains values if state == STATE_ACTIVE. + * + * Generated from protobuf field map linked_dataset_map = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $linked_dataset_map; + /** + * Output only. Email of the subscriber. + * + * Generated from protobuf field string subscriber_contact = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $subscriber_contact = ''; + protected $resource_name; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $listing + * Output only. Resource name of the source Listing. + * e.g. projects/123/locations/US/dataExchanges/456/listings/789 + * @type string $data_exchange + * Output only. Resource name of the source Data Exchange. + * e.g. projects/123/locations/US/dataExchanges/456 + * @type string $name + * Output only. The resource name of the subscription. + * e.g. `projects/myproject/locations/US/subscriptions/123`. + * @type \Google\Protobuf\Timestamp $creation_time + * Output only. Timestamp when the subscription was created. + * @type \Google\Protobuf\Timestamp $last_modify_time + * Output only. Timestamp when the subscription was last modified. + * @type string $organization_id + * Output only. Organization of the project this subscription belongs to. + * @type string $organization_display_name + * Output only. Display name of the project of this subscription. + * @type int $state + * Output only. Current state of the subscription. + * @type array|\Google\Protobuf\Internal\MapField $linked_dataset_map + * Output only. Map of listing resource names to associated linked resource, + * e.g. projects/123/locations/US/dataExchanges/456/listings/789 + * -> + * projects/123/datasets/my_dataset + * For listing-level subscriptions, this is a map of size 1. + * Only contains values if state == STATE_ACTIVE. + * @type string $subscriber_contact + * Output only. Email of the subscriber. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Resource name of the source Listing. + * e.g. projects/123/locations/US/dataExchanges/456/listings/789 + * + * Generated from protobuf field string listing = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getListing() + { + return $this->readOneof(5); + } + + public function hasListing() + { + return $this->hasOneof(5); + } + + /** + * Output only. Resource name of the source Listing. + * e.g. projects/123/locations/US/dataExchanges/456/listings/789 + * + * Generated from protobuf field string listing = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setListing($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Output only. Resource name of the source Data Exchange. + * e.g. projects/123/locations/US/dataExchanges/456 + * + * Generated from protobuf field string data_exchange = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDataExchange() + { + return $this->readOneof(6); + } + + public function hasDataExchange() + { + return $this->hasOneof(6); + } + + /** + * Output only. Resource name of the source Data Exchange. + * e.g. projects/123/locations/US/dataExchanges/456 + * + * Generated from protobuf field string data_exchange = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDataExchange($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. The resource name of the subscription. + * e.g. `projects/myproject/locations/US/subscriptions/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the subscription. + * e.g. `projects/myproject/locations/US/subscriptions/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Timestamp when the subscription was created. + * + * Generated from protobuf field .google.protobuf.Timestamp creation_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreationTime() + { + return $this->creation_time; + } + + public function hasCreationTime() + { + return isset($this->creation_time); + } + + public function clearCreationTime() + { + unset($this->creation_time); + } + + /** + * Output only. Timestamp when the subscription was created. + * + * Generated from protobuf field .google.protobuf.Timestamp creation_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->creation_time = $var; + + return $this; + } + + /** + * Output only. Timestamp when the subscription was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp last_modify_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastModifyTime() + { + return $this->last_modify_time; + } + + public function hasLastModifyTime() + { + return isset($this->last_modify_time); + } + + public function clearLastModifyTime() + { + unset($this->last_modify_time); + } + + /** + * Output only. Timestamp when the subscription was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp last_modify_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastModifyTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_modify_time = $var; + + return $this; + } + + /** + * Output only. Organization of the project this subscription belongs to. + * + * Generated from protobuf field string organization_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getOrganizationId() + { + return $this->organization_id; + } + + /** + * Output only. Organization of the project this subscription belongs to. + * + * Generated from protobuf field string organization_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setOrganizationId($var) + { + GPBUtil::checkString($var, True); + $this->organization_id = $var; + + return $this; + } + + /** + * Output only. Display name of the project of this subscription. + * + * Generated from protobuf field string organization_display_name = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getOrganizationDisplayName() + { + return $this->organization_display_name; + } + + /** + * Output only. Display name of the project of this subscription. + * + * Generated from protobuf field string organization_display_name = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setOrganizationDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->organization_display_name = $var; + + return $this; + } + + /** + * Output only. Current state of the subscription. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state of the subscription. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Subscription.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Map of listing resource names to associated linked resource, + * e.g. projects/123/locations/US/dataExchanges/456/listings/789 + * -> + * projects/123/datasets/my_dataset + * For listing-level subscriptions, this is a map of size 1. + * Only contains values if state == STATE_ACTIVE. + * + * Generated from protobuf field map linked_dataset_map = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLinkedDatasetMap() + { + return $this->linked_dataset_map; + } + + /** + * Output only. Map of listing resource names to associated linked resource, + * e.g. projects/123/locations/US/dataExchanges/456/listings/789 + * -> + * projects/123/datasets/my_dataset + * For listing-level subscriptions, this is a map of size 1. + * Only contains values if state == STATE_ACTIVE. + * + * Generated from protobuf field map linked_dataset_map = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLinkedDatasetMap($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription\LinkedResource::class); + $this->linked_dataset_map = $arr; + + return $this; + } + + /** + * Output only. Email of the subscriber. + * + * Generated from protobuf field string subscriber_contact = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSubscriberContact() + { + return $this->subscriber_contact; + } + + /** + * Output only. Email of the subscriber. + * + * Generated from protobuf field string subscriber_contact = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSubscriberContact($var) + { + GPBUtil::checkString($var, True); + $this->subscriber_contact = $var; + + return $this; + } + + /** + * @return string + */ + public function getResourceName() + { + return $this->whichOneof("resource_name"); + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Subscription/LinkedResource.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Subscription/LinkedResource.php new file mode 100644 index 000000000000..997433f4fc84 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Subscription/LinkedResource.php @@ -0,0 +1,81 @@ +google.cloud.bigquery.analyticshub.v1.Subscription.LinkedResource + */ +class LinkedResource extends \Google\Protobuf\Internal\Message +{ + protected $reference; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $linked_dataset + * Output only. Name of the linked dataset, e.g. + * projects/subscriberproject/datasets/linked_dataset + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the linked dataset, e.g. + * projects/subscriberproject/datasets/linked_dataset + * + * Generated from protobuf field string linked_dataset = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLinkedDataset() + { + return $this->readOneof(1); + } + + public function hasLinkedDataset() + { + return $this->hasOneof(1); + } + + /** + * Output only. Name of the linked dataset, e.g. + * projects/subscriberproject/datasets/linked_dataset + * + * Generated from protobuf field string linked_dataset = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLinkedDataset($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getReference() + { + return $this->whichOneof("reference"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LinkedResource::class, \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription_LinkedResource::class); + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Subscription/State.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Subscription/State.php new file mode 100644 index 000000000000..8f5368d32784 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/Subscription/State.php @@ -0,0 +1,73 @@ +google.cloud.bigquery.analyticshub.v1.Subscription.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * This subscription is active and the data is accessible. + * + * Generated from protobuf enum STATE_ACTIVE = 1; + */ + const STATE_ACTIVE = 1; + /** + * The data referenced by this subscription is out of date and should be + * refreshed. This can happen when a data provider adds or removes datasets. + * + * Generated from protobuf enum STATE_STALE = 2; + */ + const STATE_STALE = 2; + /** + * This subscription has been cancelled or revoked and the data is no longer + * accessible. + * + * Generated from protobuf enum STATE_INACTIVE = 3; + */ + const STATE_INACTIVE = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::STATE_ACTIVE => 'STATE_ACTIVE', + self::STATE_STALE => 'STATE_STALE', + self::STATE_INACTIVE => 'STATE_INACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription_State::class); + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/UpdateDataExchangeRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/UpdateDataExchangeRequest.php new file mode 100644 index 000000000000..a39b0308867c --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/UpdateDataExchangeRequest.php @@ -0,0 +1,146 @@ +google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest + */ +class UpdateDataExchangeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The data exchange to update. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_exchange = null; + + /** + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange $dataExchange Required. The data exchange to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateDataExchangeRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange $dataExchange, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDataExchange($dataExchange) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange $data_exchange + * Required. The data exchange to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The data exchange to update. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange|null + */ + public function getDataExchange() + { + return $this->data_exchange; + } + + public function hasDataExchange() + { + return isset($this->data_exchange); + } + + public function clearDataExchange() + { + unset($this->data_exchange); + } + + /** + * Required. The data exchange to update. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange $var + * @return $this + */ + public function setDataExchange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange::class); + $this->data_exchange = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/UpdateListingRequest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/UpdateListingRequest.php new file mode 100644 index 000000000000..d890cb88debf --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/proto/src/Google/Cloud/BigQuery/AnalyticsHub/V1/UpdateListingRequest.php @@ -0,0 +1,146 @@ +google.cloud.bigquery.analyticshub.v1.UpdateListingRequest + */ +class UpdateListingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask specifies the fields to update in the listing + * resource. The fields specified in the `updateMask` are relative to the + * resource and are not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The listing to update. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $listing = null; + + /** + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing $listing Required. The listing to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask specifies the fields to update in the listing + * resource. The fields specified in the `updateMask` are relative to the + * resource and are not a full request. + * + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateListingRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BigQuery\AnalyticsHub\V1\Listing $listing, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setListing($listing) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask specifies the fields to update in the listing + * resource. The fields specified in the `updateMask` are relative to the + * resource and are not a full request. + * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing $listing + * Required. The listing to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask specifies the fields to update in the listing + * resource. The fields specified in the `updateMask` are relative to the + * resource and are not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask specifies the fields to update in the listing + * resource. The fields specified in the `updateMask` are relative to the + * resource and are not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The listing to update. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing|null + */ + public function getListing() + { + return $this->listing; + } + + public function hasListing() + { + return isset($this->listing); + } + + public function clearListing() + { + unset($this->listing); + } + + /** + * Required. The listing to update. + * + * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing $var + * @return $this + */ + public function setListing($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing::class); + $this->listing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/create_data_exchange.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/create_data_exchange.php new file mode 100644 index 000000000000..7deb15f08eec --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/create_data_exchange.php @@ -0,0 +1,90 @@ +setDisplayName($dataExchangeDisplayName); + $request = (new CreateDataExchangeRequest()) + ->setParent($formattedParent) + ->setDataExchangeId($dataExchangeId) + ->setDataExchange($dataExchange); + + // Call the API and handle any network failures. + try { + /** @var DataExchange $response */ + $response = $analyticsHubServiceClient->createDataExchange($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AnalyticsHubServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $dataExchangeId = '[DATA_EXCHANGE_ID]'; + $dataExchangeDisplayName = '[DISPLAY_NAME]'; + + create_data_exchange_sample($formattedParent, $dataExchangeId, $dataExchangeDisplayName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_CreateDataExchange_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/create_listing.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/create_listing.php new file mode 100644 index 000000000000..9c3d7fb5bdf8 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/create_listing.php @@ -0,0 +1,97 @@ +setBigqueryDataset($listingBigqueryDataset) + ->setDisplayName($listingDisplayName); + $request = (new CreateListingRequest()) + ->setParent($formattedParent) + ->setListingId($listingId) + ->setListing($listing); + + // Call the API and handle any network failures. + try { + /** @var Listing $response */ + $response = $analyticsHubServiceClient->createListing($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AnalyticsHubServiceClient::dataExchangeName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]' + ); + $listingId = '[LISTING_ID]'; + $listingDisplayName = '[DISPLAY_NAME]'; + + create_listing_sample($formattedParent, $listingId, $listingDisplayName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_CreateListing_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/delete_data_exchange.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/delete_data_exchange.php new file mode 100644 index 000000000000..b2c81eac8fb4 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/delete_data_exchange.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $analyticsHubServiceClient->deleteDataExchange($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::dataExchangeName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]' + ); + + delete_data_exchange_sample($formattedName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_DeleteDataExchange_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/delete_listing.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/delete_listing.php new file mode 100644 index 000000000000..154911e4d768 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/delete_listing.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $analyticsHubServiceClient->deleteListing($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::listingName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]', + '[LISTING]' + ); + + delete_listing_sample($formattedName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_DeleteListing_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/delete_subscription.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/delete_subscription.php new file mode 100644 index 000000000000..58c61238ed1f --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/delete_subscription.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $analyticsHubServiceClient->deleteSubscription($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::subscriptionName( + '[PROJECT]', + '[LOCATION]', + '[SUBSCRIPTION]' + ); + + delete_subscription_sample($formattedName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_DeleteSubscription_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_data_exchange.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_data_exchange.php new file mode 100644 index 000000000000..8168270e7bcc --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_data_exchange.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DataExchange $response */ + $response = $analyticsHubServiceClient->getDataExchange($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::dataExchangeName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]' + ); + + get_data_exchange_sample($formattedName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_GetDataExchange_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_iam_policy.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..7b6395957e37 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_iam_policy.php @@ -0,0 +1,71 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $analyticsHubServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END analyticshub_v1_generated_AnalyticsHubService_GetIamPolicy_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_listing.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_listing.php new file mode 100644 index 000000000000..37c635b4cec1 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_listing.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Listing $response */ + $response = $analyticsHubServiceClient->getListing($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::listingName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]', + '[LISTING]' + ); + + get_listing_sample($formattedName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_GetListing_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_subscription.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_subscription.php new file mode 100644 index 000000000000..6df7c988d8a8 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/get_subscription.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Subscription $response */ + $response = $analyticsHubServiceClient->getSubscription($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::subscriptionName( + '[PROJECT]', + '[LOCATION]', + '[SUBSCRIPTION]' + ); + + get_subscription_sample($formattedName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_GetSubscription_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_data_exchanges.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_data_exchanges.php new file mode 100644 index 000000000000..e1ce230bfb00 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_data_exchanges.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $analyticsHubServiceClient->listDataExchanges($request); + + /** @var DataExchange $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AnalyticsHubServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_data_exchanges_sample($formattedParent); +} +// [END analyticshub_v1_generated_AnalyticsHubService_ListDataExchanges_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_listings.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_listings.php new file mode 100644 index 000000000000..8497431fbf05 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_listings.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $analyticsHubServiceClient->listListings($request); + + /** @var Listing $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AnalyticsHubServiceClient::dataExchangeName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]' + ); + + list_listings_sample($formattedParent); +} +// [END analyticshub_v1_generated_AnalyticsHubService_ListListings_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_org_data_exchanges.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_org_data_exchanges.php new file mode 100644 index 000000000000..909cafafe605 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_org_data_exchanges.php @@ -0,0 +1,77 @@ +setOrganization($organization); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $analyticsHubServiceClient->listOrgDataExchanges($request); + + /** @var DataExchange $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $organization = '[ORGANIZATION]'; + + list_org_data_exchanges_sample($organization); +} +// [END analyticshub_v1_generated_AnalyticsHubService_ListOrgDataExchanges_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_shared_resource_subscriptions.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_shared_resource_subscriptions.php new file mode 100644 index 000000000000..420411fd03cb --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_shared_resource_subscriptions.php @@ -0,0 +1,78 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $analyticsHubServiceClient->listSharedResourceSubscriptions($request); + + /** @var Subscription $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + list_shared_resource_subscriptions_sample($resource); +} +// [END analyticshub_v1_generated_AnalyticsHubService_ListSharedResourceSubscriptions_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_subscriptions.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_subscriptions.php new file mode 100644 index 000000000000..67d681debe88 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/list_subscriptions.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $analyticsHubServiceClient->listSubscriptions($request); + + /** @var Subscription $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AnalyticsHubServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_subscriptions_sample($formattedParent); +} +// [END analyticshub_v1_generated_AnalyticsHubService_ListSubscriptions_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/refresh_subscription.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/refresh_subscription.php new file mode 100644 index 000000000000..acc145b1ed29 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/refresh_subscription.php @@ -0,0 +1,90 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $analyticsHubServiceClient->refreshSubscription($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RefreshSubscriptionResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::subscriptionName( + '[PROJECT]', + '[LOCATION]', + '[SUBSCRIPTION]' + ); + + refresh_subscription_sample($formattedName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_RefreshSubscription_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/revoke_subscription.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/revoke_subscription.php new file mode 100644 index 000000000000..a748b2c44de2 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/revoke_subscription.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var RevokeSubscriptionResponse $response */ + $response = $analyticsHubServiceClient->revokeSubscription($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::subscriptionName( + '[PROJECT]', + '[LOCATION]', + '[SUBSCRIPTION]' + ); + + revoke_subscription_sample($formattedName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_RevokeSubscription_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/set_iam_policy.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..20444c0319b2 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/set_iam_policy.php @@ -0,0 +1,73 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $analyticsHubServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END analyticshub_v1_generated_AnalyticsHubService_SetIamPolicy_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/subscribe_data_exchange.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/subscribe_data_exchange.php new file mode 100644 index 000000000000..732adf0edd73 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/subscribe_data_exchange.php @@ -0,0 +1,101 @@ +setName($formattedName) + ->setDestination($formattedDestination) + ->setSubscription($subscription); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $analyticsHubServiceClient->subscribeDataExchange($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SubscribeDataExchangeResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::dataExchangeName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]' + ); + $formattedDestination = AnalyticsHubServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $subscription = '[SUBSCRIPTION]'; + + subscribe_data_exchange_sample($formattedName, $formattedDestination, $subscription); +} +// [END analyticshub_v1_generated_AnalyticsHubService_SubscribeDataExchange_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/subscribe_listing.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/subscribe_listing.php new file mode 100644 index 000000000000..29db76caf325 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/subscribe_listing.php @@ -0,0 +1,82 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SubscribeListingResponse $response */ + $response = $analyticsHubServiceClient->subscribeListing($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::listingName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]', + '[LISTING]' + ); + + subscribe_listing_sample($formattedName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_SubscribeListing_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/test_iam_permissions.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..c471d83cf94e --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $analyticsHubServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END analyticshub_v1_generated_AnalyticsHubService_TestIamPermissions_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/update_data_exchange.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/update_data_exchange.php new file mode 100644 index 000000000000..1c51faad82cd --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/update_data_exchange.php @@ -0,0 +1,78 @@ +setDisplayName($dataExchangeDisplayName); + $request = (new UpdateDataExchangeRequest()) + ->setUpdateMask($updateMask) + ->setDataExchange($dataExchange); + + // Call the API and handle any network failures. + try { + /** @var DataExchange $response */ + $response = $analyticsHubServiceClient->updateDataExchange($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $dataExchangeDisplayName = '[DISPLAY_NAME]'; + + update_data_exchange_sample($dataExchangeDisplayName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_UpdateDataExchange_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/update_listing.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/update_listing.php new file mode 100644 index 000000000000..7cafc4893e22 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/samples/V1/AnalyticsHubServiceClient/update_listing.php @@ -0,0 +1,81 @@ +setBigqueryDataset($listingBigqueryDataset) + ->setDisplayName($listingDisplayName); + $request = (new UpdateListingRequest()) + ->setUpdateMask($updateMask) + ->setListing($listing); + + // Call the API and handle any network failures. + try { + /** @var Listing $response */ + $response = $analyticsHubServiceClient->updateListing($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $listingDisplayName = '[DISPLAY_NAME]'; + + update_listing_sample($listingDisplayName); +} +// [END analyticshub_v1_generated_AnalyticsHubService_UpdateListing_sync] diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/Client/AnalyticsHubServiceClient.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/Client/AnalyticsHubServiceClient.php new file mode 100644 index 000000000000..2291c4b0e69e --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/Client/AnalyticsHubServiceClient.php @@ -0,0 +1,1013 @@ + createDataExchangeAsync(CreateDataExchangeRequest $request, array $optionalArgs = []) + * @method PromiseInterface createListingAsync(CreateListingRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteDataExchangeAsync(DeleteDataExchangeRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteListingAsync(DeleteListingRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSubscriptionAsync(DeleteSubscriptionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDataExchangeAsync(GetDataExchangeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getListingAsync(GetListingRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSubscriptionAsync(GetSubscriptionRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDataExchangesAsync(ListDataExchangesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listListingsAsync(ListListingsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listOrgDataExchangesAsync(ListOrgDataExchangesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSharedResourceSubscriptionsAsync(ListSharedResourceSubscriptionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSubscriptionsAsync(ListSubscriptionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface refreshSubscriptionAsync(RefreshSubscriptionRequest $request, array $optionalArgs = []) + * @method PromiseInterface revokeSubscriptionAsync(RevokeSubscriptionRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface subscribeDataExchangeAsync(SubscribeDataExchangeRequest $request, array $optionalArgs = []) + * @method PromiseInterface subscribeListingAsync(SubscribeListingRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDataExchangeAsync(UpdateDataExchangeRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateListingAsync(UpdateListingRequest $request, array $optionalArgs = []) + */ +final class AnalyticsHubServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.bigquery.analyticshub.v1.AnalyticsHubService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'analyticshub.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'analyticshub.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/analytics_hub_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/analytics_hub_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/analytics_hub_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/analytics_hub_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * data_exchange resource. + * + * @param string $project + * @param string $location + * @param string $dataExchange + * + * @return string The formatted data_exchange resource. + */ + public static function dataExchangeName(string $project, string $location, string $dataExchange): string + { + return self::getPathTemplate('dataExchange')->render([ + 'project' => $project, + 'location' => $location, + 'data_exchange' => $dataExchange, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a dataset + * resource. + * + * @param string $project + * @param string $dataset + * + * @return string The formatted dataset resource. + */ + public static function datasetName(string $project, string $dataset): string + { + return self::getPathTemplate('dataset')->render([ + 'project' => $project, + 'dataset' => $dataset, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a listing + * resource. + * + * @param string $project + * @param string $location + * @param string $dataExchange + * @param string $listing + * + * @return string The formatted listing resource. + */ + public static function listingName(string $project, string $location, string $dataExchange, string $listing): string + { + return self::getPathTemplate('listing')->render([ + 'project' => $project, + 'location' => $location, + 'data_exchange' => $dataExchange, + 'listing' => $listing, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a subscription + * resource. + * + * @param string $project + * @param string $location + * @param string $subscription + * + * @return string The formatted subscription resource. + */ + public static function subscriptionName(string $project, string $location, string $subscription): string + { + return self::getPathTemplate('subscription')->render([ + 'project' => $project, + 'location' => $location, + 'subscription' => $subscription, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a table + * resource. + * + * @param string $project + * @param string $dataset + * @param string $table + * + * @return string The formatted table resource. + */ + public static function tableName(string $project, string $dataset, string $table): string + { + return self::getPathTemplate('table')->render([ + 'project' => $project, + 'dataset' => $dataset, + 'table' => $table, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - dataExchange: projects/{project}/locations/{location}/dataExchanges/{data_exchange} + * - dataset: projects/{project}/datasets/{dataset} + * - listing: projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing} + * - location: projects/{project}/locations/{location} + * - subscription: projects/{project}/locations/{location}/subscriptions/{subscription} + * - table: projects/{project}/datasets/{dataset}/tables/{table} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'analyticshub.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new data exchange. + * + * The async variant is {@see AnalyticsHubServiceClient::createDataExchangeAsync()} + * . + * + * @example samples/V1/AnalyticsHubServiceClient/create_data_exchange.php + * + * @param CreateDataExchangeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataExchange + * + * @throws ApiException Thrown if the API call fails. + */ + public function createDataExchange(CreateDataExchangeRequest $request, array $callOptions = []): DataExchange + { + return $this->startApiCall('CreateDataExchange', $request, $callOptions)->wait(); + } + + /** + * Creates a new listing. + * + * The async variant is {@see AnalyticsHubServiceClient::createListingAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/create_listing.php + * + * @param CreateListingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Listing + * + * @throws ApiException Thrown if the API call fails. + */ + public function createListing(CreateListingRequest $request, array $callOptions = []): Listing + { + return $this->startApiCall('CreateListing', $request, $callOptions)->wait(); + } + + /** + * Deletes an existing data exchange. + * + * The async variant is {@see AnalyticsHubServiceClient::deleteDataExchangeAsync()} + * . + * + * @example samples/V1/AnalyticsHubServiceClient/delete_data_exchange.php + * + * @param DeleteDataExchangeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteDataExchange(DeleteDataExchangeRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteDataExchange', $request, $callOptions)->wait(); + } + + /** + * Deletes a listing. + * + * The async variant is {@see AnalyticsHubServiceClient::deleteListingAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/delete_listing.php + * + * @param DeleteListingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteListing(DeleteListingRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteListing', $request, $callOptions)->wait(); + } + + /** + * Deletes a subscription. + * + * The async variant is {@see AnalyticsHubServiceClient::deleteSubscriptionAsync()} + * . + * + * @example samples/V1/AnalyticsHubServiceClient/delete_subscription.php + * + * @param DeleteSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSubscription(DeleteSubscriptionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteSubscription', $request, $callOptions)->wait(); + } + + /** + * Gets the details of a data exchange. + * + * The async variant is {@see AnalyticsHubServiceClient::getDataExchangeAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/get_data_exchange.php + * + * @param GetDataExchangeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataExchange + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDataExchange(GetDataExchangeRequest $request, array $callOptions = []): DataExchange + { + return $this->startApiCall('GetDataExchange', $request, $callOptions)->wait(); + } + + /** + * Gets the IAM policy. + * + * The async variant is {@see AnalyticsHubServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets the details of a listing. + * + * The async variant is {@see AnalyticsHubServiceClient::getListingAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/get_listing.php + * + * @param GetListingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Listing + * + * @throws ApiException Thrown if the API call fails. + */ + public function getListing(GetListingRequest $request, array $callOptions = []): Listing + { + return $this->startApiCall('GetListing', $request, $callOptions)->wait(); + } + + /** + * Gets the details of a Subscription. + * + * The async variant is {@see AnalyticsHubServiceClient::getSubscriptionAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/get_subscription.php + * + * @param GetSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Subscription + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSubscription(GetSubscriptionRequest $request, array $callOptions = []): Subscription + { + return $this->startApiCall('GetSubscription', $request, $callOptions)->wait(); + } + + /** + * Lists all data exchanges in a given project and location. + * + * The async variant is {@see AnalyticsHubServiceClient::listDataExchangesAsync()} + * . + * + * @example samples/V1/AnalyticsHubServiceClient/list_data_exchanges.php + * + * @param ListDataExchangesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDataExchanges(ListDataExchangesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDataExchanges', $request, $callOptions); + } + + /** + * Lists all listings in a given project and location. + * + * The async variant is {@see AnalyticsHubServiceClient::listListingsAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/list_listings.php + * + * @param ListListingsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listListings(ListListingsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListListings', $request, $callOptions); + } + + /** + * Lists all data exchanges from projects in a given organization and + * location. + * + * The async variant is + * {@see AnalyticsHubServiceClient::listOrgDataExchangesAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/list_org_data_exchanges.php + * + * @param ListOrgDataExchangesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listOrgDataExchanges(ListOrgDataExchangesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListOrgDataExchanges', $request, $callOptions); + } + + /** + * Lists all subscriptions on a given Data Exchange or Listing. + * + * The async variant is + * {@see AnalyticsHubServiceClient::listSharedResourceSubscriptionsAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/list_shared_resource_subscriptions.php + * + * @param ListSharedResourceSubscriptionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSharedResourceSubscriptions(ListSharedResourceSubscriptionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSharedResourceSubscriptions', $request, $callOptions); + } + + /** + * Lists all subscriptions in a given project and location. + * + * The async variant is {@see AnalyticsHubServiceClient::listSubscriptionsAsync()} + * . + * + * @example samples/V1/AnalyticsHubServiceClient/list_subscriptions.php + * + * @param ListSubscriptionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSubscriptions(ListSubscriptionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSubscriptions', $request, $callOptions); + } + + /** + * Refreshes a Subscription to a Data Exchange. A Data Exchange can become + * stale when a publisher adds or removes data. This is a long-running + * operation as it may create many linked datasets. + * + * The async variant is + * {@see AnalyticsHubServiceClient::refreshSubscriptionAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/refresh_subscription.php + * + * @param RefreshSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function refreshSubscription(RefreshSubscriptionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RefreshSubscription', $request, $callOptions)->wait(); + } + + /** + * Revokes a given subscription. + * + * The async variant is {@see AnalyticsHubServiceClient::revokeSubscriptionAsync()} + * . + * + * @example samples/V1/AnalyticsHubServiceClient/revoke_subscription.php + * + * @param RevokeSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return RevokeSubscriptionResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function revokeSubscription(RevokeSubscriptionRequest $request, array $callOptions = []): RevokeSubscriptionResponse + { + return $this->startApiCall('RevokeSubscription', $request, $callOptions)->wait(); + } + + /** + * Sets the IAM policy. + * + * The async variant is {@see AnalyticsHubServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a Subscription to a Data Exchange. This is a long-running operation + * as it will create one or more linked datasets. + * + * The async variant is + * {@see AnalyticsHubServiceClient::subscribeDataExchangeAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/subscribe_data_exchange.php + * + * @param SubscribeDataExchangeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function subscribeDataExchange(SubscribeDataExchangeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SubscribeDataExchange', $request, $callOptions)->wait(); + } + + /** + * Subscribes to a listing. + * + * Currently, with Analytics Hub, you can create listings that + * reference only BigQuery datasets. + * Upon subscription to a listing for a BigQuery dataset, Analytics Hub + * creates a linked dataset in the subscriber's project. + * + * The async variant is {@see AnalyticsHubServiceClient::subscribeListingAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/subscribe_listing.php + * + * @param SubscribeListingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SubscribeListingResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function subscribeListing(SubscribeListingRequest $request, array $callOptions = []): SubscribeListingResponse + { + return $this->startApiCall('SubscribeListing', $request, $callOptions)->wait(); + } + + /** + * Returns the permissions that a caller has. + * + * The async variant is {@see AnalyticsHubServiceClient::testIamPermissionsAsync()} + * . + * + * @example samples/V1/AnalyticsHubServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates an existing data exchange. + * + * The async variant is {@see AnalyticsHubServiceClient::updateDataExchangeAsync()} + * . + * + * @example samples/V1/AnalyticsHubServiceClient/update_data_exchange.php + * + * @param UpdateDataExchangeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataExchange + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDataExchange(UpdateDataExchangeRequest $request, array $callOptions = []): DataExchange + { + return $this->startApiCall('UpdateDataExchange', $request, $callOptions)->wait(); + } + + /** + * Updates an existing listing. + * + * The async variant is {@see AnalyticsHubServiceClient::updateListingAsync()} . + * + * @example samples/V1/AnalyticsHubServiceClient/update_listing.php + * + * @param UpdateListingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Listing + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateListing(UpdateListingRequest $request, array $callOptions = []): Listing + { + return $this->startApiCall('UpdateListing', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..29a21346b492 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/gapic_metadata.json @@ -0,0 +1,128 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.bigquery.analyticshub.v1", + "libraryPackage": "Google\\Cloud\\BigQuery\\AnalyticsHub\\V1", + "services": { + "AnalyticsHubService": { + "clients": { + "grpc": { + "libraryClient": "AnalyticsHubServiceGapicClient", + "rpcs": { + "CreateDataExchange": { + "methods": [ + "createDataExchange" + ] + }, + "CreateListing": { + "methods": [ + "createListing" + ] + }, + "DeleteDataExchange": { + "methods": [ + "deleteDataExchange" + ] + }, + "DeleteListing": { + "methods": [ + "deleteListing" + ] + }, + "DeleteSubscription": { + "methods": [ + "deleteSubscription" + ] + }, + "GetDataExchange": { + "methods": [ + "getDataExchange" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetListing": { + "methods": [ + "getListing" + ] + }, + "GetSubscription": { + "methods": [ + "getSubscription" + ] + }, + "ListDataExchanges": { + "methods": [ + "listDataExchanges" + ] + }, + "ListListings": { + "methods": [ + "listListings" + ] + }, + "ListOrgDataExchanges": { + "methods": [ + "listOrgDataExchanges" + ] + }, + "ListSharedResourceSubscriptions": { + "methods": [ + "listSharedResourceSubscriptions" + ] + }, + "ListSubscriptions": { + "methods": [ + "listSubscriptions" + ] + }, + "RefreshSubscription": { + "methods": [ + "refreshSubscription" + ] + }, + "RevokeSubscription": { + "methods": [ + "revokeSubscription" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SubscribeDataExchange": { + "methods": [ + "subscribeDataExchange" + ] + }, + "SubscribeListing": { + "methods": [ + "subscribeListing" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateDataExchange": { + "methods": [ + "updateDataExchange" + ] + }, + "UpdateListing": { + "methods": [ + "updateListing" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/resources/analytics_hub_service_client_config.json b/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/resources/analytics_hub_service_client_config.json new file mode 100644 index 000000000000..8847f98d2f28 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/resources/analytics_hub_service_client_config.json @@ -0,0 +1,145 @@ +{ + "interfaces": { + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateListing": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteListing": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetListing": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDataExchanges": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListListings": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListOrgDataExchanges": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSharedResourceSubscriptions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSubscriptions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RefreshSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RevokeSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SubscribeDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SubscribeListing": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateListing": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/resources/analytics_hub_service_descriptor_config.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/resources/analytics_hub_service_descriptor_config.php new file mode 100644 index 000000000000..efefd6b59a97 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/resources/analytics_hub_service_descriptor_config.php @@ -0,0 +1,363 @@ + [ + 'google.cloud.bigquery.analyticshub.v1.AnalyticsHubService' => [ + 'DeleteSubscription' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BigQuery\AnalyticsHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RefreshSubscription' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BigQuery\AnalyticsHub\V1\RefreshSubscriptionResponse', + 'metadataReturnType' => '\Google\Cloud\BigQuery\AnalyticsHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SubscribeDataExchange' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeDataExchangeResponse', + 'metadataReturnType' => '\Google\Cloud\BigQuery\AnalyticsHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateDataExchange' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateListing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\Listing', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataExchange' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteListing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDataExchange' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetListing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\Listing', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListDataExchanges' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataExchanges', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\ListDataExchangesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListListings' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getListings', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\ListListingsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListOrgDataExchanges' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataExchanges', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\ListOrgDataExchangesResponse', + 'headerParams' => [ + [ + 'keyName' => 'organization', + 'fieldAccessors' => [ + 'getOrganization', + ], + ], + ], + ], + 'ListSharedResourceSubscriptions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSharedResourceSubscriptions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\ListSharedResourceSubscriptionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'ListSubscriptions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSubscriptions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\ListSubscriptionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RevokeSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\RevokeSubscriptionResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'SubscribeListing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeListingResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateDataExchange' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange', + 'headerParams' => [ + [ + 'keyName' => 'data_exchange.name', + 'fieldAccessors' => [ + 'getDataExchange', + 'getName', + ], + ], + ], + ], + 'UpdateListing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\Listing', + 'headerParams' => [ + [ + 'keyName' => 'listing.name', + 'fieldAccessors' => [ + 'getListing', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'dataExchange' => 'projects/{project}/locations/{location}/dataExchanges/{data_exchange}', + 'dataset' => 'projects/{project}/datasets/{dataset}', + 'listing' => 'projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}', + 'location' => 'projects/{project}/locations/{location}', + 'subscription' => 'projects/{project}/locations/{location}/subscriptions/{subscription}', + 'table' => 'projects/{project}/datasets/{dataset}/tables/{table}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/resources/analytics_hub_service_rest_client_config.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/resources/analytics_hub_service_rest_client_config.php new file mode 100644 index 000000000000..8dba38a5eee3 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/src/V1/resources/analytics_hub_service_rest_client_config.php @@ -0,0 +1,332 @@ + [ + 'google.cloud.bigquery.analyticshub.v1.AnalyticsHubService' => [ + 'CreateDataExchange' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/dataExchanges', + 'body' => 'data_exchange', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'data_exchange_id', + ], + ], + 'CreateListing' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/dataExchanges/*}/listings', + 'body' => 'listing', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'listing_id', + ], + ], + 'DeleteDataExchange' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteListing' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSubscription' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/subscriptions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDataExchange' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataExchanges/*}:getIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:getIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/subscriptions/*}:getIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetListing' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSubscription' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/subscriptions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListDataExchanges' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/dataExchanges', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListListings' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/dataExchanges/*}/listings', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListOrgDataExchanges' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{organization=organizations/*/locations/*}/dataExchanges', + 'placeholders' => [ + 'organization' => [ + 'getters' => [ + 'getOrganization', + ], + ], + ], + ], + 'ListSharedResourceSubscriptions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataExchanges/*}:listSubscriptions', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:listSubscriptions', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'ListSubscriptions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/subscriptions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RefreshSubscription' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/subscriptions/*}:refresh', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RevokeSubscription' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/subscriptions/*}:revoke', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataExchanges/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/subscriptions/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SubscribeDataExchange' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*}:subscribe', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SubscribeListing' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}:subscribe', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataExchanges/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateDataExchange' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{data_exchange.name=projects/*/locations/*/dataExchanges/*}', + 'body' => 'data_exchange', + 'placeholders' => [ + 'data_exchange.name' => [ + 'getters' => [ + 'getDataExchange', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateListing' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{listing.name=projects/*/locations/*/dataExchanges/*/listings/*}', + 'body' => 'listing', + 'placeholders' => [ + 'listing.name' => [ + 'getters' => [ + 'getListing', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryAnalyticsHub/v1/tests/Unit/V1/Client/AnalyticsHubServiceClientTest.php b/owl-bot-staging/BigQueryAnalyticsHub/v1/tests/Unit/V1/Client/AnalyticsHubServiceClientTest.php new file mode 100644 index 000000000000..6d51510c3d35 --- /dev/null +++ b/owl-bot-staging/BigQueryAnalyticsHub/v1/tests/Unit/V1/Client/AnalyticsHubServiceClientTest.php @@ -0,0 +1,1929 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AnalyticsHubServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AnalyticsHubServiceClient($options); + } + + /** @test */ + public function createDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $listingCount = 1101038700; + $icon = '121'; + $expectedResponse = new DataExchange(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setListingCount($listingCount); + $expectedResponse->setIcon($icon); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataExchangeId = 'dataExchangeId1402219426'; + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $request = (new CreateDataExchangeRequest()) + ->setParent($formattedParent) + ->setDataExchangeId($dataExchangeId) + ->setDataExchange($dataExchange); + $response = $gapicClient->createDataExchange($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/CreateDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getDataExchangeId(); + $this->assertProtobufEquals($dataExchangeId, $actualValue); + $actualValue = $actualRequestObject->getDataExchange(); + $this->assertProtobufEquals($dataExchange, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataExchangeId = 'dataExchangeId1402219426'; + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $request = (new CreateDataExchangeRequest()) + ->setParent($formattedParent) + ->setDataExchangeId($dataExchangeId) + ->setDataExchange($dataExchange); + try { + $gapicClient->createDataExchange($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $icon = '121'; + $requestAccess = 'requestAccess2059178260'; + $expectedResponse = new Listing(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setIcon($icon); + $expectedResponse->setRequestAccess($requestAccess); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $listingId = 'listingId988969142'; + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + $request = (new CreateListingRequest()) + ->setParent($formattedParent) + ->setListingId($listingId) + ->setListing($listing); + $response = $gapicClient->createListing($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/CreateListing', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getListingId(); + $this->assertProtobufEquals($listingId, $actualValue); + $actualValue = $actualRequestObject->getListing(); + $this->assertProtobufEquals($listing, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $listingId = 'listingId988969142'; + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + $request = (new CreateListingRequest()) + ->setParent($formattedParent) + ->setListingId($listingId) + ->setListing($listing); + try { + $gapicClient->createListing($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new DeleteDataExchangeRequest()) + ->setName($formattedName); + $gapicClient->deleteDataExchange($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/DeleteDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new DeleteDataExchangeRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteDataExchange($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new DeleteListingRequest()) + ->setName($formattedName); + $gapicClient->deleteListing($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/DeleteListing', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new DeleteListingRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteListing($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSubscriptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteSubscriptionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteSubscriptionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->subscriptionName('[PROJECT]', '[LOCATION]', '[SUBSCRIPTION]'); + $request = (new DeleteSubscriptionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteSubscription($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/DeleteSubscription', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSubscriptionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteSubscriptionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteSubscriptionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->subscriptionName('[PROJECT]', '[LOCATION]', '[SUBSCRIPTION]'); + $request = (new DeleteSubscriptionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteSubscription($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSubscriptionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $listingCount = 1101038700; + $icon = '121'; + $expectedResponse = new DataExchange(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setListingCount($listingCount); + $expectedResponse->setIcon($icon); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new GetDataExchangeRequest()) + ->setName($formattedName); + $response = $gapicClient->getDataExchange($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/GetDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new GetDataExchangeRequest()) + ->setName($formattedName); + try { + $gapicClient->getDataExchange($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $icon = '121'; + $requestAccess = 'requestAccess2059178260'; + $expectedResponse = new Listing(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setIcon($icon); + $expectedResponse->setRequestAccess($requestAccess); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new GetListingRequest()) + ->setName($formattedName); + $response = $gapicClient->getListing($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/GetListing', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new GetListingRequest()) + ->setName($formattedName); + try { + $gapicClient->getListing($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $listing = 'listing181975684'; + $name2 = 'name2-1052831874'; + $organizationId = 'organizationId1326486439'; + $organizationDisplayName = 'organizationDisplayName1039600500'; + $subscriberContact = 'subscriberContact-975982775'; + $expectedResponse = new Subscription(); + $expectedResponse->setListing($listing); + $expectedResponse->setName($name2); + $expectedResponse->setOrganizationId($organizationId); + $expectedResponse->setOrganizationDisplayName($organizationDisplayName); + $expectedResponse->setSubscriberContact($subscriberContact); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->subscriptionName('[PROJECT]', '[LOCATION]', '[SUBSCRIPTION]'); + $request = (new GetSubscriptionRequest()) + ->setName($formattedName); + $response = $gapicClient->getSubscription($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/GetSubscription', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSubscriptionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->subscriptionName('[PROJECT]', '[LOCATION]', '[SUBSCRIPTION]'); + $request = (new GetSubscriptionRequest()) + ->setName($formattedName); + try { + $gapicClient->getSubscription($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataExchangesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataExchangesElement = new DataExchange(); + $dataExchanges = [ + $dataExchangesElement, + ]; + $expectedResponse = new ListDataExchangesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataExchanges($dataExchanges); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListDataExchangesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listDataExchanges($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataExchanges()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListDataExchanges', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataExchangesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListDataExchangesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listDataExchanges($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listListingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $listingsElement = new Listing(); + $listings = [ + $listingsElement, + ]; + $expectedResponse = new ListListingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setListings($listings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new ListListingsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listListings($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getListings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListListings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listListingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new ListListingsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listListings($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOrgDataExchangesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataExchangesElement = new DataExchange(); + $dataExchanges = [ + $dataExchangesElement, + ]; + $expectedResponse = new ListOrgDataExchangesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataExchanges($dataExchanges); + $transport->addResponse($expectedResponse); + // Mock request + $organization = 'organization1178922291'; + $request = (new ListOrgDataExchangesRequest()) + ->setOrganization($organization); + $response = $gapicClient->listOrgDataExchanges($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataExchanges()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListOrgDataExchanges', $actualFuncCall); + $actualValue = $actualRequestObject->getOrganization(); + $this->assertProtobufEquals($organization, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOrgDataExchangesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $organization = 'organization1178922291'; + $request = (new ListOrgDataExchangesRequest()) + ->setOrganization($organization); + try { + $gapicClient->listOrgDataExchanges($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSharedResourceSubscriptionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $sharedResourceSubscriptionsElement = new Subscription(); + $sharedResourceSubscriptions = [ + $sharedResourceSubscriptionsElement, + ]; + $expectedResponse = new ListSharedResourceSubscriptionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSharedResourceSubscriptions($sharedResourceSubscriptions); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new ListSharedResourceSubscriptionsRequest()) + ->setResource($resource); + $response = $gapicClient->listSharedResourceSubscriptions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSharedResourceSubscriptions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListSharedResourceSubscriptions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSharedResourceSubscriptionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new ListSharedResourceSubscriptionsRequest()) + ->setResource($resource); + try { + $gapicClient->listSharedResourceSubscriptions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSubscriptionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $subscriptionsElement = new Subscription(); + $subscriptions = [ + $subscriptionsElement, + ]; + $expectedResponse = new ListSubscriptionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSubscriptions($subscriptions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSubscriptionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listSubscriptions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSubscriptions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListSubscriptions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSubscriptionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSubscriptionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listSubscriptions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function refreshSubscriptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/refreshSubscriptionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new RefreshSubscriptionResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/refreshSubscriptionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->subscriptionName('[PROJECT]', '[LOCATION]', '[SUBSCRIPTION]'); + $request = (new RefreshSubscriptionRequest()) + ->setName($formattedName); + $response = $gapicClient->refreshSubscription($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/RefreshSubscription', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/refreshSubscriptionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function refreshSubscriptionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/refreshSubscriptionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->subscriptionName('[PROJECT]', '[LOCATION]', '[SUBSCRIPTION]'); + $request = (new RefreshSubscriptionRequest()) + ->setName($formattedName); + $response = $gapicClient->refreshSubscription($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/refreshSubscriptionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function revokeSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RevokeSubscriptionResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->subscriptionName('[PROJECT]', '[LOCATION]', '[SUBSCRIPTION]'); + $request = (new RevokeSubscriptionRequest()) + ->setName($formattedName); + $response = $gapicClient->revokeSubscription($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/RevokeSubscription', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function revokeSubscriptionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->subscriptionName('[PROJECT]', '[LOCATION]', '[SUBSCRIPTION]'); + $request = (new RevokeSubscriptionRequest()) + ->setName($formattedName); + try { + $gapicClient->revokeSubscription($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function subscribeDataExchangeTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/subscribeDataExchangeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new SubscribeDataExchangeResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/subscribeDataExchangeTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $formattedDestination = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $subscription = 'subscription341203229'; + $request = (new SubscribeDataExchangeRequest()) + ->setName($formattedName) + ->setDestination($formattedDestination) + ->setSubscription($subscription); + $response = $gapicClient->subscribeDataExchange($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/SubscribeDataExchange', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getDestination(); + $this->assertProtobufEquals($formattedDestination, $actualValue); + $actualValue = $actualApiRequestObject->getSubscription(); + $this->assertProtobufEquals($subscription, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/subscribeDataExchangeTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function subscribeDataExchangeExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/subscribeDataExchangeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $formattedDestination = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $subscription = 'subscription341203229'; + $request = (new SubscribeDataExchangeRequest()) + ->setName($formattedName) + ->setDestination($formattedDestination) + ->setSubscription($subscription); + $response = $gapicClient->subscribeDataExchange($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/subscribeDataExchangeTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function subscribeListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SubscribeListingResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new SubscribeListingRequest()) + ->setName($formattedName); + $response = $gapicClient->subscribeListing($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/SubscribeListing', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function subscribeListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new SubscribeListingRequest()) + ->setName($formattedName); + try { + $gapicClient->subscribeListing($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $listingCount = 1101038700; + $icon = '121'; + $expectedResponse = new DataExchange(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setListingCount($listingCount); + $expectedResponse->setIcon($icon); + $transport->addResponse($expectedResponse); + // Mock request + $updateMask = new FieldMask(); + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $request = (new UpdateDataExchangeRequest()) + ->setUpdateMask($updateMask) + ->setDataExchange($dataExchange); + $response = $gapicClient->updateDataExchange($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/UpdateDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualRequestObject->getDataExchange(); + $this->assertProtobufEquals($dataExchange, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $request = (new UpdateDataExchangeRequest()) + ->setUpdateMask($updateMask) + ->setDataExchange($dataExchange); + try { + $gapicClient->updateDataExchange($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $icon = '121'; + $requestAccess = 'requestAccess2059178260'; + $expectedResponse = new Listing(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setIcon($icon); + $expectedResponse->setRequestAccess($requestAccess); + $transport->addResponse($expectedResponse); + // Mock request + $updateMask = new FieldMask(); + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + $request = (new UpdateListingRequest()) + ->setUpdateMask($updateMask) + ->setListing($listing); + $response = $gapicClient->updateListing($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/UpdateListing', $actualFuncCall); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualRequestObject->getListing(); + $this->assertProtobufEquals($listing, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + $request = (new UpdateListingRequest()) + ->setUpdateMask($updateMask) + ->setListing($listing); + try { + $gapicClient->updateListing($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDataExchangeAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $listingCount = 1101038700; + $icon = '121'; + $expectedResponse = new DataExchange(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setListingCount($listingCount); + $expectedResponse->setIcon($icon); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataExchangeId = 'dataExchangeId1402219426'; + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $request = (new CreateDataExchangeRequest()) + ->setParent($formattedParent) + ->setDataExchangeId($dataExchangeId) + ->setDataExchange($dataExchange); + $response = $gapicClient->createDataExchangeAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/CreateDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getDataExchangeId(); + $this->assertProtobufEquals($dataExchangeId, $actualValue); + $actualValue = $actualRequestObject->getDataExchange(); + $this->assertProtobufEquals($dataExchange, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Connection/V1/Connection.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Connection/V1/Connection.php new file mode 100644 index 000000000000..0503193128ae Binary files /dev/null and b/owl-bot-staging/BigQueryConnection/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Connection/V1/Connection.php differ diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsAccessRole.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsAccessRole.php new file mode 100644 index 000000000000..a8e30e4d6bc3 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsAccessRole.php @@ -0,0 +1,110 @@ +google.cloud.bigquery.connection.v1.AwsAccessRole + */ +class AwsAccessRole extends \Google\Protobuf\Internal\Message +{ + /** + * The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + * Connection. + * + * Generated from protobuf field string iam_role_id = 1; + */ + protected $iam_role_id = ''; + /** + * A unique Google-owned and Google-generated identity for the Connection. + * This identity will be used to access the user's AWS IAM Role. + * + * Generated from protobuf field string identity = 2; + */ + protected $identity = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $iam_role_id + * The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + * Connection. + * @type string $identity + * A unique Google-owned and Google-generated identity for the Connection. + * This identity will be used to access the user's AWS IAM Role. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + * Connection. + * + * Generated from protobuf field string iam_role_id = 1; + * @return string + */ + public function getIamRoleId() + { + return $this->iam_role_id; + } + + /** + * The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + * Connection. + * + * Generated from protobuf field string iam_role_id = 1; + * @param string $var + * @return $this + */ + public function setIamRoleId($var) + { + GPBUtil::checkString($var, True); + $this->iam_role_id = $var; + + return $this; + } + + /** + * A unique Google-owned and Google-generated identity for the Connection. + * This identity will be used to access the user's AWS IAM Role. + * + * Generated from protobuf field string identity = 2; + * @return string + */ + public function getIdentity() + { + return $this->identity; + } + + /** + * A unique Google-owned and Google-generated identity for the Connection. + * This identity will be used to access the user's AWS IAM Role. + * + * Generated from protobuf field string identity = 2; + * @param string $var + * @return $this + */ + public function setIdentity($var) + { + GPBUtil::checkString($var, True); + $this->identity = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsCrossAccountRole.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsCrossAccountRole.php new file mode 100644 index 000000000000..9b36df96aeba --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsCrossAccountRole.php @@ -0,0 +1,152 @@ +google.cloud.bigquery.connection.v1.AwsCrossAccountRole + */ +class AwsCrossAccountRole extends \Google\Protobuf\Internal\Message +{ + /** + * The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + * Connection. + * + * Generated from protobuf field string iam_role_id = 1; + */ + protected $iam_role_id = ''; + /** + * Output only. Google-owned AWS IAM User for a Connection. + * + * Generated from protobuf field string iam_user_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $iam_user_id = ''; + /** + * Output only. A Google-generated id for representing Connection’s identity + * in AWS. External Id is also used for preventing the Confused Deputy + * Problem. See + * https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html + * + * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $external_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $iam_role_id + * The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + * Connection. + * @type string $iam_user_id + * Output only. Google-owned AWS IAM User for a Connection. + * @type string $external_id + * Output only. A Google-generated id for representing Connection’s identity + * in AWS. External Id is also used for preventing the Confused Deputy + * Problem. See + * https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + * Connection. + * + * Generated from protobuf field string iam_role_id = 1; + * @return string + */ + public function getIamRoleId() + { + return $this->iam_role_id; + } + + /** + * The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + * Connection. + * + * Generated from protobuf field string iam_role_id = 1; + * @param string $var + * @return $this + */ + public function setIamRoleId($var) + { + GPBUtil::checkString($var, True); + $this->iam_role_id = $var; + + return $this; + } + + /** + * Output only. Google-owned AWS IAM User for a Connection. + * + * Generated from protobuf field string iam_user_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIamUserId() + { + return $this->iam_user_id; + } + + /** + * Output only. Google-owned AWS IAM User for a Connection. + * + * Generated from protobuf field string iam_user_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIamUserId($var) + { + GPBUtil::checkString($var, True); + $this->iam_user_id = $var; + + return $this; + } + + /** + * Output only. A Google-generated id for representing Connection’s identity + * in AWS. External Id is also used for preventing the Confused Deputy + * Problem. See + * https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html + * + * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getExternalId() + { + return $this->external_id; + } + + /** + * Output only. A Google-generated id for representing Connection’s identity + * in AWS. External Id is also used for preventing the Confused Deputy + * Problem. See + * https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html + * + * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setExternalId($var) + { + GPBUtil::checkString($var, True); + $this->external_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsProperties.php new file mode 100644 index 000000000000..9d0a58c34f8b --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsProperties.php @@ -0,0 +1,122 @@ +google.cloud.bigquery.connection.v1.AwsProperties + */ +class AwsProperties extends \Google\Protobuf\Internal\Message +{ + protected $authentication_method; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole $cross_account_role + * Authentication using Google owned AWS IAM user's access key to assume + * into customer's AWS IAM Role. + * Deprecated, do not use. + * @type \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole $access_role + * Authentication using Google owned service account to assume into + * customer's AWS IAM Role. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Authentication using Google owned AWS IAM user's access key to assume + * into customer's AWS IAM Role. + * Deprecated, do not use. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2 [deprecated = true]; + * @return \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole|null + * @deprecated + */ + public function getCrossAccountRole() + { + @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(2); + } + + public function hasCrossAccountRole() + { + @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(2); + } + + /** + * Authentication using Google owned AWS IAM user's access key to assume + * into customer's AWS IAM Role. + * Deprecated, do not use. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2 [deprecated = true]; + * @param \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole $var + * @return $this + * @deprecated + */ + public function setCrossAccountRole($var) + { + @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Authentication using Google owned service account to assume into + * customer's AWS IAM Role. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsAccessRole access_role = 3; + * @return \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole|null + */ + public function getAccessRole() + { + return $this->readOneof(3); + } + + public function hasAccessRole() + { + return $this->hasOneof(3); + } + + /** + * Authentication using Google owned service account to assume into + * customer's AWS IAM Role. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsAccessRole access_role = 3; + * @param \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole $var + * @return $this + */ + public function setAccessRole($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getAuthenticationMethod() + { + return $this->whichOneof("authentication_method"); + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AzureProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AzureProperties.php new file mode 100644 index 000000000000..4eed865cd3d5 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AzureProperties.php @@ -0,0 +1,287 @@ +google.cloud.bigquery.connection.v1.AzureProperties + */ +class AzureProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the Azure Active Directory Application. + * + * Generated from protobuf field string application = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $application = ''; + /** + * Output only. The client id of the Azure Active Directory Application. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $client_id = ''; + /** + * Output only. The object id of the Azure Active Directory Application. + * + * Generated from protobuf field string object_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $object_id = ''; + /** + * The id of customer's directory that host the data. + * + * Generated from protobuf field string customer_tenant_id = 4; + */ + protected $customer_tenant_id = ''; + /** + * The URL user will be redirected to after granting consent during connection + * setup. + * + * Generated from protobuf field string redirect_uri = 5; + */ + protected $redirect_uri = ''; + /** + * The client ID of the user's Azure Active Directory Application used for a + * federated connection. + * + * Generated from protobuf field string federated_application_client_id = 6; + */ + protected $federated_application_client_id = ''; + /** + * Output only. A unique Google-owned and Google-generated identity for the + * Connection. This identity will be used to access the user's Azure Active + * Directory Application. + * + * Generated from protobuf field string identity = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $identity = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $application + * Output only. The name of the Azure Active Directory Application. + * @type string $client_id + * Output only. The client id of the Azure Active Directory Application. + * @type string $object_id + * Output only. The object id of the Azure Active Directory Application. + * @type string $customer_tenant_id + * The id of customer's directory that host the data. + * @type string $redirect_uri + * The URL user will be redirected to after granting consent during connection + * setup. + * @type string $federated_application_client_id + * The client ID of the user's Azure Active Directory Application used for a + * federated connection. + * @type string $identity + * Output only. A unique Google-owned and Google-generated identity for the + * Connection. This identity will be used to access the user's Azure Active + * Directory Application. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the Azure Active Directory Application. + * + * Generated from protobuf field string application = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApplication() + { + return $this->application; + } + + /** + * Output only. The name of the Azure Active Directory Application. + * + * Generated from protobuf field string application = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApplication($var) + { + GPBUtil::checkString($var, True); + $this->application = $var; + + return $this; + } + + /** + * Output only. The client id of the Azure Active Directory Application. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getClientId() + { + return $this->client_id; + } + + /** + * Output only. The client id of the Azure Active Directory Application. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setClientId($var) + { + GPBUtil::checkString($var, True); + $this->client_id = $var; + + return $this; + } + + /** + * Output only. The object id of the Azure Active Directory Application. + * + * Generated from protobuf field string object_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getObjectId() + { + return $this->object_id; + } + + /** + * Output only. The object id of the Azure Active Directory Application. + * + * Generated from protobuf field string object_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setObjectId($var) + { + GPBUtil::checkString($var, True); + $this->object_id = $var; + + return $this; + } + + /** + * The id of customer's directory that host the data. + * + * Generated from protobuf field string customer_tenant_id = 4; + * @return string + */ + public function getCustomerTenantId() + { + return $this->customer_tenant_id; + } + + /** + * The id of customer's directory that host the data. + * + * Generated from protobuf field string customer_tenant_id = 4; + * @param string $var + * @return $this + */ + public function setCustomerTenantId($var) + { + GPBUtil::checkString($var, True); + $this->customer_tenant_id = $var; + + return $this; + } + + /** + * The URL user will be redirected to after granting consent during connection + * setup. + * + * Generated from protobuf field string redirect_uri = 5; + * @return string + */ + public function getRedirectUri() + { + return $this->redirect_uri; + } + + /** + * The URL user will be redirected to after granting consent during connection + * setup. + * + * Generated from protobuf field string redirect_uri = 5; + * @param string $var + * @return $this + */ + public function setRedirectUri($var) + { + GPBUtil::checkString($var, True); + $this->redirect_uri = $var; + + return $this; + } + + /** + * The client ID of the user's Azure Active Directory Application used for a + * federated connection. + * + * Generated from protobuf field string federated_application_client_id = 6; + * @return string + */ + public function getFederatedApplicationClientId() + { + return $this->federated_application_client_id; + } + + /** + * The client ID of the user's Azure Active Directory Application used for a + * federated connection. + * + * Generated from protobuf field string federated_application_client_id = 6; + * @param string $var + * @return $this + */ + public function setFederatedApplicationClientId($var) + { + GPBUtil::checkString($var, True); + $this->federated_application_client_id = $var; + + return $this; + } + + /** + * Output only. A unique Google-owned and Google-generated identity for the + * Connection. This identity will be used to access the user's Azure Active + * Directory Application. + * + * Generated from protobuf field string identity = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIdentity() + { + return $this->identity; + } + + /** + * Output only. A unique Google-owned and Google-generated identity for the + * Connection. This identity will be used to access the user's Azure Active + * Directory Application. + * + * Generated from protobuf field string identity = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIdentity($var) + { + GPBUtil::checkString($var, True); + $this->identity = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php new file mode 100644 index 000000000000..cf4b72596aaf --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php @@ -0,0 +1,100 @@ +google.cloud.bigquery.connection.v1.CloudResourceProperties + */ +class CloudResourceProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The account ID of the service created for the purpose of this + * connection. + * The service account does not have any permissions associated with it + * when it is created. After creation, customers delegate permissions + * to the service account. When the connection is used in the context of an + * operation in BigQuery, the service account will be used to connect to the + * desired resources in GCP. + * The account ID is in the form of: + * @gcp-sa-bigquery-cloudresource.iam.gserviceaccount.com + * + * Generated from protobuf field string service_account_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $service_account_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account_id + * Output only. The account ID of the service created for the purpose of this + * connection. + * The service account does not have any permissions associated with it + * when it is created. After creation, customers delegate permissions + * to the service account. When the connection is used in the context of an + * operation in BigQuery, the service account will be used to connect to the + * desired resources in GCP. + * The account ID is in the form of: + * @gcp-sa-bigquery-cloudresource.iam.gserviceaccount.com + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The account ID of the service created for the purpose of this + * connection. + * The service account does not have any permissions associated with it + * when it is created. After creation, customers delegate permissions + * to the service account. When the connection is used in the context of an + * operation in BigQuery, the service account will be used to connect to the + * desired resources in GCP. + * The account ID is in the form of: + * @gcp-sa-bigquery-cloudresource.iam.gserviceaccount.com + * + * Generated from protobuf field string service_account_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAccountId() + { + return $this->service_account_id; + } + + /** + * Output only. The account ID of the service created for the purpose of this + * connection. + * The service account does not have any permissions associated with it + * when it is created. After creation, customers delegate permissions + * to the service account. When the connection is used in the context of an + * operation in BigQuery, the service account will be used to connect to the + * desired resources in GCP. + * The account ID is in the form of: + * @gcp-sa-bigquery-cloudresource.iam.gserviceaccount.com + * + * Generated from protobuf field string service_account_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAccountId($var) + { + GPBUtil::checkString($var, True); + $this->service_account_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSpannerProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSpannerProperties.php new file mode 100644 index 000000000000..e200b09b16a3 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSpannerProperties.php @@ -0,0 +1,313 @@ +google.cloud.bigquery.connection.v1.CloudSpannerProperties + */ +class CloudSpannerProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud Spanner database in the form `project/instance/database' + * + * Generated from protobuf field string database = 1; + */ + protected $database = ''; + /** + * If parallelism should be used when reading from Cloud Spanner + * + * Generated from protobuf field bool use_parallelism = 2; + */ + protected $use_parallelism = false; + /** + * Allows setting max parallelism per query when executing on Spanner + * independent compute resources. If unspecified, default values of + * parallelism are chosen that are dependent on the Cloud Spanner instance + * configuration. + * REQUIRES: `use_parallelism` must be set. + * REQUIRES: Either `use_data_boost` or `use_serverless_analytics` must be + * set. + * + * Generated from protobuf field int32 max_parallelism = 5; + */ + protected $max_parallelism = 0; + /** + * If the serverless analytics service should be used to read data from Cloud + * Spanner. + * Note: `use_parallelism` must be set when using serverless analytics. + * + * Generated from protobuf field bool use_serverless_analytics = 3; + */ + protected $use_serverless_analytics = false; + /** + * If set, the request will be executed via Spanner independent compute + * resources. + * REQUIRES: `use_parallelism` must be set. + * NOTE: `use_serverless_analytics` will be deprecated. Prefer + * `use_data_boost` over `use_serverless_analytics`. + * + * Generated from protobuf field bool use_data_boost = 6; + */ + protected $use_data_boost = false; + /** + * Optional. Cloud Spanner database role for fine-grained access control. + * The Cloud Spanner admin should have provisioned the database role with + * appropriate permissions, such as `SELECT` and `INSERT`. Other users should + * only use roles provided by their Cloud Spanner admins. + * For more details, see [About fine-grained access control] + * (https://cloud.google.com/spanner/docs/fgac-about). + * REQUIRES: The database role name must start with a letter, and can only + * contain letters, numbers, and underscores. + * + * Generated from protobuf field string database_role = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $database_role = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $database + * Cloud Spanner database in the form `project/instance/database' + * @type bool $use_parallelism + * If parallelism should be used when reading from Cloud Spanner + * @type int $max_parallelism + * Allows setting max parallelism per query when executing on Spanner + * independent compute resources. If unspecified, default values of + * parallelism are chosen that are dependent on the Cloud Spanner instance + * configuration. + * REQUIRES: `use_parallelism` must be set. + * REQUIRES: Either `use_data_boost` or `use_serverless_analytics` must be + * set. + * @type bool $use_serverless_analytics + * If the serverless analytics service should be used to read data from Cloud + * Spanner. + * Note: `use_parallelism` must be set when using serverless analytics. + * @type bool $use_data_boost + * If set, the request will be executed via Spanner independent compute + * resources. + * REQUIRES: `use_parallelism` must be set. + * NOTE: `use_serverless_analytics` will be deprecated. Prefer + * `use_data_boost` over `use_serverless_analytics`. + * @type string $database_role + * Optional. Cloud Spanner database role for fine-grained access control. + * The Cloud Spanner admin should have provisioned the database role with + * appropriate permissions, such as `SELECT` and `INSERT`. Other users should + * only use roles provided by their Cloud Spanner admins. + * For more details, see [About fine-grained access control] + * (https://cloud.google.com/spanner/docs/fgac-about). + * REQUIRES: The database role name must start with a letter, and can only + * contain letters, numbers, and underscores. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Spanner database in the form `project/instance/database' + * + * Generated from protobuf field string database = 1; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Cloud Spanner database in the form `project/instance/database' + * + * Generated from protobuf field string database = 1; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * If parallelism should be used when reading from Cloud Spanner + * + * Generated from protobuf field bool use_parallelism = 2; + * @return bool + */ + public function getUseParallelism() + { + return $this->use_parallelism; + } + + /** + * If parallelism should be used when reading from Cloud Spanner + * + * Generated from protobuf field bool use_parallelism = 2; + * @param bool $var + * @return $this + */ + public function setUseParallelism($var) + { + GPBUtil::checkBool($var); + $this->use_parallelism = $var; + + return $this; + } + + /** + * Allows setting max parallelism per query when executing on Spanner + * independent compute resources. If unspecified, default values of + * parallelism are chosen that are dependent on the Cloud Spanner instance + * configuration. + * REQUIRES: `use_parallelism` must be set. + * REQUIRES: Either `use_data_boost` or `use_serverless_analytics` must be + * set. + * + * Generated from protobuf field int32 max_parallelism = 5; + * @return int + */ + public function getMaxParallelism() + { + return $this->max_parallelism; + } + + /** + * Allows setting max parallelism per query when executing on Spanner + * independent compute resources. If unspecified, default values of + * parallelism are chosen that are dependent on the Cloud Spanner instance + * configuration. + * REQUIRES: `use_parallelism` must be set. + * REQUIRES: Either `use_data_boost` or `use_serverless_analytics` must be + * set. + * + * Generated from protobuf field int32 max_parallelism = 5; + * @param int $var + * @return $this + */ + public function setMaxParallelism($var) + { + GPBUtil::checkInt32($var); + $this->max_parallelism = $var; + + return $this; + } + + /** + * If the serverless analytics service should be used to read data from Cloud + * Spanner. + * Note: `use_parallelism` must be set when using serverless analytics. + * + * Generated from protobuf field bool use_serverless_analytics = 3; + * @return bool + */ + public function getUseServerlessAnalytics() + { + return $this->use_serverless_analytics; + } + + /** + * If the serverless analytics service should be used to read data from Cloud + * Spanner. + * Note: `use_parallelism` must be set when using serverless analytics. + * + * Generated from protobuf field bool use_serverless_analytics = 3; + * @param bool $var + * @return $this + */ + public function setUseServerlessAnalytics($var) + { + GPBUtil::checkBool($var); + $this->use_serverless_analytics = $var; + + return $this; + } + + /** + * If set, the request will be executed via Spanner independent compute + * resources. + * REQUIRES: `use_parallelism` must be set. + * NOTE: `use_serverless_analytics` will be deprecated. Prefer + * `use_data_boost` over `use_serverless_analytics`. + * + * Generated from protobuf field bool use_data_boost = 6; + * @return bool + */ + public function getUseDataBoost() + { + return $this->use_data_boost; + } + + /** + * If set, the request will be executed via Spanner independent compute + * resources. + * REQUIRES: `use_parallelism` must be set. + * NOTE: `use_serverless_analytics` will be deprecated. Prefer + * `use_data_boost` over `use_serverless_analytics`. + * + * Generated from protobuf field bool use_data_boost = 6; + * @param bool $var + * @return $this + */ + public function setUseDataBoost($var) + { + GPBUtil::checkBool($var); + $this->use_data_boost = $var; + + return $this; + } + + /** + * Optional. Cloud Spanner database role for fine-grained access control. + * The Cloud Spanner admin should have provisioned the database role with + * appropriate permissions, such as `SELECT` and `INSERT`. Other users should + * only use roles provided by their Cloud Spanner admins. + * For more details, see [About fine-grained access control] + * (https://cloud.google.com/spanner/docs/fgac-about). + * REQUIRES: The database role name must start with a letter, and can only + * contain letters, numbers, and underscores. + * + * Generated from protobuf field string database_role = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDatabaseRole() + { + return $this->database_role; + } + + /** + * Optional. Cloud Spanner database role for fine-grained access control. + * The Cloud Spanner admin should have provisioned the database role with + * appropriate permissions, such as `SELECT` and `INSERT`. Other users should + * only use roles provided by their Cloud Spanner admins. + * For more details, see [About fine-grained access control] + * (https://cloud.google.com/spanner/docs/fgac-about). + * REQUIRES: The database role name must start with a letter, and can only + * contain letters, numbers, and underscores. + * + * Generated from protobuf field string database_role = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDatabaseRole($var) + { + GPBUtil::checkString($var, True); + $this->database_role = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlCredential.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlCredential.php new file mode 100644 index 000000000000..29199f24bfeb --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlCredential.php @@ -0,0 +1,101 @@ +google.cloud.bigquery.connection.v1.CloudSqlCredential + */ +class CloudSqlCredential extends \Google\Protobuf\Internal\Message +{ + /** + * The username for the credential. + * + * Generated from protobuf field string username = 1; + */ + protected $username = ''; + /** + * The password for the credential. + * + * Generated from protobuf field string password = 2; + */ + protected $password = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $username + * The username for the credential. + * @type string $password + * The password for the credential. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * The username for the credential. + * + * Generated from protobuf field string username = 1; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * The username for the credential. + * + * Generated from protobuf field string username = 1; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + + /** + * The password for the credential. + * + * Generated from protobuf field string password = 2; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * The password for the credential. + * + * Generated from protobuf field string password = 2; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php new file mode 100644 index 000000000000..088c0b4a1475 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php @@ -0,0 +1,229 @@ +google.cloud.bigquery.connection.v1.CloudSqlProperties + */ +class CloudSqlProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + */ + protected $instance_id = ''; + /** + * Database name. + * + * Generated from protobuf field string database = 2; + */ + protected $database = ''; + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + */ + protected $type = 0; + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $credential = null; + /** + * Output only. The account ID of the service used for the purpose of this + * connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as the identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $service_account_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_id + * Cloud SQL instance ID in the form `project:location:instance`. + * @type string $database + * Database name. + * @type int $type + * Type of the Cloud SQL database. + * @type \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $credential + * Input only. Cloud SQL credential. + * @type string $service_account_id + * Output only. The account ID of the service used for the purpose of this + * connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as the identity being used for + * connecting to the CloudSQL instance specified in this connection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Database name. + * + * Generated from protobuf field string database = 2; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Database name. + * + * Generated from protobuf field string database = 2; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties\DatabaseType::class); + $this->type = $var; + + return $this; + } + + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential|null + */ + public function getCredential() + { + return $this->credential; + } + + public function hasCredential() + { + return isset($this->credential); + } + + public function clearCredential() + { + unset($this->credential); + } + + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $var + * @return $this + */ + public function setCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential::class); + $this->credential = $var; + + return $this; + } + + /** + * Output only. The account ID of the service used for the purpose of this + * connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as the identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAccountId() + { + return $this->service_account_id; + } + + /** + * Output only. The account ID of the service used for the purpose of this + * connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as the identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAccountId($var) + { + GPBUtil::checkString($var, True); + $this->service_account_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php new file mode 100644 index 000000000000..8c0ea09de1f7 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php @@ -0,0 +1,64 @@ +google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType + */ +class DatabaseType +{ + /** + * Unspecified database type. + * + * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; + */ + const DATABASE_TYPE_UNSPECIFIED = 0; + /** + * Cloud SQL for PostgreSQL. + * + * Generated from protobuf enum POSTGRES = 1; + */ + const POSTGRES = 1; + /** + * Cloud SQL for MySQL. + * + * Generated from protobuf enum MYSQL = 2; + */ + const MYSQL = 2; + + private static $valueToName = [ + self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', + self::POSTGRES => 'POSTGRES', + self::MYSQL => 'MYSQL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DatabaseType::class, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties_DatabaseType::class); + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/Connection.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/Connection.php new file mode 100644 index 000000000000..692d883d280c --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/Connection.php @@ -0,0 +1,488 @@ +google.cloud.bigquery.connection.v1.Connection + */ +class Connection extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the connection in the form of: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * User provided display name for the connection. + * + * Generated from protobuf field string friendly_name = 2; + */ + protected $friendly_name = ''; + /** + * User provided description. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * Output only. The creation timestamp of the connection. + * + * Generated from protobuf field int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $creation_time = 0; + /** + * Output only. The last update timestamp of the connection. + * + * Generated from protobuf field int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_modified_time = 0; + /** + * Output only. True, if credential is configured for this connection. + * + * Generated from protobuf field bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $has_credential = false; + protected $properties; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the connection in the form of: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @type string $friendly_name + * User provided display name for the connection. + * @type string $description + * User provided description. + * @type \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties $cloud_sql + * Cloud SQL properties. + * @type \Google\Cloud\BigQuery\Connection\V1\AwsProperties $aws + * Amazon Web Services (AWS) properties. + * @type \Google\Cloud\BigQuery\Connection\V1\AzureProperties $azure + * Azure properties. + * @type \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties $cloud_spanner + * Cloud Spanner properties. + * @type \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties $cloud_resource + * Cloud Resource properties. + * @type \Google\Cloud\BigQuery\Connection\V1\SparkProperties $spark + * Spark properties. + * @type \Google\Cloud\BigQuery\Connection\V1\SalesforceDataCloudProperties $salesforce_data_cloud + * Optional. Salesforce DataCloud properties. This field is intended for + * use only by Salesforce partner projects. This field contains properties + * for your Salesforce DataCloud connection. + * @type int|string $creation_time + * Output only. The creation timestamp of the connection. + * @type int|string $last_modified_time + * Output only. The last update timestamp of the connection. + * @type bool $has_credential + * Output only. True, if credential is configured for this connection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the connection in the form of: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the connection in the form of: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User provided display name for the connection. + * + * Generated from protobuf field string friendly_name = 2; + * @return string + */ + public function getFriendlyName() + { + return $this->friendly_name; + } + + /** + * User provided display name for the connection. + * + * Generated from protobuf field string friendly_name = 2; + * @param string $var + * @return $this + */ + public function setFriendlyName($var) + { + GPBUtil::checkString($var, True); + $this->friendly_name = $var; + + return $this; + } + + /** + * User provided description. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User provided description. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Cloud SQL properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + * @return \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties|null + */ + public function getCloudSql() + { + return $this->readOneof(4); + } + + public function hasCloudSql() + { + return $this->hasOneof(4); + } + + /** + * Cloud SQL properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + * @param \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties $var + * @return $this + */ + public function setCloudSql($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Amazon Web Services (AWS) properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsProperties aws = 8; + * @return \Google\Cloud\BigQuery\Connection\V1\AwsProperties|null + */ + public function getAws() + { + return $this->readOneof(8); + } + + public function hasAws() + { + return $this->hasOneof(8); + } + + /** + * Amazon Web Services (AWS) properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsProperties aws = 8; + * @param \Google\Cloud\BigQuery\Connection\V1\AwsProperties $var + * @return $this + */ + public function setAws($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsProperties::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Azure properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AzureProperties azure = 11; + * @return \Google\Cloud\BigQuery\Connection\V1\AzureProperties|null + */ + public function getAzure() + { + return $this->readOneof(11); + } + + public function hasAzure() + { + return $this->hasOneof(11); + } + + /** + * Azure properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AzureProperties azure = 11; + * @param \Google\Cloud\BigQuery\Connection\V1\AzureProperties $var + * @return $this + */ + public function setAzure($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AzureProperties::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Cloud Spanner properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSpannerProperties cloud_spanner = 21; + * @return \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties|null + */ + public function getCloudSpanner() + { + return $this->readOneof(21); + } + + public function hasCloudSpanner() + { + return $this->hasOneof(21); + } + + /** + * Cloud Spanner properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSpannerProperties cloud_spanner = 21; + * @param \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties $var + * @return $this + */ + public function setCloudSpanner($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties::class); + $this->writeOneof(21, $var); + + return $this; + } + + /** + * Cloud Resource properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudResourceProperties cloud_resource = 22; + * @return \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties|null + */ + public function getCloudResource() + { + return $this->readOneof(22); + } + + public function hasCloudResource() + { + return $this->hasOneof(22); + } + + /** + * Cloud Resource properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudResourceProperties cloud_resource = 22; + * @param \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties $var + * @return $this + */ + public function setCloudResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * Spark properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.SparkProperties spark = 23; + * @return \Google\Cloud\BigQuery\Connection\V1\SparkProperties|null + */ + public function getSpark() + { + return $this->readOneof(23); + } + + public function hasSpark() + { + return $this->hasOneof(23); + } + + /** + * Spark properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.SparkProperties spark = 23; + * @param \Google\Cloud\BigQuery\Connection\V1\SparkProperties $var + * @return $this + */ + public function setSpark($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\SparkProperties::class); + $this->writeOneof(23, $var); + + return $this; + } + + /** + * Optional. Salesforce DataCloud properties. This field is intended for + * use only by Salesforce partner projects. This field contains properties + * for your Salesforce DataCloud connection. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.SalesforceDataCloudProperties salesforce_data_cloud = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\Connection\V1\SalesforceDataCloudProperties|null + */ + public function getSalesforceDataCloud() + { + return $this->readOneof(24); + } + + public function hasSalesforceDataCloud() + { + return $this->hasOneof(24); + } + + /** + * Optional. Salesforce DataCloud properties. This field is intended for + * use only by Salesforce partner projects. This field contains properties + * for your Salesforce DataCloud connection. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.SalesforceDataCloudProperties salesforce_data_cloud = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\Connection\V1\SalesforceDataCloudProperties $var + * @return $this + */ + public function setSalesforceDataCloud($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\SalesforceDataCloudProperties::class); + $this->writeOneof(24, $var); + + return $this; + } + + /** + * Output only. The creation timestamp of the connection. + * + * Generated from protobuf field int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getCreationTime() + { + return $this->creation_time; + } + + /** + * Output only. The creation timestamp of the connection. + * + * Generated from protobuf field int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setCreationTime($var) + { + GPBUtil::checkInt64($var); + $this->creation_time = $var; + + return $this; + } + + /** + * Output only. The last update timestamp of the connection. + * + * Generated from protobuf field int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getLastModifiedTime() + { + return $this->last_modified_time; + } + + /** + * Output only. The last update timestamp of the connection. + * + * Generated from protobuf field int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setLastModifiedTime($var) + { + GPBUtil::checkInt64($var); + $this->last_modified_time = $var; + + return $this; + } + + /** + * Output only. True, if credential is configured for this connection. + * + * Generated from protobuf field bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getHasCredential() + { + return $this->has_credential; + } + + /** + * Output only. True, if credential is configured for this connection. + * + * Generated from protobuf field bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setHasCredential($var) + { + GPBUtil::checkBool($var); + $this->has_credential = $var; + + return $this; + } + + /** + * @return string + */ + public function getProperties() + { + return $this->whichOneof("properties"); + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CreateConnectionRequest.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CreateConnectionRequest.php new file mode 100644 index 000000000000..444204a15db6 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CreateConnectionRequest.php @@ -0,0 +1,169 @@ +google.cloud.bigquery.connection.v1.CreateConnectionRequest + */ +class CreateConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent resource name. + * Must be in the format `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Connection id that should be assigned to the created connection. + * + * Generated from protobuf field string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $connection_id = ''; + /** + * Required. Connection to create. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $connection = null; + + /** + * @param string $parent Required. Parent resource name. + * Must be in the format `projects/{project_id}/locations/{location_id}` + * Please see {@see ConnectionServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\Connection\V1\Connection $connection Required. Connection to create. + * @param string $connectionId Optional. Connection id that should be assigned to the created connection. + * + * @return \Google\Cloud\BigQuery\Connection\V1\CreateConnectionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\Connection\V1\Connection $connection, string $connectionId): self + { + return (new self()) + ->setParent($parent) + ->setConnection($connection) + ->setConnectionId($connectionId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent resource name. + * Must be in the format `projects/{project_id}/locations/{location_id}` + * @type string $connection_id + * Optional. Connection id that should be assigned to the created connection. + * @type \Google\Cloud\BigQuery\Connection\V1\Connection $connection + * Required. Connection to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent resource name. + * Must be in the format `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent resource name. + * Must be in the format `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Connection id that should be assigned to the created connection. + * + * Generated from protobuf field string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getConnectionId() + { + return $this->connection_id; + } + + /** + * Optional. Connection id that should be assigned to the created connection. + * + * Generated from protobuf field string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setConnectionId($var) + { + GPBUtil::checkString($var, True); + $this->connection_id = $var; + + return $this; + } + + /** + * Required. Connection to create. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\Connection\V1\Connection|null + */ + public function getConnection() + { + return $this->connection; + } + + public function hasConnection() + { + return isset($this->connection); + } + + public function clearConnection() + { + unset($this->connection); + } + + /** + * Required. Connection to create. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\Connection\V1\Connection $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\Connection::class); + $this->connection = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/DeleteConnectionRequest.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/DeleteConnectionRequest.php new file mode 100644 index 000000000000..8c912391fd91 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/DeleteConnectionRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.connection.v1.DeleteConnectionRequest + */ +class DeleteConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the deleted connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the deleted connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * Please see {@see ConnectionServiceClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Connection\V1\DeleteConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the deleted connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the deleted connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the deleted connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/GetConnectionRequest.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/GetConnectionRequest.php new file mode 100644 index 000000000000..cbd405870a93 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/GetConnectionRequest.php @@ -0,0 +1,87 @@ +google.cloud.bigquery.connection.v1.GetConnectionRequest + */ +class GetConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the requested connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the requested connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * Please see {@see ConnectionServiceClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Connection\V1\GetConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the requested connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the requested connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the requested connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsRequest.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsRequest.php new file mode 100644 index 000000000000..f2b7e3b5136d --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsRequest.php @@ -0,0 +1,155 @@ +google.cloud.bigquery.connection.v1.ListConnectionsRequest + */ +class ListConnectionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent resource name. + * Must be in the form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Page size. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $page_size = 0; + /** + * Page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Parent resource name. + * Must be in the form: `projects/{project_id}/locations/{location_id}` + * Please see {@see ConnectionServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Connection\V1\ListConnectionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent resource name. + * Must be in the form: `projects/{project_id}/locations/{location_id}` + * @type int $page_size + * Required. Page size. + * @type string $page_token + * Page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent resource name. + * Must be in the form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent resource name. + * Must be in the form: `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Page size. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Required. Page size. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsResponse.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsResponse.php new file mode 100644 index 000000000000..8039d6aeb66d --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsResponse.php @@ -0,0 +1,102 @@ +google.cloud.bigquery.connection.v1.ListConnectionsResponse + */ +class ListConnectionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 1; + */ + protected $next_page_token = ''; + /** + * List of connections. + * + * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + private $connections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $next_page_token + * Next page token. + * @type array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $connections + * List of connections. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 1; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 1; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * List of connections. + * + * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConnections() + { + return $this->connections; + } + + /** + * List of connections. + * + * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + * @param array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Connection\V1\Connection::class); + $this->connections = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/MetastoreServiceConfig.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/MetastoreServiceConfig.php new file mode 100644 index 000000000000..ffc140b0c99c --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/MetastoreServiceConfig.php @@ -0,0 +1,75 @@ +google.cloud.bigquery.connection.v1.MetastoreServiceConfig + */ +class MetastoreServiceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Resource name of an existing Dataproc Metastore service. + * Example: + * * `projects/[project_id]/locations/[region]/services/[service_id]` + * + * Generated from protobuf field string metastore_service = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $metastore_service = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $metastore_service + * Optional. Resource name of an existing Dataproc Metastore service. + * Example: + * * `projects/[project_id]/locations/[region]/services/[service_id]` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Resource name of an existing Dataproc Metastore service. + * Example: + * * `projects/[project_id]/locations/[region]/services/[service_id]` + * + * Generated from protobuf field string metastore_service = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getMetastoreService() + { + return $this->metastore_service; + } + + /** + * Optional. Resource name of an existing Dataproc Metastore service. + * Example: + * * `projects/[project_id]/locations/[region]/services/[service_id]` + * + * Generated from protobuf field string metastore_service = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setMetastoreService($var) + { + GPBUtil::checkString($var, True); + $this->metastore_service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/SalesforceDataCloudProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/SalesforceDataCloudProperties.php new file mode 100644 index 000000000000..96554aba2f5c --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/SalesforceDataCloudProperties.php @@ -0,0 +1,140 @@ +google.cloud.bigquery.connection.v1.SalesforceDataCloudProperties + */ +class SalesforceDataCloudProperties extends \Google\Protobuf\Internal\Message +{ + /** + * The URL to the user's Salesforce DataCloud instance. + * + * Generated from protobuf field string instance_uri = 1; + */ + protected $instance_uri = ''; + /** + * Output only. A unique Google-owned and Google-generated service account + * identity for the connection. + * + * Generated from protobuf field string identity = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $identity = ''; + /** + * The ID of the user's Salesforce tenant. + * + * Generated from protobuf field string tenant_id = 3; + */ + protected $tenant_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_uri + * The URL to the user's Salesforce DataCloud instance. + * @type string $identity + * Output only. A unique Google-owned and Google-generated service account + * identity for the connection. + * @type string $tenant_id + * The ID of the user's Salesforce tenant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * The URL to the user's Salesforce DataCloud instance. + * + * Generated from protobuf field string instance_uri = 1; + * @return string + */ + public function getInstanceUri() + { + return $this->instance_uri; + } + + /** + * The URL to the user's Salesforce DataCloud instance. + * + * Generated from protobuf field string instance_uri = 1; + * @param string $var + * @return $this + */ + public function setInstanceUri($var) + { + GPBUtil::checkString($var, True); + $this->instance_uri = $var; + + return $this; + } + + /** + * Output only. A unique Google-owned and Google-generated service account + * identity for the connection. + * + * Generated from protobuf field string identity = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIdentity() + { + return $this->identity; + } + + /** + * Output only. A unique Google-owned and Google-generated service account + * identity for the connection. + * + * Generated from protobuf field string identity = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIdentity($var) + { + GPBUtil::checkString($var, True); + $this->identity = $var; + + return $this; + } + + /** + * The ID of the user's Salesforce tenant. + * + * Generated from protobuf field string tenant_id = 3; + * @return string + */ + public function getTenantId() + { + return $this->tenant_id; + } + + /** + * The ID of the user's Salesforce tenant. + * + * Generated from protobuf field string tenant_id = 3; + * @param string $var + * @return $this + */ + public function setTenantId($var) + { + GPBUtil::checkString($var, True); + $this->tenant_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/SparkHistoryServerConfig.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/SparkHistoryServerConfig.php new file mode 100644 index 000000000000..cc00cd0d8cb8 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/SparkHistoryServerConfig.php @@ -0,0 +1,79 @@ +google.cloud.bigquery.connection.v1.SparkHistoryServerConfig + */ +class SparkHistoryServerConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Resource name of an existing Dataproc Cluster to act as a Spark + * History Server for the connection. + * Example: + * * `projects/[project_id]/regions/[region]/clusters/[cluster_name]` + * + * Generated from protobuf field string dataproc_cluster = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $dataproc_cluster = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataproc_cluster + * Optional. Resource name of an existing Dataproc Cluster to act as a Spark + * History Server for the connection. + * Example: + * * `projects/[project_id]/regions/[region]/clusters/[cluster_name]` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Resource name of an existing Dataproc Cluster to act as a Spark + * History Server for the connection. + * Example: + * * `projects/[project_id]/regions/[region]/clusters/[cluster_name]` + * + * Generated from protobuf field string dataproc_cluster = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getDataprocCluster() + { + return $this->dataproc_cluster; + } + + /** + * Optional. Resource name of an existing Dataproc Cluster to act as a Spark + * History Server for the connection. + * Example: + * * `projects/[project_id]/regions/[region]/clusters/[cluster_name]` + * + * Generated from protobuf field string dataproc_cluster = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataprocCluster($var) + { + GPBUtil::checkString($var, True); + $this->dataproc_cluster = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/SparkProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/SparkProperties.php new file mode 100644 index 000000000000..8c3e21da8ebb --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/SparkProperties.php @@ -0,0 +1,188 @@ +google.cloud.bigquery.connection.v1.SparkProperties + */ +class SparkProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The account ID of the service created for the purpose of this + * connection. + * The service account does not have any permissions associated with it when + * it is created. After creation, customers delegate permissions to the + * service account. When the connection is used in the context of a stored + * procedure for Apache Spark in BigQuery, the service account is used to + * connect to the desired resources in Google Cloud. + * The account ID is in the form of: + * bqcx--@gcp-sa-bigquery-consp.iam.gserviceaccount.com + * + * Generated from protobuf field string service_account_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $service_account_id = ''; + /** + * Optional. Dataproc Metastore Service configuration for the connection. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.MetastoreServiceConfig metastore_service_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metastore_service_config = null; + /** + * Optional. Spark History Server configuration for the connection. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.SparkHistoryServerConfig spark_history_server_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $spark_history_server_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account_id + * Output only. The account ID of the service created for the purpose of this + * connection. + * The service account does not have any permissions associated with it when + * it is created. After creation, customers delegate permissions to the + * service account. When the connection is used in the context of a stored + * procedure for Apache Spark in BigQuery, the service account is used to + * connect to the desired resources in Google Cloud. + * The account ID is in the form of: + * bqcx--@gcp-sa-bigquery-consp.iam.gserviceaccount.com + * @type \Google\Cloud\BigQuery\Connection\V1\MetastoreServiceConfig $metastore_service_config + * Optional. Dataproc Metastore Service configuration for the connection. + * @type \Google\Cloud\BigQuery\Connection\V1\SparkHistoryServerConfig $spark_history_server_config + * Optional. Spark History Server configuration for the connection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The account ID of the service created for the purpose of this + * connection. + * The service account does not have any permissions associated with it when + * it is created. After creation, customers delegate permissions to the + * service account. When the connection is used in the context of a stored + * procedure for Apache Spark in BigQuery, the service account is used to + * connect to the desired resources in Google Cloud. + * The account ID is in the form of: + * bqcx--@gcp-sa-bigquery-consp.iam.gserviceaccount.com + * + * Generated from protobuf field string service_account_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAccountId() + { + return $this->service_account_id; + } + + /** + * Output only. The account ID of the service created for the purpose of this + * connection. + * The service account does not have any permissions associated with it when + * it is created. After creation, customers delegate permissions to the + * service account. When the connection is used in the context of a stored + * procedure for Apache Spark in BigQuery, the service account is used to + * connect to the desired resources in Google Cloud. + * The account ID is in the form of: + * bqcx--@gcp-sa-bigquery-consp.iam.gserviceaccount.com + * + * Generated from protobuf field string service_account_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAccountId($var) + { + GPBUtil::checkString($var, True); + $this->service_account_id = $var; + + return $this; + } + + /** + * Optional. Dataproc Metastore Service configuration for the connection. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.MetastoreServiceConfig metastore_service_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\Connection\V1\MetastoreServiceConfig|null + */ + public function getMetastoreServiceConfig() + { + return $this->metastore_service_config; + } + + public function hasMetastoreServiceConfig() + { + return isset($this->metastore_service_config); + } + + public function clearMetastoreServiceConfig() + { + unset($this->metastore_service_config); + } + + /** + * Optional. Dataproc Metastore Service configuration for the connection. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.MetastoreServiceConfig metastore_service_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\Connection\V1\MetastoreServiceConfig $var + * @return $this + */ + public function setMetastoreServiceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\MetastoreServiceConfig::class); + $this->metastore_service_config = $var; + + return $this; + } + + /** + * Optional. Spark History Server configuration for the connection. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.SparkHistoryServerConfig spark_history_server_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\Connection\V1\SparkHistoryServerConfig|null + */ + public function getSparkHistoryServerConfig() + { + return $this->spark_history_server_config; + } + + public function hasSparkHistoryServerConfig() + { + return isset($this->spark_history_server_config); + } + + public function clearSparkHistoryServerConfig() + { + unset($this->spark_history_server_config); + } + + /** + * Optional. Spark History Server configuration for the connection. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.SparkHistoryServerConfig spark_history_server_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\Connection\V1\SparkHistoryServerConfig $var + * @return $this + */ + public function setSparkHistoryServerConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\SparkHistoryServerConfig::class); + $this->spark_history_server_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/UpdateConnectionRequest.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/UpdateConnectionRequest.php new file mode 100644 index 000000000000..21c323c829fa --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/UpdateConnectionRequest.php @@ -0,0 +1,179 @@ +google.cloud.bigquery.connection.v1.UpdateConnectionRequest + */ +class UpdateConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. Connection containing the updated fields. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $connection = null; + /** + * Required. Update mask for the connection fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param string $name Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * Please see {@see ConnectionServiceClient::connectionName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\Connection\V1\Connection $connection Required. Connection containing the updated fields. + * @param \Google\Protobuf\FieldMask $updateMask Required. Update mask for the connection fields to be updated. + * + * @return \Google\Cloud\BigQuery\Connection\V1\UpdateConnectionRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\BigQuery\Connection\V1\Connection $connection, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setName($name) + ->setConnection($connection) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @type \Google\Cloud\BigQuery\Connection\V1\Connection $connection + * Required. Connection containing the updated fields. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Update mask for the connection fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Connection containing the updated fields. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\Connection\V1\Connection|null + */ + public function getConnection() + { + return $this->connection; + } + + public function hasConnection() + { + return isset($this->connection); + } + + public function clearConnection() + { + unset($this->connection); + } + + /** + * Required. Connection containing the updated fields. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\Connection\V1\Connection $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\Connection::class); + $this->connection = $var; + + return $this; + } + + /** + * Required. Update mask for the connection fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Update mask for the connection fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/create_connection.php b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/create_connection.php new file mode 100644 index 000000000000..98de64cb0e63 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/create_connection.php @@ -0,0 +1,74 @@ +setParent($formattedParent) + ->setConnection($connection); + + // Call the API and handle any network failures. + try { + /** @var Connection $response */ + $response = $connectionServiceClient->createConnection($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConnectionServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + create_connection_sample($formattedParent); +} +// [END bigqueryconnection_v1_generated_ConnectionService_CreateConnection_sync] diff --git a/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/delete_connection.php b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/delete_connection.php new file mode 100644 index 000000000000..cbe881ff8807 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/delete_connection.php @@ -0,0 +1,70 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $connectionServiceClient->deleteConnection($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConnectionServiceClient::connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + + delete_connection_sample($formattedName); +} +// [END bigqueryconnection_v1_generated_ConnectionService_DeleteConnection_sync] diff --git a/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/get_connection.php b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/get_connection.php new file mode 100644 index 000000000000..831921fe59ec --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/get_connection.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Connection $response */ + $response = $connectionServiceClient->getConnection($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConnectionServiceClient::connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + + get_connection_sample($formattedName); +} +// [END bigqueryconnection_v1_generated_ConnectionService_GetConnection_sync] diff --git a/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/get_iam_policy.php b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..53aee56c0402 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/get_iam_policy.php @@ -0,0 +1,73 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $connectionServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END bigqueryconnection_v1_generated_ConnectionService_GetIamPolicy_sync] diff --git a/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/list_connections.php b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/list_connections.php new file mode 100644 index 000000000000..091267c7cd4b --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/list_connections.php @@ -0,0 +1,82 @@ +setParent($formattedParent) + ->setPageSize($pageSize); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $connectionServiceClient->listConnections($request); + + /** @var Connection $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConnectionServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $pageSize = 0; + + list_connections_sample($formattedParent, $pageSize); +} +// [END bigqueryconnection_v1_generated_ConnectionService_ListConnections_sync] diff --git a/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/set_iam_policy.php b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..ef729bbf6995 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/set_iam_policy.php @@ -0,0 +1,76 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $connectionServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END bigqueryconnection_v1_generated_ConnectionService_SetIamPolicy_sync] diff --git a/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/test_iam_permissions.php b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..0541de4552dc --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $connectionServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END bigqueryconnection_v1_generated_ConnectionService_TestIamPermissions_sync] diff --git a/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/update_connection.php b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/update_connection.php new file mode 100644 index 000000000000..bd37bfe621a1 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/samples/V1/ConnectionServiceClient/update_connection.php @@ -0,0 +1,78 @@ +setName($formattedName) + ->setConnection($connection) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Connection $response */ + $response = $connectionServiceClient->updateConnection($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConnectionServiceClient::connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + + update_connection_sample($formattedName); +} +// [END bigqueryconnection_v1_generated_ConnectionService_UpdateConnection_sync] diff --git a/owl-bot-staging/BigQueryConnection/v1/src/V1/Client/ConnectionServiceClient.php b/owl-bot-staging/BigQueryConnection/v1/src/V1/Client/ConnectionServiceClient.php new file mode 100644 index 000000000000..c1c856e11eb7 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/src/V1/Client/ConnectionServiceClient.php @@ -0,0 +1,511 @@ + createConnectionAsync(CreateConnectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteConnectionAsync(DeleteConnectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConnectionAsync(GetConnectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConnectionsAsync(ListConnectionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateConnectionAsync(UpdateConnectionRequest $request, array $optionalArgs = []) + */ +final class ConnectionServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.bigquery.connection.v1.ConnectionService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'bigqueryconnection.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'bigqueryconnection.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/connection_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/connection_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/connection_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/connection_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a cluster + * resource. + * + * @param string $project + * @param string $region + * @param string $cluster + * + * @return string The formatted cluster resource. + */ + public static function clusterName(string $project, string $region, string $cluster): string + { + return self::getPathTemplate('cluster')->render([ + 'project' => $project, + 'region' => $region, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a connection + * resource. + * + * @param string $project + * @param string $location + * @param string $connection + * + * @return string The formatted connection resource. + */ + public static function connectionName(string $project, string $location, string $connection): string + { + return self::getPathTemplate('connection')->render([ + 'project' => $project, + 'location' => $location, + 'connection' => $connection, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName(string $project, string $location, string $service): string + { + return self::getPathTemplate('service')->render([ + 'project' => $project, + 'location' => $location, + '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 + * - cluster: projects/{project}/regions/{region}/clusters/{cluster} + * - connection: projects/{project}/locations/{location}/connections/{connection} + * - location: projects/{project}/locations/{location} + * - service: projects/{project}/locations/{location}/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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'bigqueryconnection.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new connection. + * + * The async variant is {@see ConnectionServiceClient::createConnectionAsync()} . + * + * @example samples/V1/ConnectionServiceClient/create_connection.php + * + * @param CreateConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Connection + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConnection(CreateConnectionRequest $request, array $callOptions = []): Connection + { + return $this->startApiCall('CreateConnection', $request, $callOptions)->wait(); + } + + /** + * Deletes connection and associated credential. + * + * The async variant is {@see ConnectionServiceClient::deleteConnectionAsync()} . + * + * @example samples/V1/ConnectionServiceClient/delete_connection.php + * + * @param DeleteConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConnection(DeleteConnectionRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteConnection', $request, $callOptions)->wait(); + } + + /** + * Returns specified connection. + * + * The async variant is {@see ConnectionServiceClient::getConnectionAsync()} . + * + * @example samples/V1/ConnectionServiceClient/get_connection.php + * + * @param GetConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Connection + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConnection(GetConnectionRequest $request, array $callOptions = []): Connection + { + return $this->startApiCall('GetConnection', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. + * Returns an empty policy if the resource exists and does not have a policy + * set. + * + * The async variant is {@see ConnectionServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/ConnectionServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns a list of connections in the given project. + * + * The async variant is {@see ConnectionServiceClient::listConnectionsAsync()} . + * + * @example samples/V1/ConnectionServiceClient/list_connections.php + * + * @param ListConnectionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConnections(ListConnectionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConnections', $request, $callOptions); + } + + /** + * Sets the access control policy on the specified resource. Replaces any + * existing policy. + * + * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + * The async variant is {@see ConnectionServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/ConnectionServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * If the resource does not exist, this will return an empty set of + * permissions, not a `NOT_FOUND` error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + * + * The async variant is {@see ConnectionServiceClient::testIamPermissionsAsync()} . + * + * @example samples/V1/ConnectionServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates the specified connection. For security reasons, also resets + * credential if connection properties are in the update field mask. + * + * The async variant is {@see ConnectionServiceClient::updateConnectionAsync()} . + * + * @example samples/V1/ConnectionServiceClient/update_connection.php + * + * @param UpdateConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Connection + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateConnection(UpdateConnectionRequest $request, array $callOptions = []): Connection + { + return $this->startApiCall('UpdateConnection', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BigQueryConnection/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BigQueryConnection/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..184acd74f36e --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/src/V1/gapic_metadata.json @@ -0,0 +1,58 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.bigquery.connection.v1", + "libraryPackage": "Google\\Cloud\\BigQuery\\Connection\\V1", + "services": { + "ConnectionService": { + "clients": { + "grpc": { + "libraryClient": "ConnectionServiceGapicClient", + "rpcs": { + "CreateConnection": { + "methods": [ + "createConnection" + ] + }, + "DeleteConnection": { + "methods": [ + "deleteConnection" + ] + }, + "GetConnection": { + "methods": [ + "getConnection" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "ListConnections": { + "methods": [ + "listConnections" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateConnection": { + "methods": [ + "updateConnection" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_client_config.json b/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_client_config.json new file mode 100644 index 000000000000..31abd111ed39 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_client_config.json @@ -0,0 +1,85 @@ +{ + "interfaces": { + "google.cloud.bigquery.connection.v1.ConnectionService": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteConnection": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConnection": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListConnections": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_descriptor_config.php b/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_descriptor_config.php new file mode 100644 index 000000000000..cde4430f8eda --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_descriptor_config.php @@ -0,0 +1,138 @@ + [ + 'google.cloud.bigquery.connection.v1.ConnectionService' => [ + 'CreateConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Connection\V1\Connection', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Connection\V1\Connection', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'ListConnections' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConnections', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Connection\V1\ListConnectionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Connection\V1\Connection', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'cluster' => 'projects/{project}/regions/{region}/clusters/{cluster}', + 'connection' => 'projects/{project}/locations/{location}/connections/{connection}', + 'location' => 'projects/{project}/locations/{location}', + 'service' => 'projects/{project}/locations/{location}/services/{service}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_rest_client_config.php b/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_rest_client_config.php new file mode 100644 index 000000000000..31ae1178ae30 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_rest_client_config.php @@ -0,0 +1,128 @@ + [ + 'google.cloud.bigquery.connection.v1.ConnectionService' => [ + 'CreateConnection' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/connections', + 'body' => 'connection', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConnection' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/connections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConnection' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/connections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/connections/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'ListConnections' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/connections', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'page_size', + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/connections/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/connections/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateConnection' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/connections/*}', + 'body' => 'connection', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/BigQueryConnection/v1/tests/Unit/V1/Client/ConnectionServiceClientTest.php b/owl-bot-staging/BigQueryConnection/v1/tests/Unit/V1/Client/ConnectionServiceClientTest.php new file mode 100644 index 000000000000..f7f488f16614 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/tests/Unit/V1/Client/ConnectionServiceClientTest.php @@ -0,0 +1,702 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ConnectionServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ConnectionServiceClient($options); + } + + /** @test */ + public function createConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnection($connection); + $response = $gapicClient->createConnection($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/CreateConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnection($connection); + try { + $gapicClient->createConnection($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new DeleteConnectionRequest()) + ->setName($formattedName); + $gapicClient->deleteConnection($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/DeleteConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new DeleteConnectionRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteConnection($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new GetConnectionRequest()) + ->setName($formattedName); + $response = $gapicClient->getConnection($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/GetConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new GetConnectionRequest()) + ->setName($formattedName); + try { + $gapicClient->getConnection($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $connectionsElement = new Connection(); + $connections = [ + $connectionsElement, + ]; + $expectedResponse = new ListConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConnections($connections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $pageSize = 883849137; + $request = (new ListConnectionsRequest()) + ->setParent($formattedParent) + ->setPageSize($pageSize); + $response = $gapicClient->listConnections($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConnections()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/ListConnections', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getPageSize(); + $this->assertProtobufEquals($pageSize, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConnectionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $pageSize = 883849137; + $request = (new ListConnectionsRequest()) + ->setParent($formattedParent) + ->setPageSize($pageSize); + try { + $gapicClient->listConnections($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $updateMask = new FieldMask(); + $request = (new UpdateConnectionRequest()) + ->setName($formattedName) + ->setConnection($connection) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateConnection($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/UpdateConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $updateMask = new FieldMask(); + $request = (new UpdateConnectionRequest()) + ->setName($formattedName) + ->setConnection($connection) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateConnection($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConnectionAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnection($connection); + $response = $gapicClient->createConnectionAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/CreateConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Dataexchange/V1Beta1/Dataexchange.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Dataexchange/V1Beta1/Dataexchange.php new file mode 100644 index 000000000000..50488f80095d Binary files /dev/null and b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Dataexchange/V1Beta1/Dataexchange.php differ diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/CreateDataExchangeRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/CreateDataExchangeRequest.php new file mode 100644 index 000000000000..09056571a3e0 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/CreateDataExchangeRequest.php @@ -0,0 +1,182 @@ +google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + */ +class CreateDataExchangeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ID of the data exchange. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_exchange_id = ''; + /** + * Required. The data exchange to create. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_exchange = null; + + /** + * @param string $parent Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. Please see + * {@see AnalyticsHubServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange $dataExchange Required. The data exchange to create. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\CreateDataExchangeRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange $dataExchange): self + { + return (new self()) + ->setParent($parent) + ->setDataExchange($dataExchange); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. + * @type string $data_exchange_id + * Required. The ID of the data exchange. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * @type \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange $data_exchange + * Required. The data exchange to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The ID of the data exchange. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataExchangeId() + { + return $this->data_exchange_id; + } + + /** + * Required. The ID of the data exchange. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataExchangeId($var) + { + GPBUtil::checkString($var, True); + $this->data_exchange_id = $var; + + return $this; + } + + /** + * Required. The data exchange to create. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange|null + */ + public function getDataExchange() + { + return $this->data_exchange; + } + + public function hasDataExchange() + { + return isset($this->data_exchange); + } + + public function clearDataExchange() + { + unset($this->data_exchange); + } + + /** + * Required. The data exchange to create. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange $var + * @return $this + */ + public function setDataExchange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange::class); + $this->data_exchange = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/CreateListingRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/CreateListingRequest.php new file mode 100644 index 000000000000..185295f4c739 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/CreateListingRequest.php @@ -0,0 +1,182 @@ +google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + */ +class CreateListingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ID of the listing to create. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $listing_id = ''; + /** + * Required. The listing to create. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $listing = null; + + /** + * @param string $parent Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. Please see + * {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing $listing Required. The listing to create. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\CreateListingRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing $listing): self + { + return (new self()) + ->setParent($parent) + ->setListing($listing); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @type string $listing_id + * Required. The ID of the listing to create. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * @type \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing $listing + * Required. The listing to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The ID of the listing to create. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getListingId() + { + return $this->listing_id; + } + + /** + * Required. The ID of the listing to create. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * + * Generated from protobuf field string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setListingId($var) + { + GPBUtil::checkString($var, True); + $this->listing_id = $var; + + return $this; + } + + /** + * Required. The listing to create. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing|null + */ + public function getListing() + { + return $this->listing; + } + + public function hasListing() + { + return isset($this->listing); + } + + public function clearListing() + { + unset($this->listing); + } + + /** + * Required. The listing to create. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing $var + * @return $this + */ + public function setListing($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing::class); + $this->listing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DataExchange.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DataExchange.php new file mode 100644 index 000000000000..6e9c67d93f21 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DataExchange.php @@ -0,0 +1,329 @@ +google.cloud.bigquery.dataexchange.v1beta1.DataExchange + */ +class DataExchange extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. Human-readable display name of the data exchange. The display name must + * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), + * spaces ( ), ampersands (&) and must not start or end with spaces. + * Default value is an empty string. + * Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. Description of the data exchange. The description must not contain Unicode + * non-characters as well as C0 and C1 control codes except tabs (HT), + * new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Email or URL of the primary point of contact of the data exchange. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $primary_contact = ''; + /** + * Optional. Documentation describing the data exchange. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $documentation = ''; + /** + * Output only. Number of listings contained in the data exchange. + * + * Generated from protobuf field int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $listing_count = 0; + /** + * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the content of the fields are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $icon = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @type string $display_name + * Required. Human-readable display name of the data exchange. The display name must + * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), + * spaces ( ), ampersands (&) and must not start or end with spaces. + * Default value is an empty string. + * Max length: 63 bytes. + * @type string $description + * Optional. Description of the data exchange. The description must not contain Unicode + * non-characters as well as C0 and C1 control codes except tabs (HT), + * new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * @type string $primary_contact + * Optional. Email or URL of the primary point of contact of the data exchange. + * Max Length: 1000 bytes. + * @type string $documentation + * Optional. Documentation describing the data exchange. + * @type int $listing_count + * Output only. Number of listings contained in the data exchange. + * @type string $icon + * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the content of the fields are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Human-readable display name of the data exchange. The display name must + * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), + * spaces ( ), ampersands (&) and must not start or end with spaces. + * Default value is an empty string. + * Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. Human-readable display name of the data exchange. The display name must + * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), + * spaces ( ), ampersands (&) and must not start or end with spaces. + * Default value is an empty string. + * Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. Description of the data exchange. The description must not contain Unicode + * non-characters as well as C0 and C1 control codes except tabs (HT), + * new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of the data exchange. The description must not contain Unicode + * non-characters as well as C0 and C1 control codes except tabs (HT), + * new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Email or URL of the primary point of contact of the data exchange. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPrimaryContact() + { + return $this->primary_contact; + } + + /** + * Optional. Email or URL of the primary point of contact of the data exchange. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPrimaryContact($var) + { + GPBUtil::checkString($var, True); + $this->primary_contact = $var; + + return $this; + } + + /** + * Optional. Documentation describing the data exchange. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDocumentation() + { + return $this->documentation; + } + + /** + * Optional. Documentation describing the data exchange. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDocumentation($var) + { + GPBUtil::checkString($var, True); + $this->documentation = $var; + + return $this; + } + + /** + * Output only. Number of listings contained in the data exchange. + * + * Generated from protobuf field int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getListingCount() + { + return $this->listing_count; + } + + /** + * Output only. Number of listings contained in the data exchange. + * + * Generated from protobuf field int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setListingCount($var) + { + GPBUtil::checkInt32($var); + $this->listing_count = $var; + + return $this; + } + + /** + * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the content of the fields are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getIcon() + { + return $this->icon; + } + + /** + * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the content of the fields are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setIcon($var) + { + GPBUtil::checkString($var, False); + $this->icon = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DataProvider.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DataProvider.php new file mode 100644 index 000000000000..a84fe678974c --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DataProvider.php @@ -0,0 +1,105 @@ +google.cloud.bigquery.dataexchange.v1beta1.DataProvider + */ +class DataProvider extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the data provider. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. Email or URL of the data provider. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $primary_contact = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. Name of the data provider. + * @type string $primary_contact + * Optional. Email or URL of the data provider. + * Max Length: 1000 bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the data provider. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Name of the data provider. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Email or URL of the data provider. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPrimaryContact() + { + return $this->primary_contact; + } + + /** + * Optional. Email or URL of the data provider. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPrimaryContact($var) + { + GPBUtil::checkString($var, True); + $this->primary_contact = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DeleteDataExchangeRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DeleteDataExchangeRequest.php new file mode 100644 index 000000000000..a51e62da4faf --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DeleteDataExchangeRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + */ +class DeleteDataExchangeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the data exchange resource that you want to delete. + * For example, `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the data exchange resource that you want to delete. + * For example, `projects/myproject/locations/US/dataExchanges/123`. Please see + * {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\DeleteDataExchangeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the data exchange resource that you want to delete. + * For example, `projects/myproject/locations/US/dataExchanges/123`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the data exchange resource that you want to delete. + * For example, `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full name of the data exchange resource that you want to delete. + * For example, `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DeleteListingRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DeleteListingRequest.php new file mode 100644 index 000000000000..3a38544c15a9 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DeleteListingRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + */ +class DeleteListingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. Please see + * {@see AnalyticsHubServiceClient::listingName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\DeleteListingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DestinationDataset.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DestinationDataset.php new file mode 100644 index 000000000000..5cdedbec98c6 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DestinationDataset.php @@ -0,0 +1,311 @@ +google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + */ +class DestinationDataset extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A reference that identifies the destination dataset. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset_reference = null; + /** + * Optional. A descriptive name for the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $friendly_name = null; + /** + * Optional. A user-friendly description of the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = null; + /** + * Optional. The labels associated with this dataset. You can use these + * to organize and group your datasets. + * You can set this property when inserting or updating a dataset. + * See https://cloud.google.com/resource-manager/docs/creating-managing-labels + * for more information. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. The geographic location where the dataset should reside. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * + * Generated from protobuf field string location = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $location = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\DataExchange\V1beta1\DestinationDatasetReference $dataset_reference + * Required. A reference that identifies the destination dataset. + * @type \Google\Protobuf\StringValue $friendly_name + * Optional. A descriptive name for the dataset. + * @type \Google\Protobuf\StringValue $description + * Optional. A user-friendly description of the dataset. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels associated with this dataset. You can use these + * to organize and group your datasets. + * You can set this property when inserting or updating a dataset. + * See https://cloud.google.com/resource-manager/docs/creating-managing-labels + * for more information. + * @type string $location + * Required. The geographic location where the dataset should reside. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. A reference that identifies the destination dataset. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\DestinationDatasetReference|null + */ + public function getDatasetReference() + { + return $this->dataset_reference; + } + + public function hasDatasetReference() + { + return isset($this->dataset_reference); + } + + public function clearDatasetReference() + { + unset($this->dataset_reference); + } + + /** + * Required. A reference that identifies the destination dataset. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\DestinationDatasetReference $var + * @return $this + */ + public function setDatasetReference($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataExchange\V1beta1\DestinationDatasetReference::class); + $this->dataset_reference = $var; + + return $this; + } + + /** + * Optional. A descriptive name for the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\StringValue|null + */ + public function getFriendlyName() + { + return $this->friendly_name; + } + + public function hasFriendlyName() + { + return isset($this->friendly_name); + } + + public function clearFriendlyName() + { + unset($this->friendly_name); + } + + /** + * Returns the unboxed value from getFriendlyName() + + * Optional. A descriptive name for the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string|null + */ + public function getFriendlyNameUnwrapped() + { + return $this->readWrapperValue("friendly_name"); + } + + /** + * Optional. A descriptive name for the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\StringValue $var + * @return $this + */ + public function setFriendlyName($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class); + $this->friendly_name = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object. + + * Optional. A descriptive name for the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string|null $var + * @return $this + */ + public function setFriendlyNameUnwrapped($var) + { + $this->writeWrapperValue("friendly_name", $var); + return $this;} + + /** + * Optional. A user-friendly description of the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\StringValue|null + */ + public function getDescription() + { + return $this->description; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Returns the unboxed value from getDescription() + + * Optional. A user-friendly description of the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string|null + */ + public function getDescriptionUnwrapped() + { + return $this->readWrapperValue("description"); + } + + /** + * Optional. A user-friendly description of the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\StringValue $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class); + $this->description = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object. + + * Optional. A user-friendly description of the dataset. + * + * Generated from protobuf field .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string|null $var + * @return $this + */ + public function setDescriptionUnwrapped($var) + { + $this->writeWrapperValue("description", $var); + return $this;} + + /** + * Optional. The labels associated with this dataset. You can use these + * to organize and group your datasets. + * You can set this property when inserting or updating a dataset. + * See https://cloud.google.com/resource-manager/docs/creating-managing-labels + * for more information. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels associated with this dataset. You can use these + * to organize and group your datasets. + * You can set this property when inserting or updating a dataset. + * See https://cloud.google.com/resource-manager/docs/creating-managing-labels + * for more information. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Required. The geographic location where the dataset should reside. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * + * Generated from protobuf field string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Required. The geographic location where the dataset should reside. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * + * Generated from protobuf field string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DestinationDatasetReference.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DestinationDatasetReference.php new file mode 100644 index 000000000000..cdfc01fa84a4 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/DestinationDatasetReference.php @@ -0,0 +1,109 @@ +google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + */ +class DestinationDatasetReference extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A unique ID for this dataset, without the project name. The ID + * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + * The maximum length is 1,024 characters. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset_id = ''; + /** + * Required. The ID of the project containing this dataset. + * + * Generated from protobuf field string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset_id + * Required. A unique ID for this dataset, without the project name. The ID + * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + * The maximum length is 1,024 characters. + * @type string $project_id + * Required. The ID of the project containing this dataset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. A unique ID for this dataset, without the project name. The ID + * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + * The maximum length is 1,024 characters. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * Required. A unique ID for this dataset, without the project name. The ID + * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + * The maximum length is 1,024 characters. + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * Required. The ID of the project containing this dataset. + * + * Generated from protobuf field string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The ID of the project containing this dataset. + * + * Generated from protobuf field string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/GetDataExchangeRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/GetDataExchangeRequest.php new file mode 100644 index 000000000000..1589433adf0e --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/GetDataExchangeRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + */ +class GetDataExchangeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. Please see + * {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\GetDataExchangeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/GetListingRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/GetListingRequest.php new file mode 100644 index 000000000000..4833f1fea1f0 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/GetListingRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + */ +class GetListingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. Please see + * {@see AnalyticsHubServiceClient::listingName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\GetListingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListDataExchangesRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListDataExchangesRequest.php new file mode 100644 index 000000000000..0d3c1e996b60 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListDataExchangesRequest.php @@ -0,0 +1,162 @@ +google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + */ +class ListDataExchangesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. Please see + * {@see AnalyticsHubServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\ListDataExchangesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * @type int $page_size + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @type string $page_token + * Page token, returned by a previous call, to request the next page of + * results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListDataExchangesResponse.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListDataExchangesResponse.php new file mode 100644 index 000000000000..e4bc976a6fda --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListDataExchangesResponse.php @@ -0,0 +1,101 @@ +google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + */ +class ListDataExchangesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchanges = 1; + */ + private $data_exchanges; + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange>|\Google\Protobuf\Internal\RepeatedField $data_exchanges + * The list of data exchanges. + * @type string $next_page_token + * A token to request the next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchanges = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataExchanges() + { + return $this->data_exchanges; + } + + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchanges = 1; + * @param array<\Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataExchanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange::class); + $this->data_exchanges = $arr; + + return $this; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListListingsRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListListingsRequest.php new file mode 100644 index 000000000000..453823573a96 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListListingsRequest.php @@ -0,0 +1,162 @@ +google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + */ +class ListListingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. Please see + * {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\ListListingsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @type int $page_size + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @type string $page_token + * Page token, returned by a previous call, to request the next page of + * results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListListingsResponse.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListListingsResponse.php new file mode 100644 index 000000000000..52139dd5acde --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListListingsResponse.php @@ -0,0 +1,101 @@ +google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + */ +class ListListingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Listing. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.Listing listings = 1; + */ + private $listings; + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\DataExchange\V1beta1\Listing>|\Google\Protobuf\Internal\RepeatedField $listings + * The list of Listing. + * @type string $next_page_token + * A token to request the next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * The list of Listing. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.Listing listings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getListings() + { + return $this->listings; + } + + /** + * The list of Listing. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.Listing listings = 1; + * @param array<\Google\Cloud\BigQuery\DataExchange\V1beta1\Listing>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setListings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing::class); + $this->listings = $arr; + + return $this; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListOrgDataExchangesRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListOrgDataExchangesRequest.php new file mode 100644 index 000000000000..f6b4ab045d71 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListOrgDataExchangesRequest.php @@ -0,0 +1,162 @@ +google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + */ +class ListOrgDataExchangesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The organization resource path of the projects containing DataExchanges. + * e.g. `organizations/myorg/locations/US`. + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $organization = ''; + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $organization Required. The organization resource path of the projects containing DataExchanges. + * e.g. `organizations/myorg/locations/US`. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\ListOrgDataExchangesRequest + * + * @experimental + */ + public static function build(string $organization): self + { + return (new self()) + ->setOrganization($organization); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $organization + * Required. The organization resource path of the projects containing DataExchanges. + * e.g. `organizations/myorg/locations/US`. + * @type int $page_size + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @type string $page_token + * Page token, returned by a previous call, to request the next page of + * results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. The organization resource path of the projects containing DataExchanges. + * e.g. `organizations/myorg/locations/US`. + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * Required. The organization resource path of the projects containing DataExchanges. + * e.g. `organizations/myorg/locations/US`. + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token, returned by a previous call, to request the next page of + * results. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListOrgDataExchangesResponse.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListOrgDataExchangesResponse.php new file mode 100644 index 000000000000..10b57cdff8e8 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/ListOrgDataExchangesResponse.php @@ -0,0 +1,102 @@ +google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + */ +class ListOrgDataExchangesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchanges = 1; + */ + private $data_exchanges; + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange>|\Google\Protobuf\Internal\RepeatedField $data_exchanges + * The list of data exchanges. + * @type string $next_page_token + * A token to request the next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchanges = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataExchanges() + { + return $this->data_exchanges; + } + + /** + * The list of data exchanges. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchanges = 1; + * @param array<\Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataExchanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange::class); + $this->data_exchanges = $arr; + + return $this; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing.php new file mode 100644 index 000000000000..97a1b7104982 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing.php @@ -0,0 +1,540 @@ +google.cloud.bigquery.dataexchange.v1beta1.Listing + */ +class Listing extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. Human-readable display name of the listing. The display name must contain + * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces + * ( ), ampersands (&) and can't start or end with spaces. + * Default value is an empty string. + * Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. Short description of the listing. The description must not contain + * Unicode non-characters and C0 and C1 control codes except tabs (HT), + * new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Email or URL of the primary point of contact of the listing. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $primary_contact = ''; + /** + * Optional. Documentation describing the listing. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $documentation = ''; + /** + * Output only. Current state of the listing. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the contents of the field are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $icon = ''; + /** + * Optional. Details of the data provider who owns the source data. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $data_provider = null; + /** + * Optional. Categories of the listing. Up to two categories are allowed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $categories; + /** + * Optional. Details of the publisher who owns the listing and who can share + * the source data. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $publisher = null; + /** + * Optional. Email or URL of the request access of the listing. + * Subscribers can use this reference to request access. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_access = ''; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing\BigQueryDatasetSource $bigquery_dataset + * Required. Shared dataset i.e. BigQuery dataset source. + * @type string $name + * Output only. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456` + * @type string $display_name + * Required. Human-readable display name of the listing. The display name must contain + * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces + * ( ), ampersands (&) and can't start or end with spaces. + * Default value is an empty string. + * Max length: 63 bytes. + * @type string $description + * Optional. Short description of the listing. The description must not contain + * Unicode non-characters and C0 and C1 control codes except tabs (HT), + * new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * @type string $primary_contact + * Optional. Email or URL of the primary point of contact of the listing. + * Max Length: 1000 bytes. + * @type string $documentation + * Optional. Documentation describing the listing. + * @type int $state + * Output only. Current state of the listing. + * @type string $icon + * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the contents of the field are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * @type \Google\Cloud\BigQuery\DataExchange\V1beta1\DataProvider $data_provider + * Optional. Details of the data provider who owns the source data. + * @type array|\Google\Protobuf\Internal\RepeatedField $categories + * Optional. Categories of the listing. Up to two categories are allowed. + * @type \Google\Cloud\BigQuery\DataExchange\V1beta1\Publisher $publisher + * Optional. Details of the publisher who owns the listing and who can share + * the source data. + * @type string $request_access + * Optional. Email or URL of the request access of the listing. + * Subscribers can use this reference to request access. + * Max Length: 1000 bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. Shared dataset i.e. BigQuery dataset source. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing\BigQueryDatasetSource|null + */ + public function getBigqueryDataset() + { + return $this->readOneof(6); + } + + public function hasBigqueryDataset() + { + return $this->hasOneof(6); + } + + /** + * Required. Shared dataset i.e. BigQuery dataset source. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing\BigQueryDatasetSource $var + * @return $this + */ + public function setBigqueryDataset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing\BigQueryDatasetSource::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Human-readable display name of the listing. The display name must contain + * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces + * ( ), ampersands (&) and can't start or end with spaces. + * Default value is an empty string. + * Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. Human-readable display name of the listing. The display name must contain + * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces + * ( ), ampersands (&) and can't start or end with spaces. + * Default value is an empty string. + * Max length: 63 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. Short description of the listing. The description must not contain + * Unicode non-characters and C0 and C1 control codes except tabs (HT), + * new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Short description of the listing. The description must not contain + * Unicode non-characters and C0 and C1 control codes except tabs (HT), + * new lines (LF), carriage returns (CR), and page breaks (FF). + * Default value is an empty string. + * Max length: 2000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Email or URL of the primary point of contact of the listing. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPrimaryContact() + { + return $this->primary_contact; + } + + /** + * Optional. Email or URL of the primary point of contact of the listing. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPrimaryContact($var) + { + GPBUtil::checkString($var, True); + $this->primary_contact = $var; + + return $this; + } + + /** + * Optional. Documentation describing the listing. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDocumentation() + { + return $this->documentation; + } + + /** + * Optional. Documentation describing the listing. + * + * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDocumentation($var) + { + GPBUtil::checkString($var, True); + $this->documentation = $var; + + return $this; + } + + /** + * Output only. Current state of the listing. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state of the listing. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the contents of the field are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getIcon() + { + return $this->icon; + } + + /** + * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB + * Expected image dimensions are 512x512 pixels, however the API only + * performs validation on size of the encoded data. + * Note: For byte fields, the contents of the field are base64-encoded (which + * increases the size of the data by 33-36%) when using JSON on the wire. + * + * Generated from protobuf field bytes icon = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setIcon($var) + { + GPBUtil::checkString($var, False); + $this->icon = $var; + + return $this; + } + + /** + * Optional. Details of the data provider who owns the source data. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\DataProvider|null + */ + public function getDataProvider() + { + return $this->data_provider; + } + + public function hasDataProvider() + { + return isset($this->data_provider); + } + + public function clearDataProvider() + { + unset($this->data_provider); + } + + /** + * Optional. Details of the data provider who owns the source data. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\DataProvider $var + * @return $this + */ + public function setDataProvider($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataExchange\V1beta1\DataProvider::class); + $this->data_provider = $var; + + return $this; + } + + /** + * Optional. Categories of the listing. Up to two categories are allowed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCategories() + { + return $this->categories; + } + + /** + * Optional. Categories of the listing. Up to two categories are allowed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.dataexchange.v1beta1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCategories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing\Category::class); + $this->categories = $arr; + + return $this; + } + + /** + * Optional. Details of the publisher who owns the listing and who can share + * the source data. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\Publisher|null + */ + public function getPublisher() + { + return $this->publisher; + } + + public function hasPublisher() + { + return isset($this->publisher); + } + + public function clearPublisher() + { + unset($this->publisher); + } + + /** + * Optional. Details of the publisher who owns the listing and who can share + * the source data. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\Publisher $var + * @return $this + */ + public function setPublisher($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataExchange\V1beta1\Publisher::class); + $this->publisher = $var; + + return $this; + } + + /** + * Optional. Email or URL of the request access of the listing. + * Subscribers can use this reference to request access. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestAccess() + { + return $this->request_access; + } + + /** + * Optional. Email or URL of the request access of the listing. + * Subscribers can use this reference to request access. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestAccess($var) + { + GPBUtil::checkString($var, True); + $this->request_access = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing/BigQueryDatasetSource.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing/BigQueryDatasetSource.php new file mode 100644 index 000000000000..46799e57be56 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing/BigQueryDatasetSource.php @@ -0,0 +1,80 @@ +google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + */ +class BigQueryDatasetSource extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name of the dataset source for this listing. + * e.g. `projects/myproject/datasets/123` + * + * Generated from protobuf field string dataset = 1 [(.google.api.resource_reference) = { + */ + protected $dataset = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset + * Resource name of the dataset source for this listing. + * e.g. `projects/myproject/datasets/123` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Resource name of the dataset source for this listing. + * e.g. `projects/myproject/datasets/123` + * + * Generated from protobuf field string dataset = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getDataset() + { + return $this->dataset; + } + + /** + * Resource name of the dataset source for this listing. + * e.g. `projects/myproject/datasets/123` + * + * Generated from protobuf field string dataset = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkString($var, True); + $this->dataset = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BigQueryDatasetSource::class, \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing_BigQueryDatasetSource::class); + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing/Category.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing/Category.php new file mode 100644 index 000000000000..49feae1ddd69 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing/Category.php @@ -0,0 +1,143 @@ +google.cloud.bigquery.dataexchange.v1beta1.Listing.Category + */ +class Category +{ + /** + * Generated from protobuf enum CATEGORY_UNSPECIFIED = 0; + */ + const CATEGORY_UNSPECIFIED = 0; + /** + * Generated from protobuf enum CATEGORY_OTHERS = 1; + */ + const CATEGORY_OTHERS = 1; + /** + * Generated from protobuf enum CATEGORY_ADVERTISING_AND_MARKETING = 2; + */ + const CATEGORY_ADVERTISING_AND_MARKETING = 2; + /** + * Generated from protobuf enum CATEGORY_COMMERCE = 3; + */ + const CATEGORY_COMMERCE = 3; + /** + * Generated from protobuf enum CATEGORY_CLIMATE_AND_ENVIRONMENT = 4; + */ + const CATEGORY_CLIMATE_AND_ENVIRONMENT = 4; + /** + * Generated from protobuf enum CATEGORY_DEMOGRAPHICS = 5; + */ + const CATEGORY_DEMOGRAPHICS = 5; + /** + * Generated from protobuf enum CATEGORY_ECONOMICS = 6; + */ + const CATEGORY_ECONOMICS = 6; + /** + * Generated from protobuf enum CATEGORY_EDUCATION = 7; + */ + const CATEGORY_EDUCATION = 7; + /** + * Generated from protobuf enum CATEGORY_ENERGY = 8; + */ + const CATEGORY_ENERGY = 8; + /** + * Generated from protobuf enum CATEGORY_FINANCIAL = 9; + */ + const CATEGORY_FINANCIAL = 9; + /** + * Generated from protobuf enum CATEGORY_GAMING = 10; + */ + const CATEGORY_GAMING = 10; + /** + * Generated from protobuf enum CATEGORY_GEOSPATIAL = 11; + */ + const CATEGORY_GEOSPATIAL = 11; + /** + * Generated from protobuf enum CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE = 12; + */ + const CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE = 12; + /** + * Generated from protobuf enum CATEGORY_MEDIA = 13; + */ + const CATEGORY_MEDIA = 13; + /** + * Generated from protobuf enum CATEGORY_PUBLIC_SECTOR = 14; + */ + const CATEGORY_PUBLIC_SECTOR = 14; + /** + * Generated from protobuf enum CATEGORY_RETAIL = 15; + */ + const CATEGORY_RETAIL = 15; + /** + * Generated from protobuf enum CATEGORY_SPORTS = 16; + */ + const CATEGORY_SPORTS = 16; + /** + * Generated from protobuf enum CATEGORY_SCIENCE_AND_RESEARCH = 17; + */ + const CATEGORY_SCIENCE_AND_RESEARCH = 17; + /** + * Generated from protobuf enum CATEGORY_TRANSPORTATION_AND_LOGISTICS = 18; + */ + const CATEGORY_TRANSPORTATION_AND_LOGISTICS = 18; + /** + * Generated from protobuf enum CATEGORY_TRAVEL_AND_TOURISM = 19; + */ + const CATEGORY_TRAVEL_AND_TOURISM = 19; + + private static $valueToName = [ + self::CATEGORY_UNSPECIFIED => 'CATEGORY_UNSPECIFIED', + self::CATEGORY_OTHERS => 'CATEGORY_OTHERS', + self::CATEGORY_ADVERTISING_AND_MARKETING => 'CATEGORY_ADVERTISING_AND_MARKETING', + self::CATEGORY_COMMERCE => 'CATEGORY_COMMERCE', + self::CATEGORY_CLIMATE_AND_ENVIRONMENT => 'CATEGORY_CLIMATE_AND_ENVIRONMENT', + self::CATEGORY_DEMOGRAPHICS => 'CATEGORY_DEMOGRAPHICS', + self::CATEGORY_ECONOMICS => 'CATEGORY_ECONOMICS', + self::CATEGORY_EDUCATION => 'CATEGORY_EDUCATION', + self::CATEGORY_ENERGY => 'CATEGORY_ENERGY', + self::CATEGORY_FINANCIAL => 'CATEGORY_FINANCIAL', + self::CATEGORY_GAMING => 'CATEGORY_GAMING', + self::CATEGORY_GEOSPATIAL => 'CATEGORY_GEOSPATIAL', + self::CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE => 'CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE', + self::CATEGORY_MEDIA => 'CATEGORY_MEDIA', + self::CATEGORY_PUBLIC_SECTOR => 'CATEGORY_PUBLIC_SECTOR', + self::CATEGORY_RETAIL => 'CATEGORY_RETAIL', + self::CATEGORY_SPORTS => 'CATEGORY_SPORTS', + self::CATEGORY_SCIENCE_AND_RESEARCH => 'CATEGORY_SCIENCE_AND_RESEARCH', + self::CATEGORY_TRANSPORTATION_AND_LOGISTICS => 'CATEGORY_TRANSPORTATION_AND_LOGISTICS', + self::CATEGORY_TRAVEL_AND_TOURISM => 'CATEGORY_TRAVEL_AND_TOURISM', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Category::class, \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing_Category::class); + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing/State.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing/State.php new file mode 100644 index 000000000000..b32889752911 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Listing/State.php @@ -0,0 +1,58 @@ +google.cloud.bigquery.dataexchange.v1beta1.Listing.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Subscribable state. Users with dataexchange.listings.subscribe permission + * can subscribe to this listing. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing_State::class); + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Publisher.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Publisher.php new file mode 100644 index 000000000000..df925cb8cd92 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/Publisher.php @@ -0,0 +1,105 @@ +google.cloud.bigquery.dataexchange.v1beta1.Publisher + */ +class Publisher extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the listing publisher. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. Email or URL of the listing publisher. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $primary_contact = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. Name of the listing publisher. + * @type string $primary_contact + * Optional. Email or URL of the listing publisher. + * Max Length: 1000 bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the listing publisher. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Name of the listing publisher. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Email or URL of the listing publisher. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPrimaryContact() + { + return $this->primary_contact; + } + + /** + * Optional. Email or URL of the listing publisher. + * Max Length: 1000 bytes. + * + * Generated from protobuf field string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPrimaryContact($var) + { + GPBUtil::checkString($var, True); + $this->primary_contact = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/SubscribeListingRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/SubscribeListingRequest.php new file mode 100644 index 000000000000..618a4dddf6d5 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/SubscribeListingRequest.php @@ -0,0 +1,128 @@ +google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + */ +class SubscribeListingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + protected $destination; + + /** + * @param string $name Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. Please see + * {@see AnalyticsHubServiceClient::listingName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\SubscribeListingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\DataExchange\V1beta1\DestinationDataset $destination_dataset + * BigQuery destination dataset to create for the subscriber. + * @type string $name + * Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * BigQuery destination dataset to create for the subscriber. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset destination_dataset = 3; + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\DestinationDataset|null + */ + public function getDestinationDataset() + { + return $this->readOneof(3); + } + + public function hasDestinationDataset() + { + return $this->hasOneof(3); + } + + /** + * BigQuery destination dataset to create for the subscriber. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset destination_dataset = 3; + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\DestinationDataset $var + * @return $this + */ + public function setDestinationDataset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataExchange\V1beta1\DestinationDataset::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/SubscribeListingResponse.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/SubscribeListingResponse.php new file mode 100644 index 000000000000..d40416cb2840 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/SubscribeListingResponse.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse + */ +class SubscribeListingResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/UpdateDataExchangeRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/UpdateDataExchangeRequest.php new file mode 100644 index 000000000000..9c8093ac7295 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/UpdateDataExchangeRequest.php @@ -0,0 +1,146 @@ +google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + */ +class UpdateDataExchangeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The data exchange to update. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_exchange = null; + + /** + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange $dataExchange Required. The data exchange to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\UpdateDataExchangeRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange $dataExchange, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDataExchange($dataExchange) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * @type \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange $data_exchange + * Required. The data exchange to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The data exchange to update. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange|null + */ + public function getDataExchange() + { + return $this->data_exchange; + } + + public function hasDataExchange() + { + return isset($this->data_exchange); + } + + public function clearDataExchange() + { + unset($this->data_exchange); + } + + /** + * Required. The data exchange to update. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange $var + * @return $this + */ + public function setDataExchange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange::class); + $this->data_exchange = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/UpdateListingRequest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/UpdateListingRequest.php new file mode 100644 index 000000000000..65cdaa83e854 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/proto/src/Google/Cloud/BigQuery/DataExchange/V1beta1/UpdateListingRequest.php @@ -0,0 +1,146 @@ +google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + */ +class UpdateListingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask specifies the fields to update in the listing resource. The + * fields specified in the `updateMask` are relative to the resource and are + * not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The listing to update. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $listing = null; + + /** + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing $listing Required. The listing to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask specifies the fields to update in the listing resource. The + * fields specified in the `updateMask` are relative to the resource and are + * not a full request. + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\UpdateListingRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BigQuery\DataExchange\V1beta1\Listing $listing, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setListing($listing) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask specifies the fields to update in the listing resource. The + * fields specified in the `updateMask` are relative to the resource and are + * not a full request. + * @type \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing $listing + * Required. The listing to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Dataexchange\V1Beta1\Dataexchange::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask specifies the fields to update in the listing resource. The + * fields specified in the `updateMask` are relative to the resource and are + * not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask specifies the fields to update in the listing resource. The + * fields specified in the `updateMask` are relative to the resource and are + * not a full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The listing to update. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing|null + */ + public function getListing() + { + return $this->listing; + } + + public function hasListing() + { + return isset($this->listing); + } + + public function clearListing() + { + unset($this->listing); + } + + /** + * Required. The listing to update. + * + * Generated from protobuf field .google.cloud.bigquery.dataexchange.v1beta1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing $var + * @return $this + */ + public function setListing($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing::class); + $this->listing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/create_data_exchange.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/create_data_exchange.php new file mode 100644 index 000000000000..91e7905c6d7e --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/create_data_exchange.php @@ -0,0 +1,91 @@ +setDisplayName($dataExchangeDisplayName); + $request = (new CreateDataExchangeRequest()) + ->setParent($formattedParent) + ->setDataExchangeId($dataExchangeId) + ->setDataExchange($dataExchange); + + // Call the API and handle any network failures. + try { + /** @var DataExchange $response */ + $response = $analyticsHubServiceClient->createDataExchange($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AnalyticsHubServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $dataExchangeId = '[DATA_EXCHANGE_ID]'; + $dataExchangeDisplayName = '[DISPLAY_NAME]'; + + create_data_exchange_sample($formattedParent, $dataExchangeId, $dataExchangeDisplayName); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_CreateDataExchange_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/create_listing.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/create_listing.php new file mode 100644 index 000000000000..a6c498b410c6 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/create_listing.php @@ -0,0 +1,98 @@ +setBigqueryDataset($listingBigqueryDataset) + ->setDisplayName($listingDisplayName); + $request = (new CreateListingRequest()) + ->setParent($formattedParent) + ->setListingId($listingId) + ->setListing($listing); + + // Call the API and handle any network failures. + try { + /** @var Listing $response */ + $response = $analyticsHubServiceClient->createListing($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AnalyticsHubServiceClient::dataExchangeName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]' + ); + $listingId = '[LISTING_ID]'; + $listingDisplayName = '[DISPLAY_NAME]'; + + create_listing_sample($formattedParent, $listingId, $listingDisplayName); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_CreateListing_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/delete_data_exchange.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/delete_data_exchange.php new file mode 100644 index 000000000000..99c5254ba3df --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/delete_data_exchange.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $analyticsHubServiceClient->deleteDataExchange($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::dataExchangeName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]' + ); + + delete_data_exchange_sample($formattedName); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_DeleteDataExchange_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/delete_listing.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/delete_listing.php new file mode 100644 index 000000000000..264c3616cdd1 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/delete_listing.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $analyticsHubServiceClient->deleteListing($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::listingName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]', + '[LISTING]' + ); + + delete_listing_sample($formattedName); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_DeleteListing_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_data_exchange.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_data_exchange.php new file mode 100644 index 000000000000..9e08be2ec9f1 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_data_exchange.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DataExchange $response */ + $response = $analyticsHubServiceClient->getDataExchange($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::dataExchangeName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]' + ); + + get_data_exchange_sample($formattedName); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_GetDataExchange_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_iam_policy.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..d56bce00ca61 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_iam_policy.php @@ -0,0 +1,71 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $analyticsHubServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_GetIamPolicy_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_listing.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_listing.php new file mode 100644 index 000000000000..2c6fa3115ade --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_listing.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Listing $response */ + $response = $analyticsHubServiceClient->getListing($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::listingName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]', + '[LISTING]' + ); + + get_listing_sample($formattedName); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_GetListing_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_location.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_location.php new file mode 100644 index 000000000000..2fbe8bedff2f --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_GetLocation_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_data_exchanges.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_data_exchanges.php new file mode 100644 index 000000000000..ea159727feb2 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_data_exchanges.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $analyticsHubServiceClient->listDataExchanges($request); + + /** @var DataExchange $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AnalyticsHubServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_data_exchanges_sample($formattedParent); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_ListDataExchanges_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_listings.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_listings.php new file mode 100644 index 000000000000..dcdeb97ccecc --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_listings.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $analyticsHubServiceClient->listListings($request); + + /** @var Listing $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AnalyticsHubServiceClient::dataExchangeName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]' + ); + + list_listings_sample($formattedParent); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_ListListings_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_locations.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_locations.php new file mode 100644 index 000000000000..750c4435e1cf --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_ListLocations_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_org_data_exchanges.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_org_data_exchanges.php new file mode 100644 index 000000000000..7366041a733f --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/list_org_data_exchanges.php @@ -0,0 +1,77 @@ +setOrganization($organization); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $analyticsHubServiceClient->listOrgDataExchanges($request); + + /** @var DataExchange $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $organization = '[ORGANIZATION]'; + + list_org_data_exchanges_sample($organization); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_ListOrgDataExchanges_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/set_iam_policy.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..73a7dac77161 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/set_iam_policy.php @@ -0,0 +1,73 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $analyticsHubServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_SetIamPolicy_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/subscribe_listing.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/subscribe_listing.php new file mode 100644 index 000000000000..df0061aa875d --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/subscribe_listing.php @@ -0,0 +1,82 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SubscribeListingResponse $response */ + $response = $analyticsHubServiceClient->subscribeListing($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AnalyticsHubServiceClient::listingName( + '[PROJECT]', + '[LOCATION]', + '[DATA_EXCHANGE]', + '[LISTING]' + ); + + subscribe_listing_sample($formattedName); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_SubscribeListing_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/test_iam_permissions.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..6b252fbccb6d --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $analyticsHubServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_TestIamPermissions_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/update_data_exchange.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/update_data_exchange.php new file mode 100644 index 000000000000..2e2328984071 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/update_data_exchange.php @@ -0,0 +1,79 @@ +setDisplayName($dataExchangeDisplayName); + $request = (new UpdateDataExchangeRequest()) + ->setUpdateMask($updateMask) + ->setDataExchange($dataExchange); + + // Call the API and handle any network failures. + try { + /** @var DataExchange $response */ + $response = $analyticsHubServiceClient->updateDataExchange($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $dataExchangeDisplayName = '[DISPLAY_NAME]'; + + update_data_exchange_sample($dataExchangeDisplayName); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_UpdateDataExchange_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/update_listing.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/update_listing.php new file mode 100644 index 000000000000..d2929851a9da --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/samples/V1beta1/AnalyticsHubServiceClient/update_listing.php @@ -0,0 +1,82 @@ +setBigqueryDataset($listingBigqueryDataset) + ->setDisplayName($listingDisplayName); + $request = (new UpdateListingRequest()) + ->setUpdateMask($updateMask) + ->setListing($listing); + + // Call the API and handle any network failures. + try { + /** @var Listing $response */ + $response = $analyticsHubServiceClient->updateListing($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $listingDisplayName = '[DISPLAY_NAME]'; + + update_listing_sample($listingDisplayName); +} +// [END analyticshub_v1beta1_generated_AnalyticsHubService_UpdateListing_sync] diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/AnalyticsHubServiceClient.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/AnalyticsHubServiceClient.php new file mode 100644 index 000000000000..fa24a46a2864 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/AnalyticsHubServiceClient.php @@ -0,0 +1,36 @@ + createDataExchangeAsync(CreateDataExchangeRequest $request, array $optionalArgs = []) + * @method PromiseInterface createListingAsync(CreateListingRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteDataExchangeAsync(DeleteDataExchangeRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteListingAsync(DeleteListingRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDataExchangeAsync(GetDataExchangeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getListingAsync(GetListingRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDataExchangesAsync(ListDataExchangesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listListingsAsync(ListListingsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listOrgDataExchangesAsync(ListOrgDataExchangesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface subscribeListingAsync(SubscribeListingRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDataExchangeAsync(UpdateDataExchangeRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateListingAsync(UpdateListingRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class AnalyticsHubServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'analyticshub.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'analyticshub.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/analytics_hub_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/analytics_hub_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/analytics_hub_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/analytics_hub_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * data_exchange resource. + * + * @param string $project + * @param string $location + * @param string $dataExchange + * + * @return string The formatted data_exchange resource. + * + * @experimental + */ + public static function dataExchangeName(string $project, string $location, string $dataExchange): string + { + return self::getPathTemplate('dataExchange')->render([ + 'project' => $project, + 'location' => $location, + 'data_exchange' => $dataExchange, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a dataset + * resource. + * + * @param string $project + * @param string $dataset + * + * @return string The formatted dataset resource. + * + * @experimental + */ + public static function datasetName(string $project, string $dataset): string + { + return self::getPathTemplate('dataset')->render([ + 'project' => $project, + 'dataset' => $dataset, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a listing + * resource. + * + * @param string $project + * @param string $location + * @param string $dataExchange + * @param string $listing + * + * @return string The formatted listing resource. + * + * @experimental + */ + public static function listingName(string $project, string $location, string $dataExchange, string $listing): string + { + return self::getPathTemplate('listing')->render([ + 'project' => $project, + 'location' => $location, + 'data_exchange' => $dataExchange, + 'listing' => $listing, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + * + * @experimental + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - dataExchange: projects/{project}/locations/{location}/dataExchanges/{data_exchange} + * - dataset: projects/{project}/datasets/{dataset} + * - listing: projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing} + * - location: projects/{project}/locations/{location} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'analyticshub.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new data exchange. + * + * The async variant is {@see AnalyticsHubServiceClient::createDataExchangeAsync()} + * . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/create_data_exchange.php + * + * @param CreateDataExchangeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataExchange + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createDataExchange(CreateDataExchangeRequest $request, array $callOptions = []): DataExchange + { + return $this->startApiCall('CreateDataExchange', $request, $callOptions)->wait(); + } + + /** + * Creates a new listing. + * + * The async variant is {@see AnalyticsHubServiceClient::createListingAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/create_listing.php + * + * @param CreateListingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Listing + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createListing(CreateListingRequest $request, array $callOptions = []): Listing + { + return $this->startApiCall('CreateListing', $request, $callOptions)->wait(); + } + + /** + * Deletes an existing data exchange. + * + * The async variant is {@see AnalyticsHubServiceClient::deleteDataExchangeAsync()} + * . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/delete_data_exchange.php + * + * @param DeleteDataExchangeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteDataExchange(DeleteDataExchangeRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteDataExchange', $request, $callOptions)->wait(); + } + + /** + * Deletes a listing. + * + * The async variant is {@see AnalyticsHubServiceClient::deleteListingAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/delete_listing.php + * + * @param DeleteListingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteListing(DeleteListingRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteListing', $request, $callOptions)->wait(); + } + + /** + * Gets the details of a data exchange. + * + * The async variant is {@see AnalyticsHubServiceClient::getDataExchangeAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/get_data_exchange.php + * + * @param GetDataExchangeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataExchange + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getDataExchange(GetDataExchangeRequest $request, array $callOptions = []): DataExchange + { + return $this->startApiCall('GetDataExchange', $request, $callOptions)->wait(); + } + + /** + * Gets the IAM policy. + * + * The async variant is {@see AnalyticsHubServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets the details of a listing. + * + * The async variant is {@see AnalyticsHubServiceClient::getListingAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/get_listing.php + * + * @param GetListingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Listing + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getListing(GetListingRequest $request, array $callOptions = []): Listing + { + return $this->startApiCall('GetListing', $request, $callOptions)->wait(); + } + + /** + * Lists all data exchanges in a given project and location. + * + * The async variant is {@see AnalyticsHubServiceClient::listDataExchangesAsync()} + * . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/list_data_exchanges.php + * + * @param ListDataExchangesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listDataExchanges(ListDataExchangesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDataExchanges', $request, $callOptions); + } + + /** + * Lists all listings in a given project and location. + * + * The async variant is {@see AnalyticsHubServiceClient::listListingsAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/list_listings.php + * + * @param ListListingsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listListings(ListListingsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListListings', $request, $callOptions); + } + + /** + * Lists all data exchanges from projects in a given organization and + * location. + * + * The async variant is + * {@see AnalyticsHubServiceClient::listOrgDataExchangesAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/list_org_data_exchanges.php + * + * @param ListOrgDataExchangesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listOrgDataExchanges(ListOrgDataExchangesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListOrgDataExchanges', $request, $callOptions); + } + + /** + * Sets the IAM policy. + * + * The async variant is {@see AnalyticsHubServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Subscribes to a listing. + * + * Currently, with Analytics Hub, you can create listings that + * reference only BigQuery datasets. + * Upon subscription to a listing for a BigQuery dataset, Analytics Hub + * creates a linked dataset in the subscriber's project. + * + * The async variant is {@see AnalyticsHubServiceClient::subscribeListingAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/subscribe_listing.php + * + * @param SubscribeListingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SubscribeListingResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function subscribeListing(SubscribeListingRequest $request, array $callOptions = []): SubscribeListingResponse + { + return $this->startApiCall('SubscribeListing', $request, $callOptions)->wait(); + } + + /** + * Returns the permissions that a caller has. + * + * The async variant is {@see AnalyticsHubServiceClient::testIamPermissionsAsync()} + * . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates an existing data exchange. + * + * The async variant is {@see AnalyticsHubServiceClient::updateDataExchangeAsync()} + * . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/update_data_exchange.php + * + * @param UpdateDataExchangeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataExchange + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateDataExchange(UpdateDataExchangeRequest $request, array $callOptions = []): DataExchange + { + return $this->startApiCall('UpdateDataExchange', $request, $callOptions)->wait(); + } + + /** + * Updates an existing listing. + * + * The async variant is {@see AnalyticsHubServiceClient::updateListingAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/update_listing.php + * + * @param UpdateListingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Listing + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateListing(UpdateListingRequest $request, array $callOptions = []): Listing + { + return $this->startApiCall('UpdateListing', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AnalyticsHubServiceClient::getLocationAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see AnalyticsHubServiceClient::listLocationsAsync()} . + * + * @example samples/V1beta1/AnalyticsHubServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/Gapic/AnalyticsHubServiceGapicClient.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/Gapic/AnalyticsHubServiceGapicClient.php new file mode 100644 index 000000000000..6f0c940efa5f --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/Gapic/AnalyticsHubServiceGapicClient.php @@ -0,0 +1,1305 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $dataExchangeId = 'data_exchange_id'; + * $dataExchange = new DataExchange(); + * $response = $analyticsHubServiceClient->createDataExchange($formattedParent, $dataExchangeId, $dataExchange); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @experimental + * + * @deprecated Please use the new service client {@see \Google\Cloud\BigQuery\DataExchange\V1beta1\Client\AnalyticsHubServiceClient}. + */ +class AnalyticsHubServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'analyticshub.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'analyticshub.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $dataExchangeNameTemplate; + + private static $datasetNameTemplate; + + private static $listingNameTemplate; + + private static $locationNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/analytics_hub_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/analytics_hub_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/analytics_hub_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/analytics_hub_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getDataExchangeNameTemplate() + { + if (self::$dataExchangeNameTemplate == null) { + self::$dataExchangeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/dataExchanges/{data_exchange}'); + } + + return self::$dataExchangeNameTemplate; + } + + private static function getDatasetNameTemplate() + { + if (self::$datasetNameTemplate == null) { + self::$datasetNameTemplate = new PathTemplate('projects/{project}/datasets/{dataset}'); + } + + return self::$datasetNameTemplate; + } + + private static function getListingNameTemplate() + { + if (self::$listingNameTemplate == null) { + self::$listingNameTemplate = new PathTemplate('projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}'); + } + + return self::$listingNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'dataExchange' => self::getDataExchangeNameTemplate(), + 'dataset' => self::getDatasetNameTemplate(), + 'listing' => self::getListingNameTemplate(), + 'location' => self::getLocationNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * data_exchange resource. + * + * @param string $project + * @param string $location + * @param string $dataExchange + * + * @return string The formatted data_exchange resource. + * + * @experimental + */ + public static function dataExchangeName($project, $location, $dataExchange) + { + return self::getDataExchangeNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'data_exchange' => $dataExchange, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a dataset + * resource. + * + * @param string $project + * @param string $dataset + * + * @return string The formatted dataset resource. + * + * @experimental + */ + public static function datasetName($project, $dataset) + { + return self::getDatasetNameTemplate()->render([ + 'project' => $project, + 'dataset' => $dataset, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a listing + * resource. + * + * @param string $project + * @param string $location + * @param string $dataExchange + * @param string $listing + * + * @return string The formatted listing resource. + * + * @experimental + */ + public static function listingName($project, $location, $dataExchange, $listing) + { + return self::getListingNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'data_exchange' => $dataExchange, + 'listing' => $listing, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + * + * @experimental + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - dataExchange: projects/{project}/locations/{location}/dataExchanges/{data_exchange} + * - dataset: projects/{project}/datasets/{dataset} + * - listing: projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing} + * - location: projects/{project}/locations/{location} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'analyticshub.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a new data exchange. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $formattedParent = $analyticsHubServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $dataExchangeId = 'data_exchange_id'; + * $dataExchange = new DataExchange(); + * $response = $analyticsHubServiceClient->createDataExchange($formattedParent, $dataExchangeId, $dataExchange); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. + * @param string $dataExchangeId Required. The ID of the data exchange. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * @param DataExchange $dataExchange Required. The data exchange to create. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createDataExchange($parent, $dataExchangeId, $dataExchange, array $optionalArgs = []) + { + $request = new CreateDataExchangeRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setDataExchangeId($dataExchangeId); + $request->setDataExchange($dataExchange); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateDataExchange', DataExchange::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new listing. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $formattedParent = $analyticsHubServiceClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + * $listingId = 'listing_id'; + * $listing = new Listing(); + * $response = $analyticsHubServiceClient->createListing($formattedParent, $listingId, $listing); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @param string $listingId Required. The ID of the listing to create. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * @param Listing $listing Required. The listing to create. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createListing($parent, $listingId, $listing, array $optionalArgs = []) + { + $request = new CreateListingRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setListingId($listingId); + $request->setListing($listing); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateListing', Listing::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes an existing data exchange. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $formattedName = $analyticsHubServiceClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + * $analyticsHubServiceClient->deleteDataExchange($formattedName); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The full name of the data exchange resource that you want to delete. + * For example, `projects/myproject/locations/US/dataExchanges/123`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteDataExchange($name, array $optionalArgs = []) + { + $request = new DeleteDataExchangeRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteDataExchange', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a listing. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $formattedName = $analyticsHubServiceClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + * $analyticsHubServiceClient->deleteListing($formattedName); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteListing($name, array $optionalArgs = []) + { + $request = new DeleteListingRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteListing', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the details of a data exchange. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $formattedName = $analyticsHubServiceClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + * $response = $analyticsHubServiceClient->getDataExchange($formattedName); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getDataExchange($name, array $optionalArgs = []) + { + $request = new GetDataExchangeRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetDataExchange', DataExchange::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the IAM policy. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $resource = 'resource'; + * $response = $analyticsHubServiceClient->getIamPolicy($resource); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the details of a listing. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $formattedName = $analyticsHubServiceClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + * $response = $analyticsHubServiceClient->getListing($formattedName); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getListing($name, array $optionalArgs = []) + { + $request = new GetListingRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetListing', Listing::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists all data exchanges in a given project and location. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $formattedParent = $analyticsHubServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $analyticsHubServiceClient->listDataExchanges($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $analyticsHubServiceClient->listDataExchanges($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listDataExchanges($parent, array $optionalArgs = []) + { + $request = new ListDataExchangesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListDataExchanges', $optionalArgs, ListDataExchangesResponse::class, $request); + } + + /** + * Lists all listings in a given project and location. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $formattedParent = $analyticsHubServiceClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + * // Iterate over pages of elements + * $pagedResponse = $analyticsHubServiceClient->listListings($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $analyticsHubServiceClient->listListings($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listListings($parent, array $optionalArgs = []) + { + $request = new ListListingsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListListings', $optionalArgs, ListListingsResponse::class, $request); + } + + /** + * Lists all data exchanges from projects in a given organization and + * location. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $organization = 'organization'; + * // Iterate over pages of elements + * $pagedResponse = $analyticsHubServiceClient->listOrgDataExchanges($organization); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $analyticsHubServiceClient->listOrgDataExchanges($organization); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $organization Required. The organization resource path of the projects containing DataExchanges. + * e.g. `organizations/myorg/locations/US`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listOrgDataExchanges($organization, array $optionalArgs = []) + { + $request = new ListOrgDataExchangesRequest(); + $requestParamHeaders = []; + $request->setOrganization($organization); + $requestParamHeaders['organization'] = $organization; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListOrgDataExchanges', $optionalArgs, ListOrgDataExchangesResponse::class, $request); + } + + /** + * Sets the IAM policy. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $analyticsHubServiceClient->setIamPolicy($resource, $policy); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Subscribes to a listing. + * + * Currently, with Analytics Hub, you can create listings that + * reference only BigQuery datasets. + * Upon subscription to a listing for a BigQuery dataset, Analytics Hub + * creates a linked dataset in the subscriber's project. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $formattedName = $analyticsHubServiceClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + * $response = $analyticsHubServiceClient->subscribeListing($formattedName); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @param array $optionalArgs { + * Optional. + * + * @type DestinationDataset $destinationDataset + * BigQuery destination dataset to create for the subscriber. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\SubscribeListingResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function subscribeListing($name, array $optionalArgs = []) + { + $request = new SubscribeListingRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['destinationDataset'])) { + $request->setDestinationDataset($optionalArgs['destinationDataset']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SubscribeListing', SubscribeListingResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the permissions that a caller has. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $analyticsHubServiceClient->testIamPermissions($resource, $permissions); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates an existing data exchange. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $updateMask = new FieldMask(); + * $dataExchange = new DataExchange(); + * $response = $analyticsHubServiceClient->updateDataExchange($updateMask, $dataExchange); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param FieldMask $updateMask Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * @param DataExchange $dataExchange Required. The data exchange to update. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateDataExchange($updateMask, $dataExchange, array $optionalArgs = []) + { + $request = new UpdateDataExchangeRequest(); + $requestParamHeaders = []; + $request->setUpdateMask($updateMask); + $request->setDataExchange($dataExchange); + $requestParamHeaders['data_exchange.name'] = $dataExchange->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateDataExchange', DataExchange::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates an existing listing. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $updateMask = new FieldMask(); + * $listing = new Listing(); + * $response = $analyticsHubServiceClient->updateListing($updateMask, $listing); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param FieldMask $updateMask Required. Field mask specifies the fields to update in the listing resource. The + * fields specified in the `updateMask` are relative to the resource and are + * not a full request. + * @param Listing $listing Required. The listing to update. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\BigQuery\DataExchange\V1beta1\Listing + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateListing($updateMask, $listing, array $optionalArgs = []) + { + $request = new UpdateListingRequest(); + $requestParamHeaders = []; + $request->setUpdateMask($updateMask); + $request->setListing($listing); + $requestParamHeaders['listing.name'] = $listing->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateListing', Listing::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * $response = $analyticsHubServiceClient->getLocation(); + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $analyticsHubServiceClient = new AnalyticsHubServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $analyticsHubServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $analyticsHubServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $analyticsHubServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/gapic_metadata.json b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/gapic_metadata.json new file mode 100644 index 000000000000..f0e891ccec84 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/gapic_metadata.json @@ -0,0 +1,103 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.bigquery.dataexchange.v1beta1", + "libraryPackage": "Google\\Cloud\\BigQuery\\DataExchange\\V1beta1", + "services": { + "AnalyticsHubService": { + "clients": { + "grpc": { + "libraryClient": "AnalyticsHubServiceGapicClient", + "rpcs": { + "CreateDataExchange": { + "methods": [ + "createDataExchange" + ] + }, + "CreateListing": { + "methods": [ + "createListing" + ] + }, + "DeleteDataExchange": { + "methods": [ + "deleteDataExchange" + ] + }, + "DeleteListing": { + "methods": [ + "deleteListing" + ] + }, + "GetDataExchange": { + "methods": [ + "getDataExchange" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetListing": { + "methods": [ + "getListing" + ] + }, + "ListDataExchanges": { + "methods": [ + "listDataExchanges" + ] + }, + "ListListings": { + "methods": [ + "listListings" + ] + }, + "ListOrgDataExchanges": { + "methods": [ + "listOrgDataExchanges" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SubscribeListing": { + "methods": [ + "subscribeListing" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateDataExchange": { + "methods": [ + "updateDataExchange" + ] + }, + "UpdateListing": { + "methods": [ + "updateListing" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/resources/analytics_hub_service_client_config.json b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/resources/analytics_hub_service_client_config.json new file mode 100644 index 000000000000..ef5607e7a3c2 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/resources/analytics_hub_service_client_config.json @@ -0,0 +1,120 @@ +{ + "interfaces": { + "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateListing": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteListing": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetListing": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDataExchanges": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListListings": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListOrgDataExchanges": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SubscribeListing": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateListing": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/resources/analytics_hub_service_descriptor_config.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/resources/analytics_hub_service_descriptor_config.php new file mode 100644 index 000000000000..a8f4be36fc80 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/resources/analytics_hub_service_descriptor_config.php @@ -0,0 +1,274 @@ + [ + 'google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService' => [ + 'CreateDataExchange' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateListing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataExchange\V1beta1\Listing', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataExchange' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteListing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDataExchange' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetListing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataExchange\V1beta1\Listing', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListDataExchanges' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataExchanges', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataExchange\V1beta1\ListDataExchangesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListListings' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getListings', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataExchange\V1beta1\ListListingsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListOrgDataExchanges' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataExchanges', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataExchange\V1beta1\ListOrgDataExchangesResponse', + 'headerParams' => [ + [ + 'keyName' => 'organization', + 'fieldAccessors' => [ + 'getOrganization', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'SubscribeListing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataExchange\V1beta1\SubscribeListingResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateDataExchange' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataExchange\V1beta1\DataExchange', + 'headerParams' => [ + [ + 'keyName' => 'data_exchange.name', + 'fieldAccessors' => [ + 'getDataExchange', + 'getName', + ], + ], + ], + ], + 'UpdateListing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataExchange\V1beta1\Listing', + 'headerParams' => [ + [ + 'keyName' => 'listing.name', + 'fieldAccessors' => [ + 'getListing', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'dataExchange' => 'projects/{project}/locations/{location}/dataExchanges/{data_exchange}', + 'dataset' => 'projects/{project}/datasets/{dataset}', + 'listing' => 'projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/resources/analytics_hub_service_rest_client_config.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/resources/analytics_hub_service_rest_client_config.php new file mode 100644 index 000000000000..514c173d9e4f --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/src/V1beta1/resources/analytics_hub_service_rest_client_config.php @@ -0,0 +1,260 @@ + [ + 'google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService' => [ + 'CreateDataExchange' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/dataExchanges', + 'body' => 'data_exchange', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'data_exchange_id', + ], + ], + 'CreateListing' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/dataExchanges/*}/listings', + 'body' => 'listing', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'listing_id', + ], + ], + 'DeleteDataExchange' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/dataExchanges/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteListing' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDataExchange' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/dataExchanges/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:getIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:getIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetListing' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListDataExchanges' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/dataExchanges', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListListings' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/dataExchanges/*}/listings', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListOrgDataExchanges' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{organization=organizations/*/locations/*}/dataExchanges', + 'placeholders' => [ + 'organization' => [ + 'getters' => [ + 'getOrganization', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SubscribeListing' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}:subscribe', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateDataExchange' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta1/{data_exchange.name=projects/*/locations/*/dataExchanges/*}', + 'body' => 'data_exchange', + 'placeholders' => [ + 'data_exchange.name' => [ + 'getters' => [ + 'getDataExchange', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateListing' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta1/{listing.name=projects/*/locations/*/dataExchanges/*/listings/*}', + 'body' => 'listing', + 'placeholders' => [ + 'listing.name' => [ + 'getters' => [ + 'getListing', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/tests/Unit/V1beta1/AnalyticsHubServiceClientTest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/tests/Unit/V1beta1/AnalyticsHubServiceClientTest.php new file mode 100644 index 000000000000..95b5f271dd3e --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/tests/Unit/V1beta1/AnalyticsHubServiceClientTest.php @@ -0,0 +1,1239 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AnalyticsHubServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AnalyticsHubServiceClient($options); + } + + /** @test */ + public function createDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $listingCount = 1101038700; + $icon = '121'; + $expectedResponse = new DataExchange(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setListingCount($listingCount); + $expectedResponse->setIcon($icon); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataExchangeId = 'dataExchangeId1402219426'; + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $response = $gapicClient->createDataExchange($formattedParent, $dataExchangeId, $dataExchange); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/CreateDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getDataExchangeId(); + $this->assertProtobufEquals($dataExchangeId, $actualValue); + $actualValue = $actualRequestObject->getDataExchange(); + $this->assertProtobufEquals($dataExchange, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataExchangeId = 'dataExchangeId1402219426'; + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + try { + $gapicClient->createDataExchange($formattedParent, $dataExchangeId, $dataExchange); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $icon = '121'; + $requestAccess = 'requestAccess2059178260'; + $expectedResponse = new Listing(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setIcon($icon); + $expectedResponse->setRequestAccess($requestAccess); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $listingId = 'listingId988969142'; + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + $response = $gapicClient->createListing($formattedParent, $listingId, $listing); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/CreateListing', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getListingId(); + $this->assertProtobufEquals($listingId, $actualValue); + $actualValue = $actualRequestObject->getListing(); + $this->assertProtobufEquals($listing, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $listingId = 'listingId988969142'; + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + try { + $gapicClient->createListing($formattedParent, $listingId, $listing); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $gapicClient->deleteDataExchange($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/DeleteDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + try { + $gapicClient->deleteDataExchange($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $gapicClient->deleteListing($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/DeleteListing', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + try { + $gapicClient->deleteListing($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $listingCount = 1101038700; + $icon = '121'; + $expectedResponse = new DataExchange(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setListingCount($listingCount); + $expectedResponse->setIcon($icon); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $response = $gapicClient->getDataExchange($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/GetDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + try { + $gapicClient->getDataExchange($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $icon = '121'; + $requestAccess = 'requestAccess2059178260'; + $expectedResponse = new Listing(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setIcon($icon); + $expectedResponse->setRequestAccess($requestAccess); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $response = $gapicClient->getListing($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/GetListing', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + try { + $gapicClient->getListing($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataExchangesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataExchangesElement = new DataExchange(); + $dataExchanges = [ + $dataExchangesElement, + ]; + $expectedResponse = new ListDataExchangesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataExchanges($dataExchanges); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listDataExchanges($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataExchanges()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/ListDataExchanges', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataExchangesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listDataExchanges($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listListingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $listingsElement = new Listing(); + $listings = [ + $listingsElement, + ]; + $expectedResponse = new ListListingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setListings($listings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $response = $gapicClient->listListings($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getListings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/ListListings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listListingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + try { + $gapicClient->listListings($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOrgDataExchangesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataExchangesElement = new DataExchange(); + $dataExchanges = [ + $dataExchangesElement, + ]; + $expectedResponse = new ListOrgDataExchangesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataExchanges($dataExchanges); + $transport->addResponse($expectedResponse); + // Mock request + $organization = 'organization1178922291'; + $response = $gapicClient->listOrgDataExchanges($organization); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataExchanges()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/ListOrgDataExchanges', $actualFuncCall); + $actualValue = $actualRequestObject->getOrganization(); + $this->assertProtobufEquals($organization, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOrgDataExchangesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $organization = 'organization1178922291'; + try { + $gapicClient->listOrgDataExchanges($organization); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function subscribeListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SubscribeListingResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $response = $gapicClient->subscribeListing($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/SubscribeListing', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function subscribeListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + try { + $gapicClient->subscribeListing($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $listingCount = 1101038700; + $icon = '121'; + $expectedResponse = new DataExchange(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setListingCount($listingCount); + $expectedResponse->setIcon($icon); + $transport->addResponse($expectedResponse); + // Mock request + $updateMask = new FieldMask(); + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $response = $gapicClient->updateDataExchange($updateMask, $dataExchange); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/UpdateDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualRequestObject->getDataExchange(); + $this->assertProtobufEquals($dataExchange, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + try { + $gapicClient->updateDataExchange($updateMask, $dataExchange); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $icon = '121'; + $requestAccess = 'requestAccess2059178260'; + $expectedResponse = new Listing(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setIcon($icon); + $expectedResponse->setRequestAccess($requestAccess); + $transport->addResponse($expectedResponse); + // Mock request + $updateMask = new FieldMask(); + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + $response = $gapicClient->updateListing($updateMask, $listing); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/UpdateListing', $actualFuncCall); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualRequestObject->getListing(); + $this->assertProtobufEquals($listing, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + try { + $gapicClient->updateListing($updateMask, $listing); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/BigQueryDataExchange/v1beta1/tests/Unit/V1beta1/Client/AnalyticsHubServiceClientTest.php b/owl-bot-staging/BigQueryDataExchange/v1beta1/tests/Unit/V1beta1/Client/AnalyticsHubServiceClientTest.php new file mode 100644 index 000000000000..3a78232d4dc3 --- /dev/null +++ b/owl-bot-staging/BigQueryDataExchange/v1beta1/tests/Unit/V1beta1/Client/AnalyticsHubServiceClientTest.php @@ -0,0 +1,1387 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AnalyticsHubServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AnalyticsHubServiceClient($options); + } + + /** @test */ + public function createDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $listingCount = 1101038700; + $icon = '121'; + $expectedResponse = new DataExchange(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setListingCount($listingCount); + $expectedResponse->setIcon($icon); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataExchangeId = 'dataExchangeId1402219426'; + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $request = (new CreateDataExchangeRequest()) + ->setParent($formattedParent) + ->setDataExchangeId($dataExchangeId) + ->setDataExchange($dataExchange); + $response = $gapicClient->createDataExchange($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/CreateDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getDataExchangeId(); + $this->assertProtobufEquals($dataExchangeId, $actualValue); + $actualValue = $actualRequestObject->getDataExchange(); + $this->assertProtobufEquals($dataExchange, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataExchangeId = 'dataExchangeId1402219426'; + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $request = (new CreateDataExchangeRequest()) + ->setParent($formattedParent) + ->setDataExchangeId($dataExchangeId) + ->setDataExchange($dataExchange); + try { + $gapicClient->createDataExchange($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $icon = '121'; + $requestAccess = 'requestAccess2059178260'; + $expectedResponse = new Listing(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setIcon($icon); + $expectedResponse->setRequestAccess($requestAccess); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $listingId = 'listingId988969142'; + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + $request = (new CreateListingRequest()) + ->setParent($formattedParent) + ->setListingId($listingId) + ->setListing($listing); + $response = $gapicClient->createListing($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/CreateListing', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getListingId(); + $this->assertProtobufEquals($listingId, $actualValue); + $actualValue = $actualRequestObject->getListing(); + $this->assertProtobufEquals($listing, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $listingId = 'listingId988969142'; + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + $request = (new CreateListingRequest()) + ->setParent($formattedParent) + ->setListingId($listingId) + ->setListing($listing); + try { + $gapicClient->createListing($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new DeleteDataExchangeRequest()) + ->setName($formattedName); + $gapicClient->deleteDataExchange($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/DeleteDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new DeleteDataExchangeRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteDataExchange($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new DeleteListingRequest()) + ->setName($formattedName); + $gapicClient->deleteListing($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/DeleteListing', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new DeleteListingRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteListing($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $listingCount = 1101038700; + $icon = '121'; + $expectedResponse = new DataExchange(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setListingCount($listingCount); + $expectedResponse->setIcon($icon); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new GetDataExchangeRequest()) + ->setName($formattedName); + $response = $gapicClient->getDataExchange($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/GetDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new GetDataExchangeRequest()) + ->setName($formattedName); + try { + $gapicClient->getDataExchange($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $icon = '121'; + $requestAccess = 'requestAccess2059178260'; + $expectedResponse = new Listing(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setIcon($icon); + $expectedResponse->setRequestAccess($requestAccess); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new GetListingRequest()) + ->setName($formattedName); + $response = $gapicClient->getListing($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/GetListing', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new GetListingRequest()) + ->setName($formattedName); + try { + $gapicClient->getListing($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataExchangesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataExchangesElement = new DataExchange(); + $dataExchanges = [ + $dataExchangesElement, + ]; + $expectedResponse = new ListDataExchangesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataExchanges($dataExchanges); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListDataExchangesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listDataExchanges($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataExchanges()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/ListDataExchanges', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataExchangesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListDataExchangesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listDataExchanges($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listListingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $listingsElement = new Listing(); + $listings = [ + $listingsElement, + ]; + $expectedResponse = new ListListingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setListings($listings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new ListListingsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listListings($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getListings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/ListListings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listListingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]'); + $request = (new ListListingsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listListings($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOrgDataExchangesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataExchangesElement = new DataExchange(); + $dataExchanges = [ + $dataExchangesElement, + ]; + $expectedResponse = new ListOrgDataExchangesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataExchanges($dataExchanges); + $transport->addResponse($expectedResponse); + // Mock request + $organization = 'organization1178922291'; + $request = (new ListOrgDataExchangesRequest()) + ->setOrganization($organization); + $response = $gapicClient->listOrgDataExchanges($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataExchanges()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/ListOrgDataExchanges', $actualFuncCall); + $actualValue = $actualRequestObject->getOrganization(); + $this->assertProtobufEquals($organization, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOrgDataExchangesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $organization = 'organization1178922291'; + $request = (new ListOrgDataExchangesRequest()) + ->setOrganization($organization); + try { + $gapicClient->listOrgDataExchanges($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function subscribeListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SubscribeListingResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new SubscribeListingRequest()) + ->setName($formattedName); + $response = $gapicClient->subscribeListing($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/SubscribeListing', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function subscribeListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->listingName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]', '[LISTING]'); + $request = (new SubscribeListingRequest()) + ->setName($formattedName); + try { + $gapicClient->subscribeListing($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDataExchangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $listingCount = 1101038700; + $icon = '121'; + $expectedResponse = new DataExchange(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setListingCount($listingCount); + $expectedResponse->setIcon($icon); + $transport->addResponse($expectedResponse); + // Mock request + $updateMask = new FieldMask(); + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $request = (new UpdateDataExchangeRequest()) + ->setUpdateMask($updateMask) + ->setDataExchange($dataExchange); + $response = $gapicClient->updateDataExchange($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/UpdateDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualRequestObject->getDataExchange(); + $this->assertProtobufEquals($dataExchange, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDataExchangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $request = (new UpdateDataExchangeRequest()) + ->setUpdateMask($updateMask) + ->setDataExchange($dataExchange); + try { + $gapicClient->updateDataExchange($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateListingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $icon = '121'; + $requestAccess = 'requestAccess2059178260'; + $expectedResponse = new Listing(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setIcon($icon); + $expectedResponse->setRequestAccess($requestAccess); + $transport->addResponse($expectedResponse); + // Mock request + $updateMask = new FieldMask(); + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + $request = (new UpdateListingRequest()) + ->setUpdateMask($updateMask) + ->setListing($listing); + $response = $gapicClient->updateListing($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/UpdateListing', $actualFuncCall); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualRequestObject->getListing(); + $this->assertProtobufEquals($listing, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateListingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $listing = new Listing(); + $listingDisplayName = 'listingDisplayName293456201'; + $listing->setDisplayName($listingDisplayName); + $listingBigqueryDataset = new BigQueryDatasetSource(); + $listing->setBigqueryDataset($listingBigqueryDataset); + $request = (new UpdateListingRequest()) + ->setUpdateMask($updateMask) + ->setListing($listing); + try { + $gapicClient->updateListing($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDataExchangeAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $primaryContact = 'primaryContact203339491'; + $documentation = 'documentation1587405498'; + $listingCount = 1101038700; + $icon = '121'; + $expectedResponse = new DataExchange(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setDocumentation($documentation); + $expectedResponse->setListingCount($listingCount); + $expectedResponse->setIcon($icon); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataExchangeId = 'dataExchangeId1402219426'; + $dataExchange = new DataExchange(); + $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080'; + $dataExchange->setDisplayName($dataExchangeDisplayName); + $request = (new CreateDataExchangeRequest()) + ->setParent($formattedParent) + ->setDataExchangeId($dataExchangeId) + ->setDataExchange($dataExchange); + $response = $gapicClient->createDataExchangeAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService/CreateDataExchange', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getDataExchangeId(); + $this->assertProtobufEquals($dataExchangeId, $actualValue); + $actualValue = $actualRequestObject->getDataExchange(); + $this->assertProtobufEquals($dataExchange, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Datapolicies/V1/Datapolicy.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Datapolicies/V1/Datapolicy.php new file mode 100644 index 000000000000..5e5cef94109a Binary files /dev/null and b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Datapolicies/V1/Datapolicy.php differ diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/CreateDataPolicyRequest.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/CreateDataPolicyRequest.php new file mode 100644 index 000000000000..f587ea304fcb --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/CreateDataPolicyRequest.php @@ -0,0 +1,137 @@ +google.cloud.bigquery.datapolicies.v1.CreateDataPolicyRequest + */ +class CreateDataPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the project that the data policy will belong to. + * The format is `projects/{project_number}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The data policy to create. The `name` field does not need to be + * provided for the data policy creation. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataPolicy data_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_policy = null; + + /** + * @param string $parent Required. Resource name of the project that the data policy will belong to. + * The format is `projects/{project_number}/locations/{location_id}`. Please see + * {@see DataPolicyServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy $dataPolicy Required. The data policy to create. The `name` field does not need to be + * provided for the data policy creation. + * + * @return \Google\Cloud\BigQuery\DataPolicies\V1\CreateDataPolicyRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy $dataPolicy): self + { + return (new self()) + ->setParent($parent) + ->setDataPolicy($dataPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the project that the data policy will belong to. + * The format is `projects/{project_number}/locations/{location_id}`. + * @type \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy $data_policy + * Required. The data policy to create. The `name` field does not need to be + * provided for the data policy creation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datapolicies\V1\Datapolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the project that the data policy will belong to. + * The format is `projects/{project_number}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource name of the project that the data policy will belong to. + * The format is `projects/{project_number}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The data policy to create. The `name` field does not need to be + * provided for the data policy creation. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataPolicy data_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy|null + */ + public function getDataPolicy() + { + return $this->data_policy; + } + + public function hasDataPolicy() + { + return isset($this->data_policy); + } + + public function clearDataPolicy() + { + unset($this->data_policy); + } + + /** + * Required. The data policy to create. The `name` field does not need to be + * provided for the data policy creation. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataPolicy data_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy $var + * @return $this + */ + public function setDataPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy::class); + $this->data_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataMaskingPolicy.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataMaskingPolicy.php new file mode 100644 index 000000000000..67d9e2641f29 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataMaskingPolicy.php @@ -0,0 +1,114 @@ +google.cloud.bigquery.datapolicies.v1.DataMaskingPolicy + */ +class DataMaskingPolicy extends \Google\Protobuf\Internal\Message +{ + protected $masking_expression; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $predefined_expression + * A predefined masking expression. + * @type string $routine + * The name of the BigQuery routine that contains the custom masking + * routine, in the format of + * `projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datapolicies\V1\Datapolicy::initOnce(); + parent::__construct($data); + } + + /** + * A predefined masking expression. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataMaskingPolicy.PredefinedExpression predefined_expression = 1; + * @return int + */ + public function getPredefinedExpression() + { + return $this->readOneof(1); + } + + public function hasPredefinedExpression() + { + return $this->hasOneof(1); + } + + /** + * A predefined masking expression. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataMaskingPolicy.PredefinedExpression predefined_expression = 1; + * @param int $var + * @return $this + */ + public function setPredefinedExpression($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataPolicies\V1\DataMaskingPolicy\PredefinedExpression::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The name of the BigQuery routine that contains the custom masking + * routine, in the format of + * `projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}`. + * + * Generated from protobuf field string routine = 3; + * @return string + */ + public function getRoutine() + { + return $this->readOneof(3); + } + + public function hasRoutine() + { + return $this->hasOneof(3); + } + + /** + * The name of the BigQuery routine that contains the custom masking + * routine, in the format of + * `projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}`. + * + * Generated from protobuf field string routine = 3; + * @param string $var + * @return $this + */ + public function setRoutine($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getMaskingExpression() + { + return $this->whichOneof("masking_expression"); + } + +} + diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataMaskingPolicy/PredefinedExpression.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataMaskingPolicy/PredefinedExpression.php new file mode 100644 index 000000000000..c561f3ab4083 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataMaskingPolicy/PredefinedExpression.php @@ -0,0 +1,141 @@ +google.cloud.bigquery.datapolicies.v1.DataMaskingPolicy.PredefinedExpression + */ +class PredefinedExpression +{ + /** + * Default, unspecified predefined expression. No masking will take place + * since no expression is specified. + * + * Generated from protobuf enum PREDEFINED_EXPRESSION_UNSPECIFIED = 0; + */ + const PREDEFINED_EXPRESSION_UNSPECIFIED = 0; + /** + * Masking expression to replace data with SHA-256 hash. + * + * Generated from protobuf enum SHA256 = 3; + */ + const SHA256 = 3; + /** + * Masking expression to replace data with NULLs. + * + * Generated from protobuf enum ALWAYS_NULL = 5; + */ + const ALWAYS_NULL = 5; + /** + * Masking expression to replace data with their default masking values. + * The default masking values for each type listed as below: + * * STRING: "" + * * BYTES: b'' + * * INTEGER: 0 + * * FLOAT: 0.0 + * * NUMERIC: 0 + * * BOOLEAN: FALSE + * * TIMESTAMP: 1970-01-01 00:00:00 UTC + * * DATE: 1970-01-01 + * * TIME: 00:00:00 + * * DATETIME: 1970-01-01T00:00:00 + * * GEOGRAPHY: POINT(0 0) + * * BIGNUMERIC: 0 + * * ARRAY: [] + * * STRUCT: NOT_APPLICABLE + * * JSON: NULL + * + * Generated from protobuf enum DEFAULT_MASKING_VALUE = 7; + */ + const DEFAULT_MASKING_VALUE = 7; + /** + * Masking expression shows the last four characters of text. + * The masking behavior is as follows: + * * If text length > 4 characters: Replace text with XXXXX, append last + * four characters of original text. + * * If text length <= 4 characters: Apply SHA-256 hash. + * + * Generated from protobuf enum LAST_FOUR_CHARACTERS = 9; + */ + const LAST_FOUR_CHARACTERS = 9; + /** + * Masking expression shows the first four characters of text. + * The masking behavior is as follows: + * * If text length > 4 characters: Replace text with XXXXX, prepend first + * four characters of original text. + * * If text length <= 4 characters: Apply SHA-256 hash. + * + * Generated from protobuf enum FIRST_FOUR_CHARACTERS = 10; + */ + const FIRST_FOUR_CHARACTERS = 10; + /** + * Masking expression for email addresses. + * The masking behavior is as follows: + * * Syntax-valid email address: Replace username with XXXXX. For example, + * cloudysanfrancisco@gmail.com becomes XXXXX@gmail.com. + * * Syntax-invalid email address: Apply SHA-256 hash. + * For more information, see [Email + * mask](https://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options). + * + * Generated from protobuf enum EMAIL_MASK = 12; + */ + const EMAIL_MASK = 12; + /** + * Masking expression to only show the year of `Date`, + * `DateTime` and `TimeStamp`. For example, with the + * year 2076: + * * DATE : 2076-01-01 + * * DATETIME : 2076-01-01T00:00:00 + * * TIMESTAMP : 2076-01-01 00:00:00 UTC + * Truncation occurs according to the UTC time zone. To change this, adjust + * the default time zone using the `time_zone` system variable. + * For more information, see the System + * variables reference. + * + * Generated from protobuf enum DATE_YEAR_MASK = 13; + */ + const DATE_YEAR_MASK = 13; + + private static $valueToName = [ + self::PREDEFINED_EXPRESSION_UNSPECIFIED => 'PREDEFINED_EXPRESSION_UNSPECIFIED', + self::SHA256 => 'SHA256', + self::ALWAYS_NULL => 'ALWAYS_NULL', + self::DEFAULT_MASKING_VALUE => 'DEFAULT_MASKING_VALUE', + self::LAST_FOUR_CHARACTERS => 'LAST_FOUR_CHARACTERS', + self::FIRST_FOUR_CHARACTERS => 'FIRST_FOUR_CHARACTERS', + self::EMAIL_MASK => 'EMAIL_MASK', + self::DATE_YEAR_MASK => 'DATE_YEAR_MASK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PredefinedExpression::class, \Google\Cloud\BigQuery\DataPolicies\V1\DataMaskingPolicy_PredefinedExpression::class); + diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataPolicy.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataPolicy.php new file mode 100644 index 000000000000..dd24973d3fd5 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataPolicy.php @@ -0,0 +1,234 @@ +google.cloud.bigquery.datapolicies.v1.DataPolicy + */ +class DataPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Resource name of this data policy, in the format of + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Type of data policy. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataPolicy.DataPolicyType data_policy_type = 2; + */ + protected $data_policy_type = 0; + /** + * User-assigned (human readable) ID of the data policy that needs to be + * unique within a project. Used as {data_policy_id} in part of the resource + * name. + * + * Generated from protobuf field string data_policy_id = 3; + */ + protected $data_policy_id = ''; + protected $matching_label; + protected $policy; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $policy_tag + * Policy tag resource name, in the format of + * `projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`. + * @type \Google\Cloud\BigQuery\DataPolicies\V1\DataMaskingPolicy $data_masking_policy + * The data masking policy that specifies the data masking rule to use. + * @type string $name + * Output only. Resource name of this data policy, in the format of + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * @type int $data_policy_type + * Type of data policy. + * @type string $data_policy_id + * User-assigned (human readable) ID of the data policy that needs to be + * unique within a project. Used as {data_policy_id} in part of the resource + * name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datapolicies\V1\Datapolicy::initOnce(); + parent::__construct($data); + } + + /** + * Policy tag resource name, in the format of + * `projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`. + * + * Generated from protobuf field string policy_tag = 4; + * @return string + */ + public function getPolicyTag() + { + return $this->readOneof(4); + } + + public function hasPolicyTag() + { + return $this->hasOneof(4); + } + + /** + * Policy tag resource name, in the format of + * `projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`. + * + * Generated from protobuf field string policy_tag = 4; + * @param string $var + * @return $this + */ + public function setPolicyTag($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * The data masking policy that specifies the data masking rule to use. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataMaskingPolicy data_masking_policy = 5; + * @return \Google\Cloud\BigQuery\DataPolicies\V1\DataMaskingPolicy|null + */ + public function getDataMaskingPolicy() + { + return $this->readOneof(5); + } + + public function hasDataMaskingPolicy() + { + return $this->hasOneof(5); + } + + /** + * The data masking policy that specifies the data masking rule to use. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataMaskingPolicy data_masking_policy = 5; + * @param \Google\Cloud\BigQuery\DataPolicies\V1\DataMaskingPolicy $var + * @return $this + */ + public function setDataMaskingPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataPolicies\V1\DataMaskingPolicy::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Output only. Resource name of this data policy, in the format of + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Resource name of this data policy, in the format of + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Type of data policy. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataPolicy.DataPolicyType data_policy_type = 2; + * @return int + */ + public function getDataPolicyType() + { + return $this->data_policy_type; + } + + /** + * Type of data policy. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataPolicy.DataPolicyType data_policy_type = 2; + * @param int $var + * @return $this + */ + public function setDataPolicyType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy\DataPolicyType::class); + $this->data_policy_type = $var; + + return $this; + } + + /** + * User-assigned (human readable) ID of the data policy that needs to be + * unique within a project. Used as {data_policy_id} in part of the resource + * name. + * + * Generated from protobuf field string data_policy_id = 3; + * @return string + */ + public function getDataPolicyId() + { + return $this->data_policy_id; + } + + /** + * User-assigned (human readable) ID of the data policy that needs to be + * unique within a project. Used as {data_policy_id} in part of the resource + * name. + * + * Generated from protobuf field string data_policy_id = 3; + * @param string $var + * @return $this + */ + public function setDataPolicyId($var) + { + GPBUtil::checkString($var, True); + $this->data_policy_id = $var; + + return $this; + } + + /** + * @return string + */ + public function getMatchingLabel() + { + return $this->whichOneof("matching_label"); + } + + /** + * @return string + */ + public function getPolicy() + { + return $this->whichOneof("policy"); + } + +} + diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataPolicy/DataPolicyType.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataPolicy/DataPolicyType.php new file mode 100644 index 000000000000..0f431ea3e887 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DataPolicy/DataPolicyType.php @@ -0,0 +1,65 @@ +google.cloud.bigquery.datapolicies.v1.DataPolicy.DataPolicyType + */ +class DataPolicyType +{ + /** + * Default value for the data policy type. This should not be used. + * + * Generated from protobuf enum DATA_POLICY_TYPE_UNSPECIFIED = 0; + */ + const DATA_POLICY_TYPE_UNSPECIFIED = 0; + /** + * Used to create a data policy for column-level security, without data + * masking. + * + * Generated from protobuf enum COLUMN_LEVEL_SECURITY_POLICY = 3; + */ + const COLUMN_LEVEL_SECURITY_POLICY = 3; + /** + * Used to create a data policy for data masking. + * + * Generated from protobuf enum DATA_MASKING_POLICY = 2; + */ + const DATA_MASKING_POLICY = 2; + + private static $valueToName = [ + self::DATA_POLICY_TYPE_UNSPECIFIED => 'DATA_POLICY_TYPE_UNSPECIFIED', + self::COLUMN_LEVEL_SECURITY_POLICY => 'COLUMN_LEVEL_SECURITY_POLICY', + self::DATA_MASKING_POLICY => 'DATA_MASKING_POLICY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DataPolicyType::class, \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy_DataPolicyType::class); + diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DeleteDataPolicyRequest.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DeleteDataPolicyRequest.php new file mode 100644 index 000000000000..753de5ead174 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/DeleteDataPolicyRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.datapolicies.v1.DeleteDataPolicyRequest + */ +class DeleteDataPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the data policy to delete. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the data policy to delete. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. Please see + * {@see DataPolicyServiceClient::dataPolicyName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataPolicies\V1\DeleteDataPolicyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the data policy to delete. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datapolicies\V1\Datapolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the data policy to delete. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the data policy to delete. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/GetDataPolicyRequest.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/GetDataPolicyRequest.php new file mode 100644 index 000000000000..8e6aa8262f60 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/GetDataPolicyRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.datapolicies.v1.GetDataPolicyRequest + */ +class GetDataPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the requested data policy. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the requested data policy. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. Please see + * {@see DataPolicyServiceClient::dataPolicyName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataPolicies\V1\GetDataPolicyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the requested data policy. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datapolicies\V1\Datapolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the requested data policy. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the requested data policy. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/ListDataPoliciesRequest.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/ListDataPoliciesRequest.php new file mode 100644 index 000000000000..ec8bb56c49dc --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/ListDataPoliciesRequest.php @@ -0,0 +1,228 @@ +google.cloud.bigquery.datapolicies.v1.ListDataPoliciesRequest + */ +class ListDataPoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the project for which to list data policies. + * Format is `projects/{project_number}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of data policies to return. Must be a value between 1 + * and 1000. + * If not set, defaults to 50. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The `nextPageToken` value returned from a previous list request, if any. If + * not set, defaults to an empty string. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filters the data policies by policy tags that they + * are associated with. Currently filter only supports + * "policy_tag" based filtering and OR based predicates. Sample + * filter can be "policy_tag: + * projects/1/locations/us/taxonomies/2/policyTags/3". + * You may also use wildcard such as "policy_tag: + * projects/1/locations/us/taxonomies/2*". Please note that OR predicates + * cannot be used with wildcard filters. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + + /** + * @param string $parent Required. Resource name of the project for which to list data policies. + * Format is `projects/{project_number}/locations/{location_id}`. Please see + * {@see DataPolicyServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataPolicies\V1\ListDataPoliciesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the project for which to list data policies. + * Format is `projects/{project_number}/locations/{location_id}`. + * @type int $page_size + * The maximum number of data policies to return. Must be a value between 1 + * and 1000. + * If not set, defaults to 50. + * @type string $page_token + * The `nextPageToken` value returned from a previous list request, if any. If + * not set, defaults to an empty string. + * @type string $filter + * Filters the data policies by policy tags that they + * are associated with. Currently filter only supports + * "policy_tag" based filtering and OR based predicates. Sample + * filter can be "policy_tag: + * projects/1/locations/us/taxonomies/2/policyTags/3". + * You may also use wildcard such as "policy_tag: + * projects/1/locations/us/taxonomies/2*". Please note that OR predicates + * cannot be used with wildcard filters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datapolicies\V1\Datapolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the project for which to list data policies. + * Format is `projects/{project_number}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource name of the project for which to list data policies. + * Format is `projects/{project_number}/locations/{location_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of data policies to return. Must be a value between 1 + * and 1000. + * If not set, defaults to 50. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of data policies to return. Must be a value between 1 + * and 1000. + * If not set, defaults to 50. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The `nextPageToken` value returned from a previous list request, if any. If + * not set, defaults to an empty string. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The `nextPageToken` value returned from a previous list request, if any. If + * not set, defaults to an empty string. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filters the data policies by policy tags that they + * are associated with. Currently filter only supports + * "policy_tag" based filtering and OR based predicates. Sample + * filter can be "policy_tag: + * projects/1/locations/us/taxonomies/2/policyTags/3". + * You may also use wildcard such as "policy_tag: + * projects/1/locations/us/taxonomies/2*". Please note that OR predicates + * cannot be used with wildcard filters. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filters the data policies by policy tags that they + * are associated with. Currently filter only supports + * "policy_tag" based filtering and OR based predicates. Sample + * filter can be "policy_tag: + * projects/1/locations/us/taxonomies/2/policyTags/3". + * You may also use wildcard such as "policy_tag: + * projects/1/locations/us/taxonomies/2*". Please note that OR predicates + * cannot be used with wildcard filters. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/ListDataPoliciesResponse.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/ListDataPoliciesResponse.php new file mode 100644 index 000000000000..e23d7ae0d58e --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/ListDataPoliciesResponse.php @@ -0,0 +1,105 @@ +google.cloud.bigquery.datapolicies.v1.ListDataPoliciesResponse + */ +class ListDataPoliciesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Data policies that belong to the requested project. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datapolicies.v1.DataPolicy data_policies = 1; + */ + private $data_policies; + /** + * Token used to retrieve the next page of results, or empty if there are no + * more results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy>|\Google\Protobuf\Internal\RepeatedField $data_policies + * Data policies that belong to the requested project. + * @type string $next_page_token + * Token used to retrieve the next page of results, or empty if there are no + * more results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datapolicies\V1\Datapolicy::initOnce(); + parent::__construct($data); + } + + /** + * Data policies that belong to the requested project. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datapolicies.v1.DataPolicy data_policies = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPolicies() + { + return $this->data_policies; + } + + /** + * Data policies that belong to the requested project. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datapolicies.v1.DataPolicy data_policies = 1; + * @param array<\Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy::class); + $this->data_policies = $arr; + + return $this; + } + + /** + * Token used to retrieve the next page of results, or empty if there are no + * more results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token used to retrieve the next page of results, or empty if there are no + * more results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/RenameDataPolicyRequest.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/RenameDataPolicyRequest.php new file mode 100644 index 000000000000..cb59f030aab8 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/RenameDataPolicyRequest.php @@ -0,0 +1,121 @@ +google.cloud.bigquery.datapolicies.v1.RenameDataPolicyRequest + */ +class RenameDataPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the data policy to rename. The format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The new data policy id. + * + * Generated from protobuf field string new_data_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $new_data_policy_id = ''; + + /** + * @param string $name Required. Resource name of the data policy to rename. The format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}` + * @param string $newDataPolicyId Required. The new data policy id. + * + * @return \Google\Cloud\BigQuery\DataPolicies\V1\RenameDataPolicyRequest + * + * @experimental + */ + public static function build(string $name, string $newDataPolicyId): self + { + return (new self()) + ->setName($name) + ->setNewDataPolicyId($newDataPolicyId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the data policy to rename. The format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}` + * @type string $new_data_policy_id + * Required. The new data policy id. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datapolicies\V1\Datapolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the data policy to rename. The format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the data policy to rename. The format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The new data policy id. + * + * Generated from protobuf field string new_data_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNewDataPolicyId() + { + return $this->new_data_policy_id; + } + + /** + * Required. The new data policy id. + * + * Generated from protobuf field string new_data_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNewDataPolicyId($var) + { + GPBUtil::checkString($var, True); + $this->new_data_policy_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/UpdateDataPolicyRequest.php b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/UpdateDataPolicyRequest.php new file mode 100644 index 000000000000..3bad7e59018b --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/proto/src/Google/Cloud/BigQuery/DataPolicies/V1/UpdateDataPolicyRequest.php @@ -0,0 +1,168 @@ +google.cloud.bigquery.datapolicies.v1.UpdateDataPolicyRequest + */ +class UpdateDataPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Update the data policy's metadata. + * The target data policy is determined by the `name` field. + * Other fields are updated to the specified values based on the field masks. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataPolicy data_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_policy = null; + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * If not set, defaults to all of the fields that are allowed to update. + * Updates to the `name` and `dataPolicyId` fields are not allowed. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy $dataPolicy Required. Update the data policy's metadata. + * + * The target data policy is determined by the `name` field. + * Other fields are updated to the specified values based on the field masks. + * @param \Google\Protobuf\FieldMask $updateMask The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * If not set, defaults to all of the fields that are allowed to update. + * + * Updates to the `name` and `dataPolicyId` fields are not allowed. + * + * @return \Google\Cloud\BigQuery\DataPolicies\V1\UpdateDataPolicyRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy $dataPolicy, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDataPolicy($dataPolicy) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy $data_policy + * Required. Update the data policy's metadata. + * The target data policy is determined by the `name` field. + * Other fields are updated to the specified values based on the field masks. + * @type \Google\Protobuf\FieldMask $update_mask + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * If not set, defaults to all of the fields that are allowed to update. + * Updates to the `name` and `dataPolicyId` fields are not allowed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datapolicies\V1\Datapolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Update the data policy's metadata. + * The target data policy is determined by the `name` field. + * Other fields are updated to the specified values based on the field masks. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataPolicy data_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy|null + */ + public function getDataPolicy() + { + return $this->data_policy; + } + + public function hasDataPolicy() + { + return isset($this->data_policy); + } + + public function clearDataPolicy() + { + unset($this->data_policy); + } + + /** + * Required. Update the data policy's metadata. + * The target data policy is determined by the `name` field. + * Other fields are updated to the specified values based on the field masks. + * + * Generated from protobuf field .google.cloud.bigquery.datapolicies.v1.DataPolicy data_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy $var + * @return $this + */ + public function setDataPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy::class); + $this->data_policy = $var; + + return $this; + } + + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * If not set, defaults to all of the fields that are allowed to update. + * Updates to the `name` and `dataPolicyId` fields are not allowed. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * If not set, defaults to all of the fields that are allowed to update. + * Updates to the `name` and `dataPolicyId` fields are not allowed. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/create_data_policy.php b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/create_data_policy.php new file mode 100644 index 000000000000..8b28f612f640 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/create_data_policy.php @@ -0,0 +1,75 @@ +setParent($formattedParent) + ->setDataPolicy($dataPolicy); + + // Call the API and handle any network failures. + try { + /** @var DataPolicy $response */ + $response = $dataPolicyServiceClient->createDataPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DataPolicyServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + create_data_policy_sample($formattedParent); +} +// [END bigquerydatapolicy_v1_generated_DataPolicyService_CreateDataPolicy_sync] diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/delete_data_policy.php b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/delete_data_policy.php new file mode 100644 index 000000000000..d73d33365f40 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/delete_data_policy.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $dataPolicyServiceClient->deleteDataPolicy($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DataPolicyServiceClient::dataPolicyName( + '[PROJECT]', + '[LOCATION]', + '[DATA_POLICY]' + ); + + delete_data_policy_sample($formattedName); +} +// [END bigquerydatapolicy_v1_generated_DataPolicyService_DeleteDataPolicy_sync] diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/get_data_policy.php b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/get_data_policy.php new file mode 100644 index 000000000000..e2eb490b924f --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/get_data_policy.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DataPolicy $response */ + $response = $dataPolicyServiceClient->getDataPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DataPolicyServiceClient::dataPolicyName( + '[PROJECT]', + '[LOCATION]', + '[DATA_POLICY]' + ); + + get_data_policy_sample($formattedName); +} +// [END bigquerydatapolicy_v1_generated_DataPolicyService_GetDataPolicy_sync] diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/get_iam_policy.php b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..bc045d514fd1 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/get_iam_policy.php @@ -0,0 +1,71 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $dataPolicyServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END bigquerydatapolicy_v1_generated_DataPolicyService_GetIamPolicy_sync] diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/list_data_policies.php b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/list_data_policies.php new file mode 100644 index 000000000000..827e2ff72c7d --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/list_data_policies.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dataPolicyServiceClient->listDataPolicies($request); + + /** @var DataPolicy $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DataPolicyServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_data_policies_sample($formattedParent); +} +// [END bigquerydatapolicy_v1_generated_DataPolicyService_ListDataPolicies_sync] diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/rename_data_policy.php b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/rename_data_policy.php new file mode 100644 index 000000000000..efb6587c14d7 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/rename_data_policy.php @@ -0,0 +1,74 @@ +setName($name) + ->setNewDataPolicyId($newDataPolicyId); + + // Call the API and handle any network failures. + try { + /** @var DataPolicy $response */ + $response = $dataPolicyServiceClient->renameDataPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $newDataPolicyId = '[NEW_DATA_POLICY_ID]'; + + rename_data_policy_sample($name, $newDataPolicyId); +} +// [END bigquerydatapolicy_v1_generated_DataPolicyService_RenameDataPolicy_sync] diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/set_iam_policy.php b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..e680348581ab --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/set_iam_policy.php @@ -0,0 +1,73 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $dataPolicyServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END bigquerydatapolicy_v1_generated_DataPolicyService_SetIamPolicy_sync] diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/test_iam_permissions.php b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..8e8f3cdfc0b7 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $dataPolicyServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END bigquerydatapolicy_v1_generated_DataPolicyService_TestIamPermissions_sync] diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/update_data_policy.php b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/update_data_policy.php new file mode 100644 index 000000000000..54d136b98c09 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/samples/V1/DataPolicyServiceClient/update_data_policy.php @@ -0,0 +1,60 @@ +setDataPolicy($dataPolicy); + + // Call the API and handle any network failures. + try { + /** @var DataPolicy $response */ + $response = $dataPolicyServiceClient->updateDataPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigquerydatapolicy_v1_generated_DataPolicyService_UpdateDataPolicy_sync] diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/Client/DataPolicyServiceClient.php b/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/Client/DataPolicyServiceClient.php new file mode 100644 index 000000000000..23165bd4e751 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/Client/DataPolicyServiceClient.php @@ -0,0 +1,489 @@ + createDataPolicyAsync(CreateDataPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteDataPolicyAsync(DeleteDataPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDataPolicyAsync(GetDataPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDataPoliciesAsync(ListDataPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface renameDataPolicyAsync(RenameDataPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDataPolicyAsync(UpdateDataPolicyRequest $request, array $optionalArgs = []) + */ +final class DataPolicyServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.bigquery.datapolicies.v1.DataPolicyService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'bigquerydatapolicy.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'bigquerydatapolicy.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/data_policy_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/data_policy_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/data_policy_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/data_policy_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a data_policy + * resource. + * + * @param string $project + * @param string $location + * @param string $dataPolicy + * + * @return string The formatted data_policy resource. + */ + public static function dataPolicyName(string $project, string $location, string $dataPolicy): string + { + return self::getPathTemplate('dataPolicy')->render([ + 'project' => $project, + 'location' => $location, + 'data_policy' => $dataPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - dataPolicy: projects/{project}/locations/{location}/dataPolicies/{data_policy} + * - location: projects/{project}/locations/{location} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'bigquerydatapolicy.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new data policy under a project with the given `dataPolicyId` + * (used as the display name), policy tag, and data policy type. + * + * The async variant is {@see DataPolicyServiceClient::createDataPolicyAsync()} . + * + * @example samples/V1/DataPolicyServiceClient/create_data_policy.php + * + * @param CreateDataPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function createDataPolicy(CreateDataPolicyRequest $request, array $callOptions = []): DataPolicy + { + return $this->startApiCall('CreateDataPolicy', $request, $callOptions)->wait(); + } + + /** + * Deletes the data policy specified by its resource name. + * + * The async variant is {@see DataPolicyServiceClient::deleteDataPolicyAsync()} . + * + * @example samples/V1/DataPolicyServiceClient/delete_data_policy.php + * + * @param DeleteDataPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteDataPolicy(DeleteDataPolicyRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteDataPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets the data policy specified by its resource name. + * + * The async variant is {@see DataPolicyServiceClient::getDataPolicyAsync()} . + * + * @example samples/V1/DataPolicyServiceClient/get_data_policy.php + * + * @param GetDataPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDataPolicy(GetDataPolicyRequest $request, array $callOptions = []): DataPolicy + { + return $this->startApiCall('GetDataPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets the IAM policy for the specified data policy. + * + * The async variant is {@see DataPolicyServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/DataPolicyServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * List all of the data policies in the specified parent project. + * + * The async variant is {@see DataPolicyServiceClient::listDataPoliciesAsync()} . + * + * @example samples/V1/DataPolicyServiceClient/list_data_policies.php + * + * @param ListDataPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDataPolicies(ListDataPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDataPolicies', $request, $callOptions); + } + + /** + * Renames the id (display name) of the specified data policy. + * + * The async variant is {@see DataPolicyServiceClient::renameDataPolicyAsync()} . + * + * @example samples/V1/DataPolicyServiceClient/rename_data_policy.php + * + * @param RenameDataPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function renameDataPolicy(RenameDataPolicyRequest $request, array $callOptions = []): DataPolicy + { + return $this->startApiCall('RenameDataPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the IAM policy for the specified data policy. + * + * The async variant is {@see DataPolicyServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/DataPolicyServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns the caller's permission on the specified data policy resource. + * + * The async variant is {@see DataPolicyServiceClient::testIamPermissionsAsync()} . + * + * @example samples/V1/DataPolicyServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates the metadata for an existing data policy. The target data policy + * can be specified by the resource name. + * + * The async variant is {@see DataPolicyServiceClient::updateDataPolicyAsync()} . + * + * @example samples/V1/DataPolicyServiceClient/update_data_policy.php + * + * @param UpdateDataPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDataPolicy(UpdateDataPolicyRequest $request, array $callOptions = []): DataPolicy + { + return $this->startApiCall('UpdateDataPolicy', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..1d84ac5f7a4d --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/gapic_metadata.json @@ -0,0 +1,63 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.bigquery.datapolicies.v1", + "libraryPackage": "Google\\Cloud\\BigQuery\\DataPolicies\\V1", + "services": { + "DataPolicyService": { + "clients": { + "grpc": { + "libraryClient": "DataPolicyServiceGapicClient", + "rpcs": { + "CreateDataPolicy": { + "methods": [ + "createDataPolicy" + ] + }, + "DeleteDataPolicy": { + "methods": [ + "deleteDataPolicy" + ] + }, + "GetDataPolicy": { + "methods": [ + "getDataPolicy" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "ListDataPolicies": { + "methods": [ + "listDataPolicies" + ] + }, + "RenameDataPolicy": { + "methods": [ + "renameDataPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateDataPolicy": { + "methods": [ + "updateDataPolicy" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/resources/data_policy_service_client_config.json b/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/resources/data_policy_service_client_config.json new file mode 100644 index 000000000000..c403ed0aa2f4 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/resources/data_policy_service_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.bigquery.datapolicies.v1.DataPolicyService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateDataPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteDataPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDataPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDataPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RenameDataPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDataPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/resources/data_policy_service_descriptor_config.php b/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/resources/data_policy_service_descriptor_config.php new file mode 100644 index 000000000000..adc115ae66f4 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/resources/data_policy_service_descriptor_config.php @@ -0,0 +1,149 @@ + [ + 'google.cloud.bigquery.datapolicies.v1.DataPolicyService' => [ + 'CreateDataPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDataPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'ListDataPolicies' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataPolicies', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataPolicies\V1\ListDataPoliciesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RenameDataPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateDataPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataPolicies\V1\DataPolicy', + 'headerParams' => [ + [ + 'keyName' => 'data_policy.name', + 'fieldAccessors' => [ + 'getDataPolicy', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'dataPolicy' => 'projects/{project}/locations/{location}/dataPolicies/{data_policy}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/resources/data_policy_service_rest_client_config.php b/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/resources/data_policy_service_rest_client_config.php new file mode 100644 index 000000000000..ea0fae9fef3c --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/src/V1/resources/data_policy_service_rest_client_config.php @@ -0,0 +1,135 @@ + [ + 'google.cloud.bigquery.datapolicies.v1.DataPolicyService' => [ + 'CreateDataPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/dataPolicies', + 'body' => 'data_policy', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataPolicy' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataPolicies/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDataPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataPolicies/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataPolicies/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'ListDataPolicies' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/dataPolicies', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RenameDataPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataPolicies/*}:rename', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataPolicies/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataPolicies/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateDataPolicy' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{data_policy.name=projects/*/locations/*/dataPolicies/*}', + 'body' => 'data_policy', + 'placeholders' => [ + 'data_policy.name' => [ + 'getters' => [ + 'getDataPolicy', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/BigQueryDataPolicies/v1/tests/Unit/V1/Client/DataPolicyServiceClientTest.php b/owl-bot-staging/BigQueryDataPolicies/v1/tests/Unit/V1/Client/DataPolicyServiceClientTest.php new file mode 100644 index 000000000000..7d6570c772a0 --- /dev/null +++ b/owl-bot-staging/BigQueryDataPolicies/v1/tests/Unit/V1/Client/DataPolicyServiceClientTest.php @@ -0,0 +1,734 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DataPolicyServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DataPolicyServiceClient($options); + } + + /** @test */ + public function createDataPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $policyTag = 'policyTag1593879309'; + $name = 'name3373707'; + $dataPolicyId = 'dataPolicyId456934643'; + $expectedResponse = new DataPolicy(); + $expectedResponse->setPolicyTag($policyTag); + $expectedResponse->setName($name); + $expectedResponse->setDataPolicyId($dataPolicyId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataPolicy = new DataPolicy(); + $request = (new CreateDataPolicyRequest()) + ->setParent($formattedParent) + ->setDataPolicy($dataPolicy); + $response = $gapicClient->createDataPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datapolicies.v1.DataPolicyService/CreateDataPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getDataPolicy(); + $this->assertProtobufEquals($dataPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDataPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataPolicy = new DataPolicy(); + $request = (new CreateDataPolicyRequest()) + ->setParent($formattedParent) + ->setDataPolicy($dataPolicy); + try { + $gapicClient->createDataPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDataPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataPolicyName('[PROJECT]', '[LOCATION]', '[DATA_POLICY]'); + $request = (new DeleteDataPolicyRequest()) + ->setName($formattedName); + $gapicClient->deleteDataPolicy($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datapolicies.v1.DataPolicyService/DeleteDataPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDataPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataPolicyName('[PROJECT]', '[LOCATION]', '[DATA_POLICY]'); + $request = (new DeleteDataPolicyRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteDataPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $policyTag = 'policyTag1593879309'; + $name2 = 'name2-1052831874'; + $dataPolicyId = 'dataPolicyId456934643'; + $expectedResponse = new DataPolicy(); + $expectedResponse->setPolicyTag($policyTag); + $expectedResponse->setName($name2); + $expectedResponse->setDataPolicyId($dataPolicyId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataPolicyName('[PROJECT]', '[LOCATION]', '[DATA_POLICY]'); + $request = (new GetDataPolicyRequest()) + ->setName($formattedName); + $response = $gapicClient->getDataPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datapolicies.v1.DataPolicyService/GetDataPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataPolicyName('[PROJECT]', '[LOCATION]', '[DATA_POLICY]'); + $request = (new GetDataPolicyRequest()) + ->setName($formattedName); + try { + $gapicClient->getDataPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datapolicies.v1.DataPolicyService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataPoliciesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataPoliciesElement = new DataPolicy(); + $dataPolicies = [ + $dataPoliciesElement, + ]; + $expectedResponse = new ListDataPoliciesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataPolicies($dataPolicies); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListDataPoliciesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listDataPolicies($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataPolicies()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datapolicies.v1.DataPolicyService/ListDataPolicies', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataPoliciesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListDataPoliciesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listDataPolicies($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renameDataPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $policyTag = 'policyTag1593879309'; + $name2 = 'name2-1052831874'; + $dataPolicyId = 'dataPolicyId456934643'; + $expectedResponse = new DataPolicy(); + $expectedResponse->setPolicyTag($policyTag); + $expectedResponse->setName($name2); + $expectedResponse->setDataPolicyId($dataPolicyId); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $newDataPolicyId = 'newDataPolicyId-1742039694'; + $request = (new RenameDataPolicyRequest()) + ->setName($name) + ->setNewDataPolicyId($newDataPolicyId); + $response = $gapicClient->renameDataPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datapolicies.v1.DataPolicyService/RenameDataPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getNewDataPolicyId(); + $this->assertProtobufEquals($newDataPolicyId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renameDataPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $newDataPolicyId = 'newDataPolicyId-1742039694'; + $request = (new RenameDataPolicyRequest()) + ->setName($name) + ->setNewDataPolicyId($newDataPolicyId); + try { + $gapicClient->renameDataPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datapolicies.v1.DataPolicyService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datapolicies.v1.DataPolicyService/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDataPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $policyTag = 'policyTag1593879309'; + $name = 'name3373707'; + $dataPolicyId = 'dataPolicyId456934643'; + $expectedResponse = new DataPolicy(); + $expectedResponse->setPolicyTag($policyTag); + $expectedResponse->setName($name); + $expectedResponse->setDataPolicyId($dataPolicyId); + $transport->addResponse($expectedResponse); + // Mock request + $dataPolicy = new DataPolicy(); + $request = (new UpdateDataPolicyRequest()) + ->setDataPolicy($dataPolicy); + $response = $gapicClient->updateDataPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datapolicies.v1.DataPolicyService/UpdateDataPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getDataPolicy(); + $this->assertProtobufEquals($dataPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDataPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $dataPolicy = new DataPolicy(); + $request = (new UpdateDataPolicyRequest()) + ->setDataPolicy($dataPolicy); + try { + $gapicClient->updateDataPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDataPolicyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $policyTag = 'policyTag1593879309'; + $name = 'name3373707'; + $dataPolicyId = 'dataPolicyId456934643'; + $expectedResponse = new DataPolicy(); + $expectedResponse->setPolicyTag($policyTag); + $expectedResponse->setName($name); + $expectedResponse->setDataPolicyId($dataPolicyId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataPolicy = new DataPolicy(); + $request = (new CreateDataPolicyRequest()) + ->setParent($formattedParent) + ->setDataPolicy($dataPolicy); + $response = $gapicClient->createDataPolicyAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datapolicies.v1.DataPolicyService/CreateDataPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getDataPolicy(); + $this->assertProtobufEquals($dataPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Datatransfer/V1/Datatransfer.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Datatransfer/V1/Datatransfer.php new file mode 100644 index 000000000000..f585538c5380 Binary files /dev/null and b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Datatransfer/V1/Datatransfer.php differ diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Datatransfer/V1/Transfer.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Datatransfer/V1/Transfer.php new file mode 100644 index 000000000000..385f1d373ad2 Binary files /dev/null and b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Datatransfer/V1/Transfer.php differ diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/CheckValidCredsRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/CheckValidCredsRequest.php new file mode 100644 index 000000000000..afd08a0f7a9d --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/CheckValidCredsRequest.php @@ -0,0 +1,96 @@ +google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + */ +class CheckValidCredsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. Please see + * {@see DataTransferServiceClient::dataSourceName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\CheckValidCredsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/CheckValidCredsResponse.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/CheckValidCredsResponse.php new file mode 100644 index 000000000000..ed8cc0aece07 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/CheckValidCredsResponse.php @@ -0,0 +1,67 @@ +google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + */ +class CheckValidCredsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * If set to `true`, the credentials exist and are valid. + * + * Generated from protobuf field bool has_valid_creds = 1; + */ + protected $has_valid_creds = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $has_valid_creds + * If set to `true`, the credentials exist and are valid. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * If set to `true`, the credentials exist and are valid. + * + * Generated from protobuf field bool has_valid_creds = 1; + * @return bool + */ + public function getHasValidCreds() + { + return $this->has_valid_creds; + } + + /** + * If set to `true`, the credentials exist and are valid. + * + * Generated from protobuf field bool has_valid_creds = 1; + * @param bool $var + * @return $this + */ + public function setHasValidCreds($var) + { + GPBUtil::checkBool($var); + $this->has_valid_creds = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/CreateTransferConfigRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/CreateTransferConfigRequest.php new file mode 100644 index 000000000000..ce1cd4587f87 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/CreateTransferConfigRequest.php @@ -0,0 +1,403 @@ +google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + */ +class CreateTransferConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The BigQuery project id where the transfer configuration should + * be created. Must be in the format + * projects/{project_id}/locations/{location_id} or projects/{project_id}. If + * specified location and location of the destination bigquery dataset do not + * match - the request will fail. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Data transfer configuration to create. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferConfig transfer_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $transfer_config = null; + /** + * Deprecated: Authorization code was required when + * `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + * in any data sources. Use `version_info` instead. + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + * and new credentials are needed, as indicated by `CheckValidCreds`. In order + * to obtain authorization_code, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * create the transfer config. + * + * Generated from protobuf field string authorization_code = 3 [deprecated = true]; + * @deprecated + */ + protected $authorization_code = ''; + /** + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials + * are needed, as indicated by `CheckValidCreds`. In order to obtain version + * info, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * create the transfer config. + * + * Generated from protobuf field string version_info = 5; + */ + protected $version_info = ''; + /** + * Optional service account email. If this field is set, the transfer config + * will be created with this service account's credentials. It requires that + * the requesting user calling this API has permissions to act as this service + * account. + * Note that not all data sources support service account credentials when + * creating a transfer config. For the latest list of data sources, read about + * [using service + * accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). + * + * Generated from protobuf field string service_account_name = 6; + */ + protected $service_account_name = ''; + + /** + * @param string $parent Required. The BigQuery project id where the transfer configuration should + * be created. Must be in the format + * projects/{project_id}/locations/{location_id} or projects/{project_id}. If + * specified location and location of the destination bigquery dataset do not + * match - the request will fail. Please see + * {@see DataTransferServiceClient::projectName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig $transferConfig Required. Data transfer configuration to create. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\CreateTransferConfigRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig $transferConfig): self + { + return (new self()) + ->setParent($parent) + ->setTransferConfig($transferConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The BigQuery project id where the transfer configuration should + * be created. Must be in the format + * projects/{project_id}/locations/{location_id} or projects/{project_id}. If + * specified location and location of the destination bigquery dataset do not + * match - the request will fail. + * @type \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig $transfer_config + * Required. Data transfer configuration to create. + * @type string $authorization_code + * Deprecated: Authorization code was required when + * `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + * in any data sources. Use `version_info` instead. + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + * and new credentials are needed, as indicated by `CheckValidCreds`. In order + * to obtain authorization_code, make a request to the following URL: + *
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     *           
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * create the transfer config. + * @type string $version_info + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials + * are needed, as indicated by `CheckValidCreds`. In order to obtain version + * info, make a request to the following URL: + *
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     *           
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * create the transfer config. + * @type string $service_account_name + * Optional service account email. If this field is set, the transfer config + * will be created with this service account's credentials. It requires that + * the requesting user calling this API has permissions to act as this service + * account. + * Note that not all data sources support service account credentials when + * creating a transfer config. For the latest list of data sources, read about + * [using service + * accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. The BigQuery project id where the transfer configuration should + * be created. Must be in the format + * projects/{project_id}/locations/{location_id} or projects/{project_id}. If + * specified location and location of the destination bigquery dataset do not + * match - the request will fail. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The BigQuery project id where the transfer configuration should + * be created. Must be in the format + * projects/{project_id}/locations/{location_id} or projects/{project_id}. If + * specified location and location of the destination bigquery dataset do not + * match - the request will fail. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Data transfer configuration to create. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferConfig transfer_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig|null + */ + public function getTransferConfig() + { + return $this->transfer_config; + } + + public function hasTransferConfig() + { + return isset($this->transfer_config); + } + + public function clearTransferConfig() + { + unset($this->transfer_config); + } + + /** + * Required. Data transfer configuration to create. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferConfig transfer_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig $var + * @return $this + */ + public function setTransferConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig::class); + $this->transfer_config = $var; + + return $this; + } + + /** + * Deprecated: Authorization code was required when + * `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + * in any data sources. Use `version_info` instead. + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + * and new credentials are needed, as indicated by `CheckValidCreds`. In order + * to obtain authorization_code, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * create the transfer config. + * + * Generated from protobuf field string authorization_code = 3 [deprecated = true]; + * @return string + * @deprecated + */ + public function getAuthorizationCode() + { + @trigger_error('authorization_code is deprecated.', E_USER_DEPRECATED); + return $this->authorization_code; + } + + /** + * Deprecated: Authorization code was required when + * `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + * in any data sources. Use `version_info` instead. + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + * and new credentials are needed, as indicated by `CheckValidCreds`. In order + * to obtain authorization_code, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * create the transfer config. + * + * Generated from protobuf field string authorization_code = 3 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setAuthorizationCode($var) + { + @trigger_error('authorization_code is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->authorization_code = $var; + + return $this; + } + + /** + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials + * are needed, as indicated by `CheckValidCreds`. In order to obtain version + * info, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * create the transfer config. + * + * Generated from protobuf field string version_info = 5; + * @return string + */ + public function getVersionInfo() + { + return $this->version_info; + } + + /** + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials + * are needed, as indicated by `CheckValidCreds`. In order to obtain version + * info, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * create the transfer config. + * + * Generated from protobuf field string version_info = 5; + * @param string $var + * @return $this + */ + public function setVersionInfo($var) + { + GPBUtil::checkString($var, True); + $this->version_info = $var; + + return $this; + } + + /** + * Optional service account email. If this field is set, the transfer config + * will be created with this service account's credentials. It requires that + * the requesting user calling this API has permissions to act as this service + * account. + * Note that not all data sources support service account credentials when + * creating a transfer config. For the latest list of data sources, read about + * [using service + * accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). + * + * Generated from protobuf field string service_account_name = 6; + * @return string + */ + public function getServiceAccountName() + { + return $this->service_account_name; + } + + /** + * Optional service account email. If this field is set, the transfer config + * will be created with this service account's credentials. It requires that + * the requesting user calling this API has permissions to act as this service + * account. + * Note that not all data sources support service account credentials when + * creating a transfer config. For the latest list of data sources, read about + * [using service + * accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). + * + * Generated from protobuf field string service_account_name = 6; + * @param string $var + * @return $this + */ + public function setServiceAccountName($var) + { + GPBUtil::checkString($var, True); + $this->service_account_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSource.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSource.php new file mode 100644 index 000000000000..830c728a8d39 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSource.php @@ -0,0 +1,721 @@ +google.cloud.bigquery.datatransfer.v1.DataSource + */ +class DataSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Data source resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Data source id. + * + * Generated from protobuf field string data_source_id = 2; + */ + protected $data_source_id = ''; + /** + * User friendly data source name. + * + * Generated from protobuf field string display_name = 3; + */ + protected $display_name = ''; + /** + * User friendly data source description string. + * + * Generated from protobuf field string description = 4; + */ + protected $description = ''; + /** + * Data source client id which should be used to receive refresh token. + * + * Generated from protobuf field string client_id = 5; + */ + protected $client_id = ''; + /** + * Api auth scopes for which refresh token needs to be obtained. These are + * scopes needed by a data source to prepare data and ingest them into + * BigQuery, e.g., https://www.googleapis.com/auth/bigquery + * + * Generated from protobuf field repeated string scopes = 6; + */ + private $scopes; + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferType transfer_type = 7 [deprecated = true]; + * @deprecated + */ + protected $transfer_type = 0; + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field bool supports_multiple_transfers = 8 [deprecated = true]; + * @deprecated + */ + protected $supports_multiple_transfers = false; + /** + * The number of seconds to wait for an update from the data source + * before the Data Transfer Service marks the transfer as FAILED. + * + * Generated from protobuf field int32 update_deadline_seconds = 9; + */ + protected $update_deadline_seconds = 0; + /** + * Default data transfer schedule. + * Examples of valid schedules include: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * + * Generated from protobuf field string default_schedule = 10; + */ + protected $default_schedule = ''; + /** + * Specifies whether the data source supports a user defined schedule, or + * operates on the default schedule. + * When set to `true`, user can override default schedule. + * + * Generated from protobuf field bool supports_custom_schedule = 11; + */ + protected $supports_custom_schedule = false; + /** + * Data source parameters. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.DataSourceParameter parameters = 12; + */ + private $parameters; + /** + * Url for the help document for this data source. + * + * Generated from protobuf field string help_url = 13; + */ + protected $help_url = ''; + /** + * Indicates the type of authorization. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType authorization_type = 14; + */ + protected $authorization_type = 0; + /** + * Specifies whether the data source supports automatic data refresh for the + * past few days, and how it's supported. + * For some data sources, data might not be complete until a few days later, + * so it's useful to refresh data automatically. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType data_refresh_type = 15; + */ + protected $data_refresh_type = 0; + /** + * Default data refresh window on days. + * Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`. + * + * Generated from protobuf field int32 default_data_refresh_window_days = 16; + */ + protected $default_data_refresh_window_days = 0; + /** + * Disables backfilling and manual run scheduling + * for the data source. + * + * Generated from protobuf field bool manual_runs_disabled = 17; + */ + protected $manual_runs_disabled = false; + /** + * The minimum interval for scheduler to schedule runs. + * + * Generated from protobuf field .google.protobuf.Duration minimum_schedule_interval = 18; + */ + protected $minimum_schedule_interval = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Data source resource name. + * @type string $data_source_id + * Data source id. + * @type string $display_name + * User friendly data source name. + * @type string $description + * User friendly data source description string. + * @type string $client_id + * Data source client id which should be used to receive refresh token. + * @type array|\Google\Protobuf\Internal\RepeatedField $scopes + * Api auth scopes for which refresh token needs to be obtained. These are + * scopes needed by a data source to prepare data and ingest them into + * BigQuery, e.g., https://www.googleapis.com/auth/bigquery + * @type int $transfer_type + * Deprecated. This field has no effect. + * @type bool $supports_multiple_transfers + * Deprecated. This field has no effect. + * @type int $update_deadline_seconds + * The number of seconds to wait for an update from the data source + * before the Data Transfer Service marks the transfer as FAILED. + * @type string $default_schedule + * Default data transfer schedule. + * Examples of valid schedules include: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * @type bool $supports_custom_schedule + * Specifies whether the data source supports a user defined schedule, or + * operates on the default schedule. + * When set to `true`, user can override default schedule. + * @type array<\Google\Cloud\BigQuery\DataTransfer\V1\DataSourceParameter>|\Google\Protobuf\Internal\RepeatedField $parameters + * Data source parameters. + * @type string $help_url + * Url for the help document for this data source. + * @type int $authorization_type + * Indicates the type of authorization. + * @type int $data_refresh_type + * Specifies whether the data source supports automatic data refresh for the + * past few days, and how it's supported. + * For some data sources, data might not be complete until a few days later, + * so it's useful to refresh data automatically. + * @type int $default_data_refresh_window_days + * Default data refresh window on days. + * Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`. + * @type bool $manual_runs_disabled + * Disables backfilling and manual run scheduling + * for the data source. + * @type \Google\Protobuf\Duration $minimum_schedule_interval + * The minimum interval for scheduler to schedule runs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Data source resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Data source resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Data source id. + * + * Generated from protobuf field string data_source_id = 2; + * @return string + */ + public function getDataSourceId() + { + return $this->data_source_id; + } + + /** + * Data source id. + * + * Generated from protobuf field string data_source_id = 2; + * @param string $var + * @return $this + */ + public function setDataSourceId($var) + { + GPBUtil::checkString($var, True); + $this->data_source_id = $var; + + return $this; + } + + /** + * User friendly data source name. + * + * Generated from protobuf field string display_name = 3; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User friendly data source name. + * + * Generated from protobuf field string display_name = 3; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * User friendly data source description string. + * + * Generated from protobuf field string description = 4; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User friendly data source description string. + * + * Generated from protobuf field string description = 4; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Data source client id which should be used to receive refresh token. + * + * Generated from protobuf field string client_id = 5; + * @return string + */ + public function getClientId() + { + return $this->client_id; + } + + /** + * Data source client id which should be used to receive refresh token. + * + * Generated from protobuf field string client_id = 5; + * @param string $var + * @return $this + */ + public function setClientId($var) + { + GPBUtil::checkString($var, True); + $this->client_id = $var; + + return $this; + } + + /** + * Api auth scopes for which refresh token needs to be obtained. These are + * scopes needed by a data source to prepare data and ingest them into + * BigQuery, e.g., https://www.googleapis.com/auth/bigquery + * + * Generated from protobuf field repeated string scopes = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * Api auth scopes for which refresh token needs to be obtained. These are + * scopes needed by a data source to prepare data and ingest them into + * BigQuery, e.g., https://www.googleapis.com/auth/bigquery + * + * Generated from protobuf field repeated string scopes = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->scopes = $arr; + + return $this; + } + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferType transfer_type = 7 [deprecated = true]; + * @return int + * @deprecated + */ + public function getTransferType() + { + @trigger_error('transfer_type is deprecated.', E_USER_DEPRECATED); + return $this->transfer_type; + } + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferType transfer_type = 7 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setTransferType($var) + { + @trigger_error('transfer_type is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferType::class); + $this->transfer_type = $var; + + return $this; + } + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field bool supports_multiple_transfers = 8 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getSupportsMultipleTransfers() + { + @trigger_error('supports_multiple_transfers is deprecated.', E_USER_DEPRECATED); + return $this->supports_multiple_transfers; + } + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field bool supports_multiple_transfers = 8 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setSupportsMultipleTransfers($var) + { + @trigger_error('supports_multiple_transfers is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->supports_multiple_transfers = $var; + + return $this; + } + + /** + * The number of seconds to wait for an update from the data source + * before the Data Transfer Service marks the transfer as FAILED. + * + * Generated from protobuf field int32 update_deadline_seconds = 9; + * @return int + */ + public function getUpdateDeadlineSeconds() + { + return $this->update_deadline_seconds; + } + + /** + * The number of seconds to wait for an update from the data source + * before the Data Transfer Service marks the transfer as FAILED. + * + * Generated from protobuf field int32 update_deadline_seconds = 9; + * @param int $var + * @return $this + */ + public function setUpdateDeadlineSeconds($var) + { + GPBUtil::checkInt32($var); + $this->update_deadline_seconds = $var; + + return $this; + } + + /** + * Default data transfer schedule. + * Examples of valid schedules include: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * + * Generated from protobuf field string default_schedule = 10; + * @return string + */ + public function getDefaultSchedule() + { + return $this->default_schedule; + } + + /** + * Default data transfer schedule. + * Examples of valid schedules include: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * + * Generated from protobuf field string default_schedule = 10; + * @param string $var + * @return $this + */ + public function setDefaultSchedule($var) + { + GPBUtil::checkString($var, True); + $this->default_schedule = $var; + + return $this; + } + + /** + * Specifies whether the data source supports a user defined schedule, or + * operates on the default schedule. + * When set to `true`, user can override default schedule. + * + * Generated from protobuf field bool supports_custom_schedule = 11; + * @return bool + */ + public function getSupportsCustomSchedule() + { + return $this->supports_custom_schedule; + } + + /** + * Specifies whether the data source supports a user defined schedule, or + * operates on the default schedule. + * When set to `true`, user can override default schedule. + * + * Generated from protobuf field bool supports_custom_schedule = 11; + * @param bool $var + * @return $this + */ + public function setSupportsCustomSchedule($var) + { + GPBUtil::checkBool($var); + $this->supports_custom_schedule = $var; + + return $this; + } + + /** + * Data source parameters. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.DataSourceParameter parameters = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * Data source parameters. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.DataSourceParameter parameters = 12; + * @param array<\Google\Cloud\BigQuery\DataTransfer\V1\DataSourceParameter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParameters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\DataSourceParameter::class); + $this->parameters = $arr; + + return $this; + } + + /** + * Url for the help document for this data source. + * + * Generated from protobuf field string help_url = 13; + * @return string + */ + public function getHelpUrl() + { + return $this->help_url; + } + + /** + * Url for the help document for this data source. + * + * Generated from protobuf field string help_url = 13; + * @param string $var + * @return $this + */ + public function setHelpUrl($var) + { + GPBUtil::checkString($var, True); + $this->help_url = $var; + + return $this; + } + + /** + * Indicates the type of authorization. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType authorization_type = 14; + * @return int + */ + public function getAuthorizationType() + { + return $this->authorization_type; + } + + /** + * Indicates the type of authorization. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType authorization_type = 14; + * @param int $var + * @return $this + */ + public function setAuthorizationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\DataSource\AuthorizationType::class); + $this->authorization_type = $var; + + return $this; + } + + /** + * Specifies whether the data source supports automatic data refresh for the + * past few days, and how it's supported. + * For some data sources, data might not be complete until a few days later, + * so it's useful to refresh data automatically. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType data_refresh_type = 15; + * @return int + */ + public function getDataRefreshType() + { + return $this->data_refresh_type; + } + + /** + * Specifies whether the data source supports automatic data refresh for the + * past few days, and how it's supported. + * For some data sources, data might not be complete until a few days later, + * so it's useful to refresh data automatically. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType data_refresh_type = 15; + * @param int $var + * @return $this + */ + public function setDataRefreshType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\DataSource\DataRefreshType::class); + $this->data_refresh_type = $var; + + return $this; + } + + /** + * Default data refresh window on days. + * Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`. + * + * Generated from protobuf field int32 default_data_refresh_window_days = 16; + * @return int + */ + public function getDefaultDataRefreshWindowDays() + { + return $this->default_data_refresh_window_days; + } + + /** + * Default data refresh window on days. + * Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`. + * + * Generated from protobuf field int32 default_data_refresh_window_days = 16; + * @param int $var + * @return $this + */ + public function setDefaultDataRefreshWindowDays($var) + { + GPBUtil::checkInt32($var); + $this->default_data_refresh_window_days = $var; + + return $this; + } + + /** + * Disables backfilling and manual run scheduling + * for the data source. + * + * Generated from protobuf field bool manual_runs_disabled = 17; + * @return bool + */ + public function getManualRunsDisabled() + { + return $this->manual_runs_disabled; + } + + /** + * Disables backfilling and manual run scheduling + * for the data source. + * + * Generated from protobuf field bool manual_runs_disabled = 17; + * @param bool $var + * @return $this + */ + public function setManualRunsDisabled($var) + { + GPBUtil::checkBool($var); + $this->manual_runs_disabled = $var; + + return $this; + } + + /** + * The minimum interval for scheduler to schedule runs. + * + * Generated from protobuf field .google.protobuf.Duration minimum_schedule_interval = 18; + * @return \Google\Protobuf\Duration|null + */ + public function getMinimumScheduleInterval() + { + return $this->minimum_schedule_interval; + } + + public function hasMinimumScheduleInterval() + { + return isset($this->minimum_schedule_interval); + } + + public function clearMinimumScheduleInterval() + { + unset($this->minimum_schedule_interval); + } + + /** + * The minimum interval for scheduler to schedule runs. + * + * Generated from protobuf field .google.protobuf.Duration minimum_schedule_interval = 18; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMinimumScheduleInterval($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->minimum_schedule_interval = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSource/AuthorizationType.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSource/AuthorizationType.php new file mode 100644 index 000000000000..4bef94c57096 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSource/AuthorizationType.php @@ -0,0 +1,73 @@ +google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType + */ +class AuthorizationType +{ + /** + * Type unspecified. + * + * Generated from protobuf enum AUTHORIZATION_TYPE_UNSPECIFIED = 0; + */ + const AUTHORIZATION_TYPE_UNSPECIFIED = 0; + /** + * Use OAuth 2 authorization codes that can be exchanged + * for a refresh token on the backend. + * + * Generated from protobuf enum AUTHORIZATION_CODE = 1; + */ + const AUTHORIZATION_CODE = 1; + /** + * Return an authorization code for a given Google+ page that can then be + * exchanged for a refresh token on the backend. + * + * Generated from protobuf enum GOOGLE_PLUS_AUTHORIZATION_CODE = 2; + */ + const GOOGLE_PLUS_AUTHORIZATION_CODE = 2; + /** + * Use First Party OAuth. + * + * Generated from protobuf enum FIRST_PARTY_OAUTH = 3; + */ + const FIRST_PARTY_OAUTH = 3; + + private static $valueToName = [ + self::AUTHORIZATION_TYPE_UNSPECIFIED => 'AUTHORIZATION_TYPE_UNSPECIFIED', + self::AUTHORIZATION_CODE => 'AUTHORIZATION_CODE', + self::GOOGLE_PLUS_AUTHORIZATION_CODE => 'GOOGLE_PLUS_AUTHORIZATION_CODE', + self::FIRST_PARTY_OAUTH => 'FIRST_PARTY_OAUTH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AuthorizationType::class, \Google\Cloud\BigQuery\DataTransfer\V1\DataSource_AuthorizationType::class); + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSource/DataRefreshType.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSource/DataRefreshType.php new file mode 100644 index 000000000000..2af897748a1f --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSource/DataRefreshType.php @@ -0,0 +1,68 @@ +google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType + */ +class DataRefreshType +{ + /** + * The data source won't support data auto refresh, which is default value. + * + * Generated from protobuf enum DATA_REFRESH_TYPE_UNSPECIFIED = 0; + */ + const DATA_REFRESH_TYPE_UNSPECIFIED = 0; + /** + * The data source supports data auto refresh, and runs will be scheduled + * for the past few days. Does not allow custom values to be set for each + * transfer config. + * + * Generated from protobuf enum SLIDING_WINDOW = 1; + */ + const SLIDING_WINDOW = 1; + /** + * The data source supports data auto refresh, and runs will be scheduled + * for the past few days. Allows custom values to be set for each transfer + * config. + * + * Generated from protobuf enum CUSTOM_SLIDING_WINDOW = 2; + */ + const CUSTOM_SLIDING_WINDOW = 2; + + private static $valueToName = [ + self::DATA_REFRESH_TYPE_UNSPECIFIED => 'DATA_REFRESH_TYPE_UNSPECIFIED', + self::SLIDING_WINDOW => 'SLIDING_WINDOW', + self::CUSTOM_SLIDING_WINDOW => 'CUSTOM_SLIDING_WINDOW', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DataRefreshType::class, \Google\Cloud\BigQuery\DataTransfer\V1\DataSource_DataRefreshType::class); + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSourceParameter.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSourceParameter.php new file mode 100644 index 000000000000..e58593a0ab3d --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSourceParameter.php @@ -0,0 +1,659 @@ +google.cloud.bigquery.datatransfer.v1.DataSourceParameter + */ +class DataSourceParameter extends \Google\Protobuf\Internal\Message +{ + /** + * Parameter identifier. + * + * Generated from protobuf field string param_id = 1; + */ + protected $param_id = ''; + /** + * Parameter display name in the user interface. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Parameter description. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * Parameter type. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type type = 4; + */ + protected $type = 0; + /** + * Is parameter required. + * + * Generated from protobuf field bool required = 5; + */ + protected $required = false; + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field bool repeated = 6; + */ + protected $repeated = false; + /** + * Regular expression which can be used for parameter validation. + * + * Generated from protobuf field string validation_regex = 7; + */ + protected $validation_regex = ''; + /** + * All possible values for the parameter. + * + * Generated from protobuf field repeated string allowed_values = 8; + */ + private $allowed_values; + /** + * For integer and double values specifies minimum allowed value. + * + * Generated from protobuf field .google.protobuf.DoubleValue min_value = 9; + */ + protected $min_value = null; + /** + * For integer and double values specifies maximum allowed value. + * + * Generated from protobuf field .google.protobuf.DoubleValue max_value = 10; + */ + protected $max_value = null; + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.DataSourceParameter fields = 11; + */ + private $fields; + /** + * Description of the requirements for this field, in case the user input does + * not fulfill the regex pattern or min/max values. + * + * Generated from protobuf field string validation_description = 12; + */ + protected $validation_description = ''; + /** + * URL to a help document to further explain the naming requirements. + * + * Generated from protobuf field string validation_help_url = 13; + */ + protected $validation_help_url = ''; + /** + * Cannot be changed after initial creation. + * + * Generated from protobuf field bool immutable = 14; + */ + protected $immutable = false; + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field bool recurse = 15; + */ + protected $recurse = false; + /** + * If true, it should not be used in new transfers, and it should not be + * visible to users. + * + * Generated from protobuf field bool deprecated = 20; + */ + protected $deprecated = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $param_id + * Parameter identifier. + * @type string $display_name + * Parameter display name in the user interface. + * @type string $description + * Parameter description. + * @type int $type + * Parameter type. + * @type bool $required + * Is parameter required. + * @type bool $repeated + * Deprecated. This field has no effect. + * @type string $validation_regex + * Regular expression which can be used for parameter validation. + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_values + * All possible values for the parameter. + * @type \Google\Protobuf\DoubleValue $min_value + * For integer and double values specifies minimum allowed value. + * @type \Google\Protobuf\DoubleValue $max_value + * For integer and double values specifies maximum allowed value. + * @type array<\Google\Cloud\BigQuery\DataTransfer\V1\DataSourceParameter>|\Google\Protobuf\Internal\RepeatedField $fields + * Deprecated. This field has no effect. + * @type string $validation_description + * Description of the requirements for this field, in case the user input does + * not fulfill the regex pattern or min/max values. + * @type string $validation_help_url + * URL to a help document to further explain the naming requirements. + * @type bool $immutable + * Cannot be changed after initial creation. + * @type bool $recurse + * Deprecated. This field has no effect. + * @type bool $deprecated + * If true, it should not be used in new transfers, and it should not be + * visible to users. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Parameter identifier. + * + * Generated from protobuf field string param_id = 1; + * @return string + */ + public function getParamId() + { + return $this->param_id; + } + + /** + * Parameter identifier. + * + * Generated from protobuf field string param_id = 1; + * @param string $var + * @return $this + */ + public function setParamId($var) + { + GPBUtil::checkString($var, True); + $this->param_id = $var; + + return $this; + } + + /** + * Parameter display name in the user interface. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Parameter display name in the user interface. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Parameter description. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Parameter description. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Parameter type. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type type = 4; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Parameter type. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type type = 4; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\DataSourceParameter\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Is parameter required. + * + * Generated from protobuf field bool required = 5; + * @return bool + */ + public function getRequired() + { + return $this->required; + } + + /** + * Is parameter required. + * + * Generated from protobuf field bool required = 5; + * @param bool $var + * @return $this + */ + public function setRequired($var) + { + GPBUtil::checkBool($var); + $this->required = $var; + + return $this; + } + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field bool repeated = 6; + * @return bool + */ + public function getRepeated() + { + return $this->repeated; + } + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field bool repeated = 6; + * @param bool $var + * @return $this + */ + public function setRepeated($var) + { + GPBUtil::checkBool($var); + $this->repeated = $var; + + return $this; + } + + /** + * Regular expression which can be used for parameter validation. + * + * Generated from protobuf field string validation_regex = 7; + * @return string + */ + public function getValidationRegex() + { + return $this->validation_regex; + } + + /** + * Regular expression which can be used for parameter validation. + * + * Generated from protobuf field string validation_regex = 7; + * @param string $var + * @return $this + */ + public function setValidationRegex($var) + { + GPBUtil::checkString($var, True); + $this->validation_regex = $var; + + return $this; + } + + /** + * All possible values for the parameter. + * + * Generated from protobuf field repeated string allowed_values = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedValues() + { + return $this->allowed_values; + } + + /** + * All possible values for the parameter. + * + * Generated from protobuf field repeated string allowed_values = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_values = $arr; + + return $this; + } + + /** + * For integer and double values specifies minimum allowed value. + * + * Generated from protobuf field .google.protobuf.DoubleValue min_value = 9; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getMinValue() + { + return $this->min_value; + } + + public function hasMinValue() + { + return isset($this->min_value); + } + + public function clearMinValue() + { + unset($this->min_value); + } + + /** + * Returns the unboxed value from getMinValue() + + * For integer and double values specifies minimum allowed value. + * + * Generated from protobuf field .google.protobuf.DoubleValue min_value = 9; + * @return float|null + */ + public function getMinValueUnwrapped() + { + return $this->readWrapperValue("min_value"); + } + + /** + * For integer and double values specifies minimum allowed value. + * + * Generated from protobuf field .google.protobuf.DoubleValue min_value = 9; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setMinValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->min_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * For integer and double values specifies minimum allowed value. + * + * Generated from protobuf field .google.protobuf.DoubleValue min_value = 9; + * @param float|null $var + * @return $this + */ + public function setMinValueUnwrapped($var) + { + $this->writeWrapperValue("min_value", $var); + return $this;} + + /** + * For integer and double values specifies maximum allowed value. + * + * Generated from protobuf field .google.protobuf.DoubleValue max_value = 10; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getMaxValue() + { + return $this->max_value; + } + + public function hasMaxValue() + { + return isset($this->max_value); + } + + public function clearMaxValue() + { + unset($this->max_value); + } + + /** + * Returns the unboxed value from getMaxValue() + + * For integer and double values specifies maximum allowed value. + * + * Generated from protobuf field .google.protobuf.DoubleValue max_value = 10; + * @return float|null + */ + public function getMaxValueUnwrapped() + { + return $this->readWrapperValue("max_value"); + } + + /** + * For integer and double values specifies maximum allowed value. + * + * Generated from protobuf field .google.protobuf.DoubleValue max_value = 10; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setMaxValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->max_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * For integer and double values specifies maximum allowed value. + * + * Generated from protobuf field .google.protobuf.DoubleValue max_value = 10; + * @param float|null $var + * @return $this + */ + public function setMaxValueUnwrapped($var) + { + $this->writeWrapperValue("max_value", $var); + return $this;} + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.DataSourceParameter fields = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.DataSourceParameter fields = 11; + * @param array<\Google\Cloud\BigQuery\DataTransfer\V1\DataSourceParameter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\DataSourceParameter::class); + $this->fields = $arr; + + return $this; + } + + /** + * Description of the requirements for this field, in case the user input does + * not fulfill the regex pattern or min/max values. + * + * Generated from protobuf field string validation_description = 12; + * @return string + */ + public function getValidationDescription() + { + return $this->validation_description; + } + + /** + * Description of the requirements for this field, in case the user input does + * not fulfill the regex pattern or min/max values. + * + * Generated from protobuf field string validation_description = 12; + * @param string $var + * @return $this + */ + public function setValidationDescription($var) + { + GPBUtil::checkString($var, True); + $this->validation_description = $var; + + return $this; + } + + /** + * URL to a help document to further explain the naming requirements. + * + * Generated from protobuf field string validation_help_url = 13; + * @return string + */ + public function getValidationHelpUrl() + { + return $this->validation_help_url; + } + + /** + * URL to a help document to further explain the naming requirements. + * + * Generated from protobuf field string validation_help_url = 13; + * @param string $var + * @return $this + */ + public function setValidationHelpUrl($var) + { + GPBUtil::checkString($var, True); + $this->validation_help_url = $var; + + return $this; + } + + /** + * Cannot be changed after initial creation. + * + * Generated from protobuf field bool immutable = 14; + * @return bool + */ + public function getImmutable() + { + return $this->immutable; + } + + /** + * Cannot be changed after initial creation. + * + * Generated from protobuf field bool immutable = 14; + * @param bool $var + * @return $this + */ + public function setImmutable($var) + { + GPBUtil::checkBool($var); + $this->immutable = $var; + + return $this; + } + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field bool recurse = 15; + * @return bool + */ + public function getRecurse() + { + return $this->recurse; + } + + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf field bool recurse = 15; + * @param bool $var + * @return $this + */ + public function setRecurse($var) + { + GPBUtil::checkBool($var); + $this->recurse = $var; + + return $this; + } + + /** + * If true, it should not be used in new transfers, and it should not be + * visible to users. + * + * Generated from protobuf field bool deprecated = 20; + * @return bool + */ + public function getDeprecated() + { + return $this->deprecated; + } + + /** + * If true, it should not be used in new transfers, and it should not be + * visible to users. + * + * Generated from protobuf field bool deprecated = 20; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSourceParameter/Type.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSourceParameter/Type.php new file mode 100644 index 000000000000..8804827735b1 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DataSourceParameter/Type.php @@ -0,0 +1,104 @@ +google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type + */ +class Type +{ + /** + * Type unspecified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * String parameter. + * + * Generated from protobuf enum STRING = 1; + */ + const STRING = 1; + /** + * Integer parameter (64-bits). + * Will be serialized to json as string. + * + * Generated from protobuf enum INTEGER = 2; + */ + const INTEGER = 2; + /** + * Double precision floating point parameter. + * + * Generated from protobuf enum DOUBLE = 3; + */ + const DOUBLE = 3; + /** + * Boolean parameter. + * + * Generated from protobuf enum BOOLEAN = 4; + */ + const BOOLEAN = 4; + /** + * Deprecated. This field has no effect. + * + * Generated from protobuf enum RECORD = 5; + */ + const RECORD = 5; + /** + * Page ID for a Google+ Page. + * + * Generated from protobuf enum PLUS_PAGE = 6; + */ + const PLUS_PAGE = 6; + /** + * List of strings parameter. + * + * Generated from protobuf enum LIST = 7; + */ + const PBLIST = 7; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::STRING => 'STRING', + self::INTEGER => 'INTEGER', + self::DOUBLE => 'DOUBLE', + self::BOOLEAN => 'BOOLEAN', + self::RECORD => 'RECORD', + self::PLUS_PAGE => 'PLUS_PAGE', + self::PBLIST => 'LIST', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\BigQuery\DataTransfer\V1\DataSourceParameter_Type::class); + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DeleteTransferConfigRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DeleteTransferConfigRequest.php new file mode 100644 index 000000000000..d2ac100033aa --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DeleteTransferConfigRequest.php @@ -0,0 +1,92 @@ +google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + */ +class DeleteTransferConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * Please see {@see DataTransferServiceClient::transferConfigName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\DeleteTransferConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DeleteTransferRunRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DeleteTransferRunRequest.php new file mode 100644 index 000000000000..41fde560161f --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/DeleteTransferRunRequest.php @@ -0,0 +1,96 @@ +google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + */ +class DeleteTransferRunRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * Please see {@see DataTransferServiceClient::runName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\DeleteTransferRunRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EmailPreferences.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EmailPreferences.php new file mode 100644 index 000000000000..4c1edcba0238 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EmailPreferences.php @@ -0,0 +1,68 @@ +google.cloud.bigquery.datatransfer.v1.EmailPreferences + */ +class EmailPreferences extends \Google\Protobuf\Internal\Message +{ + /** + * If true, email notifications will be sent on transfer run failures. + * + * Generated from protobuf field bool enable_failure_email = 1; + */ + protected $enable_failure_email = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_failure_email + * If true, email notifications will be sent on transfer run failures. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce(); + parent::__construct($data); + } + + /** + * If true, email notifications will be sent on transfer run failures. + * + * Generated from protobuf field bool enable_failure_email = 1; + * @return bool + */ + public function getEnableFailureEmail() + { + return $this->enable_failure_email; + } + + /** + * If true, email notifications will be sent on transfer run failures. + * + * Generated from protobuf field bool enable_failure_email = 1; + * @param bool $var + * @return $this + */ + public function setEnableFailureEmail($var) + { + GPBUtil::checkBool($var); + $this->enable_failure_email = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EncryptionConfiguration.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EncryptionConfiguration.php new file mode 100644 index 000000000000..2aa88ac83724 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EncryptionConfiguration.php @@ -0,0 +1,104 @@ +google.cloud.bigquery.datatransfer.v1.EncryptionConfiguration + */ +class EncryptionConfiguration extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the KMS key used for encrypting BigQuery data. + * + * Generated from protobuf field .google.protobuf.StringValue kms_key_name = 1; + */ + protected $kms_key_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\StringValue $kms_key_name + * The name of the KMS key used for encrypting BigQuery data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce(); + parent::__construct($data); + } + + /** + * The name of the KMS key used for encrypting BigQuery data. + * + * Generated from protobuf field .google.protobuf.StringValue kms_key_name = 1; + * @return \Google\Protobuf\StringValue|null + */ + public function getKmsKeyName() + { + return $this->kms_key_name; + } + + public function hasKmsKeyName() + { + return isset($this->kms_key_name); + } + + public function clearKmsKeyName() + { + unset($this->kms_key_name); + } + + /** + * Returns the unboxed value from getKmsKeyName() + + * The name of the KMS key used for encrypting BigQuery data. + * + * Generated from protobuf field .google.protobuf.StringValue kms_key_name = 1; + * @return string|null + */ + public function getKmsKeyNameUnwrapped() + { + return $this->readWrapperValue("kms_key_name"); + } + + /** + * The name of the KMS key used for encrypting BigQuery data. + * + * Generated from protobuf field .google.protobuf.StringValue kms_key_name = 1; + * @param \Google\Protobuf\StringValue $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class); + $this->kms_key_name = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object. + + * The name of the KMS key used for encrypting BigQuery data. + * + * Generated from protobuf field .google.protobuf.StringValue kms_key_name = 1; + * @param string|null $var + * @return $this + */ + public function setKmsKeyNameUnwrapped($var) + { + $this->writeWrapperValue("kms_key_name", $var); + return $this;} + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EnrollDataSourcesRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EnrollDataSourcesRequest.php new file mode 100644 index 000000000000..851958ec1cb3 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EnrollDataSourcesRequest.php @@ -0,0 +1,110 @@ +google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + */ +class EnrollDataSourcesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project resource in the form: + * `projects/{project_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Data sources that are enrolled. It is required to provide at least one + * data source id. + * + * Generated from protobuf field repeated string data_source_ids = 2; + */ + private $data_source_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the project resource in the form: + * `projects/{project_id}` + * @type array|\Google\Protobuf\Internal\RepeatedField $data_source_ids + * Data sources that are enrolled. It is required to provide at least one + * data source id. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project resource in the form: + * `projects/{project_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the project resource in the form: + * `projects/{project_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Data sources that are enrolled. It is required to provide at least one + * data source id. + * + * Generated from protobuf field repeated string data_source_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataSourceIds() + { + return $this->data_source_ids; + } + + /** + * Data sources that are enrolled. It is required to provide at least one + * data source id. + * + * Generated from protobuf field repeated string data_source_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataSourceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->data_source_ids = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EventDrivenSchedule.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EventDrivenSchedule.php new file mode 100644 index 000000000000..31a5153fcb4d --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/EventDrivenSchedule.php @@ -0,0 +1,75 @@ +google.cloud.bigquery.datatransfer.v1.EventDrivenSchedule + */ +class EventDrivenSchedule extends \Google\Protobuf\Internal\Message +{ + /** + * Pub/Sub subscription name used to receive events. + * Only Google Cloud Storage data source support this option. + * Format: projects/{project}/subscriptions/{subscription} + * + * Generated from protobuf field string pubsub_subscription = 1; + */ + protected $pubsub_subscription = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $pubsub_subscription + * Pub/Sub subscription name used to receive events. + * Only Google Cloud Storage data source support this option. + * Format: projects/{project}/subscriptions/{subscription} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce(); + parent::__construct($data); + } + + /** + * Pub/Sub subscription name used to receive events. + * Only Google Cloud Storage data source support this option. + * Format: projects/{project}/subscriptions/{subscription} + * + * Generated from protobuf field string pubsub_subscription = 1; + * @return string + */ + public function getPubsubSubscription() + { + return $this->pubsub_subscription; + } + + /** + * Pub/Sub subscription name used to receive events. + * Only Google Cloud Storage data source support this option. + * Format: projects/{project}/subscriptions/{subscription} + * + * Generated from protobuf field string pubsub_subscription = 1; + * @param string $var + * @return $this + */ + public function setPubsubSubscription($var) + { + GPBUtil::checkString($var, True); + $this->pubsub_subscription = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/GetDataSourceRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/GetDataSourceRequest.php new file mode 100644 index 000000000000..4a1ca8890805 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/GetDataSourceRequest.php @@ -0,0 +1,91 @@ +google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + */ +class GetDataSourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + * Please see {@see DataTransferServiceClient::dataSourceName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\GetDataSourceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/GetTransferConfigRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/GetTransferConfigRequest.php new file mode 100644 index 000000000000..3b5e8a4ce8d1 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/GetTransferConfigRequest.php @@ -0,0 +1,91 @@ +google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + */ +class GetTransferConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * Please see {@see DataTransferServiceClient::transferConfigName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\GetTransferConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/GetTransferRunRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/GetTransferRunRequest.php new file mode 100644 index 000000000000..a86266124d87 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/GetTransferRunRequest.php @@ -0,0 +1,96 @@ +google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + */ +class GetTransferRunRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * Please see {@see DataTransferServiceClient::runName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\GetTransferRunRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The field will contain name of the resource requested, for + * example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListDataSourcesRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListDataSourcesRequest.php new file mode 100644 index 000000000000..2523d66f0527 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListDataSourcesRequest.php @@ -0,0 +1,175 @@ +google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + */ +class ListDataSourcesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The BigQuery project id for which data sources should be + * returned. Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + + /** + * @param string $parent Required. The BigQuery project id for which data sources should be + * returned. Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * Please see {@see DataTransferServiceClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\ListDataSourcesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The BigQuery project id for which data sources should be + * returned. Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * @type string $page_token + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @type int $page_size + * Page size. The default page size is the maximum value of 1000 results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. The BigQuery project id for which data sources should be + * returned. Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The BigQuery project id for which data sources should be + * returned. Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListDataSourcesResponse.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListDataSourcesResponse.php new file mode 100644 index 000000000000..9ca585c15ea9 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListDataSourcesResponse.php @@ -0,0 +1,113 @@ +google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + */ +class ListDataSourcesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of supported data sources and their transfer settings. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.DataSource data_sources = 1; + */ + private $data_sources; + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListDataSourcesRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\DataTransfer\V1\DataSource>|\Google\Protobuf\Internal\RepeatedField $data_sources + * List of supported data sources and their transfer settings. + * @type string $next_page_token + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListDataSourcesRequest.page_token` + * to request the next page of list results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * List of supported data sources and their transfer settings. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.DataSource data_sources = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataSources() + { + return $this->data_sources; + } + + /** + * List of supported data sources and their transfer settings. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.DataSource data_sources = 1; + * @param array<\Google\Cloud\BigQuery\DataTransfer\V1\DataSource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\DataSource::class); + $this->data_sources = $arr; + + return $this; + } + + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListDataSourcesRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListDataSourcesRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferConfigsRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferConfigsRequest.php new file mode 100644 index 000000000000..7f7b9bc17914 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferConfigsRequest.php @@ -0,0 +1,209 @@ +google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + */ +class ListTransferConfigsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The BigQuery project id for which transfer configs + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * When specified, only configurations of requested data sources are returned. + * + * Generated from protobuf field repeated string data_source_ids = 2; + */ + private $data_source_ids; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + + /** + * @param string $parent Required. The BigQuery project id for which transfer configs + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * Please see {@see DataTransferServiceClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\ListTransferConfigsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The BigQuery project id for which transfer configs + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * @type array|\Google\Protobuf\Internal\RepeatedField $data_source_ids + * When specified, only configurations of requested data sources are returned. + * @type string $page_token + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @type int $page_size + * Page size. The default page size is the maximum value of 1000 results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. The BigQuery project id for which transfer configs + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The BigQuery project id for which transfer configs + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * When specified, only configurations of requested data sources are returned. + * + * Generated from protobuf field repeated string data_source_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataSourceIds() + { + return $this->data_source_ids; + } + + /** + * When specified, only configurations of requested data sources are returned. + * + * Generated from protobuf field repeated string data_source_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataSourceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->data_source_ids = $arr; + + return $this; + } + + /** + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferConfigsResponse.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferConfigsResponse.php new file mode 100644 index 000000000000..f22f3fea2555 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferConfigsResponse.php @@ -0,0 +1,113 @@ +google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + */ +class ListTransferConfigsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The stored pipeline transfer configurations. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferConfig transfer_configs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $transfer_configs; + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferConfigsRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig>|\Google\Protobuf\Internal\RepeatedField $transfer_configs + * Output only. The stored pipeline transfer configurations. + * @type string $next_page_token + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferConfigsRequest.page_token` + * to request the next page of list results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The stored pipeline transfer configurations. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferConfig transfer_configs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransferConfigs() + { + return $this->transfer_configs; + } + + /** + * Output only. The stored pipeline transfer configurations. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferConfig transfer_configs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransferConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig::class); + $this->transfer_configs = $arr; + + return $this; + } + + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferConfigsRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferConfigsRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferLogsRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferLogsRequest.php new file mode 100644 index 000000000000..e9afd5bb4fdd --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferLogsRequest.php @@ -0,0 +1,213 @@ +google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + */ +class ListTransferLogsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 5; + */ + protected $page_size = 0; + /** + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity message_types = 6; + */ + private $message_types; + + /** + * @param string $parent Required. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * Please see {@see DataTransferServiceClient::runName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\ListTransferLogsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * @type string $page_token + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @type int $page_size + * Page size. The default page size is the maximum value of 1000 results. + * @type array|\Google\Protobuf\Internal\RepeatedField $message_types + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 5; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 5; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity message_types = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessageTypes() + { + return $this->message_types; + } + + /** + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity message_types = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessageTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage\MessageSeverity::class); + $this->message_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferLogsResponse.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferLogsResponse.php new file mode 100644 index 000000000000..4e34aaac630f --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferLogsResponse.php @@ -0,0 +1,113 @@ +google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + */ +class ListTransferLogsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The stored pipeline transfer messages. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferMessage transfer_messages = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $transfer_messages; + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `GetTransferRunLogRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage>|\Google\Protobuf\Internal\RepeatedField $transfer_messages + * Output only. The stored pipeline transfer messages. + * @type string $next_page_token + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `GetTransferRunLogRequest.page_token` + * to request the next page of list results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The stored pipeline transfer messages. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferMessage transfer_messages = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransferMessages() + { + return $this->transfer_messages; + } + + /** + * Output only. The stored pipeline transfer messages. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferMessage transfer_messages = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransferMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage::class); + $this->transfer_messages = $arr; + + return $this; + } + + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `GetTransferRunLogRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `GetTransferRunLogRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferRunsRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferRunsRequest.php new file mode 100644 index 000000000000..e167275131bf --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferRunsRequest.php @@ -0,0 +1,248 @@ +google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + */ +class ListTransferRunsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of transfer configuration for which transfer runs should be + * retrieved. Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * When specified, only transfer runs with requested states are returned. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferState states = 2; + */ + private $states; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * Indicates how run attempts are to be pulled. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt run_attempt = 5; + */ + protected $run_attempt = 0; + + /** + * @param string $parent Required. Name of transfer configuration for which transfer runs should be + * retrieved. Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. Please see + * {@see DataTransferServiceClient::transferConfigName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\ListTransferRunsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of transfer configuration for which transfer runs should be + * retrieved. Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $states + * When specified, only transfer runs with requested states are returned. + * @type string $page_token + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @type int $page_size + * Page size. The default page size is the maximum value of 1000 results. + * @type int $run_attempt + * Indicates how run attempts are to be pulled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of transfer configuration for which transfer runs should be + * retrieved. Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Name of transfer configuration for which transfer runs should be + * retrieved. Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * When specified, only transfer runs with requested states are returned. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferState states = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStates() + { + return $this->states; + } + + /** + * When specified, only transfer runs with requested states are returned. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferState states = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\BigQuery\DataTransfer\V1\TransferState::class); + $this->states = $arr; + + return $this; + } + + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size. The default page size is the maximum value of 1000 results. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Indicates how run attempts are to be pulled. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt run_attempt = 5; + * @return int + */ + public function getRunAttempt() + { + return $this->run_attempt; + } + + /** + * Indicates how run attempts are to be pulled. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt run_attempt = 5; + * @param int $var + * @return $this + */ + public function setRunAttempt($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\ListTransferRunsRequest\RunAttempt::class); + $this->run_attempt = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferRunsRequest/RunAttempt.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferRunsRequest/RunAttempt.php new file mode 100644 index 000000000000..24ffa90187ad --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferRunsRequest/RunAttempt.php @@ -0,0 +1,57 @@ +google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt + */ +class RunAttempt +{ + /** + * All runs should be returned. + * + * Generated from protobuf enum RUN_ATTEMPT_UNSPECIFIED = 0; + */ + const RUN_ATTEMPT_UNSPECIFIED = 0; + /** + * Only latest run per day should be returned. + * + * Generated from protobuf enum LATEST = 1; + */ + const LATEST = 1; + + private static $valueToName = [ + self::RUN_ATTEMPT_UNSPECIFIED => 'RUN_ATTEMPT_UNSPECIFIED', + self::LATEST => 'LATEST', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RunAttempt::class, \Google\Cloud\BigQuery\DataTransfer\V1\ListTransferRunsRequest_RunAttempt::class); + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferRunsResponse.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferRunsResponse.php new file mode 100644 index 000000000000..d1be9c36e029 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ListTransferRunsResponse.php @@ -0,0 +1,113 @@ +google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + */ +class ListTransferRunsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The stored pipeline transfer runs. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferRun transfer_runs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $transfer_runs; + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferRunsRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\DataTransfer\V1\TransferRun>|\Google\Protobuf\Internal\RepeatedField $transfer_runs + * Output only. The stored pipeline transfer runs. + * @type string $next_page_token + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferRunsRequest.page_token` + * to request the next page of list results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The stored pipeline transfer runs. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferRun transfer_runs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransferRuns() + { + return $this->transfer_runs; + } + + /** + * Output only. The stored pipeline transfer runs. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferRun transfer_runs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BigQuery\DataTransfer\V1\TransferRun>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransferRuns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\TransferRun::class); + $this->transfer_runs = $arr; + + return $this; + } + + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferRunsRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferRunsRequest.page_token` + * to request the next page of list results. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ManualSchedule.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ManualSchedule.php new file mode 100644 index 000000000000..d63152a9d504 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ManualSchedule.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.datatransfer.v1.ManualSchedule + */ +class ManualSchedule extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleOptions.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleOptions.php new file mode 100644 index 000000000000..35e0e40bc6dc --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleOptions.php @@ -0,0 +1,195 @@ +google.cloud.bigquery.datatransfer.v1.ScheduleOptions + */ +class ScheduleOptions extends \Google\Protobuf\Internal\Message +{ + /** + * If true, automatic scheduling of data transfer runs for this configuration + * will be disabled. The runs can be started on ad-hoc basis using + * StartManualTransferRuns API. When automatic scheduling is disabled, the + * TransferConfig.schedule field will be ignored. + * + * Generated from protobuf field bool disable_auto_scheduling = 3; + */ + protected $disable_auto_scheduling = false; + /** + * Specifies time to start scheduling transfer runs. The first run will be + * scheduled at or after the start time according to a recurrence pattern + * defined in the schedule string. The start time can be changed at any + * moment. The time when a data transfer can be triggered manually is not + * limited by this option. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * Defines time to stop scheduling transfer runs. A transfer run cannot be + * scheduled at or after the end time. The end time can be changed at any + * moment. The time when a data transfer can be triggered manually is not + * limited by this option. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $disable_auto_scheduling + * If true, automatic scheduling of data transfer runs for this configuration + * will be disabled. The runs can be started on ad-hoc basis using + * StartManualTransferRuns API. When automatic scheduling is disabled, the + * TransferConfig.schedule field will be ignored. + * @type \Google\Protobuf\Timestamp $start_time + * Specifies time to start scheduling transfer runs. The first run will be + * scheduled at or after the start time according to a recurrence pattern + * defined in the schedule string. The start time can be changed at any + * moment. The time when a data transfer can be triggered manually is not + * limited by this option. + * @type \Google\Protobuf\Timestamp $end_time + * Defines time to stop scheduling transfer runs. A transfer run cannot be + * scheduled at or after the end time. The end time can be changed at any + * moment. The time when a data transfer can be triggered manually is not + * limited by this option. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce(); + parent::__construct($data); + } + + /** + * If true, automatic scheduling of data transfer runs for this configuration + * will be disabled. The runs can be started on ad-hoc basis using + * StartManualTransferRuns API. When automatic scheduling is disabled, the + * TransferConfig.schedule field will be ignored. + * + * Generated from protobuf field bool disable_auto_scheduling = 3; + * @return bool + */ + public function getDisableAutoScheduling() + { + return $this->disable_auto_scheduling; + } + + /** + * If true, automatic scheduling of data transfer runs for this configuration + * will be disabled. The runs can be started on ad-hoc basis using + * StartManualTransferRuns API. When automatic scheduling is disabled, the + * TransferConfig.schedule field will be ignored. + * + * Generated from protobuf field bool disable_auto_scheduling = 3; + * @param bool $var + * @return $this + */ + public function setDisableAutoScheduling($var) + { + GPBUtil::checkBool($var); + $this->disable_auto_scheduling = $var; + + return $this; + } + + /** + * Specifies time to start scheduling transfer runs. The first run will be + * scheduled at or after the start time according to a recurrence pattern + * defined in the schedule string. The start time can be changed at any + * moment. The time when a data transfer can be triggered manually is not + * limited by this option. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Specifies time to start scheduling transfer runs. The first run will be + * scheduled at or after the start time according to a recurrence pattern + * defined in the schedule string. The start time can be changed at any + * moment. The time when a data transfer can be triggered manually is not + * limited by this option. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Defines time to stop scheduling transfer runs. A transfer run cannot be + * scheduled at or after the end time. The end time can be changed at any + * moment. The time when a data transfer can be triggered manually is not + * limited by this option. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Defines time to stop scheduling transfer runs. A transfer run cannot be + * scheduled at or after the end time. The end time can be changed at any + * moment. The time when a data transfer can be triggered manually is not + * limited by this option. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleOptionsV2.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleOptionsV2.php new file mode 100644 index 000000000000..9f60741106c1 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleOptionsV2.php @@ -0,0 +1,159 @@ +google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2 + */ +class ScheduleOptionsV2 extends \Google\Protobuf\Internal\Message +{ + protected $schedule; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\DataTransfer\V1\TimeBasedSchedule $time_based_schedule + * Time based transfer schedule options. This is the default schedule + * option. + * @type \Google\Cloud\BigQuery\DataTransfer\V1\ManualSchedule $manual_schedule + * Manual transfer schedule. If set, the transfer run will not be + * auto-scheduled by the system, unless the client invokes + * StartManualTransferRuns. This is equivalent to + * disable_auto_scheduling = true. + * @type \Google\Cloud\BigQuery\DataTransfer\V1\EventDrivenSchedule $event_driven_schedule + * Event driven transfer schedule options. If set, the transfer will be + * scheduled upon events arrial. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce(); + parent::__construct($data); + } + + /** + * Time based transfer schedule options. This is the default schedule + * option. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TimeBasedSchedule time_based_schedule = 1; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\TimeBasedSchedule|null + */ + public function getTimeBasedSchedule() + { + return $this->readOneof(1); + } + + public function hasTimeBasedSchedule() + { + return $this->hasOneof(1); + } + + /** + * Time based transfer schedule options. This is the default schedule + * option. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TimeBasedSchedule time_based_schedule = 1; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\TimeBasedSchedule $var + * @return $this + */ + public function setTimeBasedSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\TimeBasedSchedule::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Manual transfer schedule. If set, the transfer run will not be + * auto-scheduled by the system, unless the client invokes + * StartManualTransferRuns. This is equivalent to + * disable_auto_scheduling = true. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.ManualSchedule manual_schedule = 2; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\ManualSchedule|null + */ + public function getManualSchedule() + { + return $this->readOneof(2); + } + + public function hasManualSchedule() + { + return $this->hasOneof(2); + } + + /** + * Manual transfer schedule. If set, the transfer run will not be + * auto-scheduled by the system, unless the client invokes + * StartManualTransferRuns. This is equivalent to + * disable_auto_scheduling = true. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.ManualSchedule manual_schedule = 2; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\ManualSchedule $var + * @return $this + */ + public function setManualSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\ManualSchedule::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Event driven transfer schedule options. If set, the transfer will be + * scheduled upon events arrial. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.EventDrivenSchedule event_driven_schedule = 3; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\EventDrivenSchedule|null + */ + public function getEventDrivenSchedule() + { + return $this->readOneof(3); + } + + public function hasEventDrivenSchedule() + { + return $this->hasOneof(3); + } + + /** + * Event driven transfer schedule options. If set, the transfer will be + * scheduled upon events arrial. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.EventDrivenSchedule event_driven_schedule = 3; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\EventDrivenSchedule $var + * @return $this + */ + public function setEventDrivenSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\EventDrivenSchedule::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getSchedule() + { + return $this->whichOneof("schedule"); + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleTransferRunsRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleTransferRunsRequest.php new file mode 100644 index 000000000000..8f0b713bd735 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleTransferRunsRequest.php @@ -0,0 +1,193 @@ +google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + */ +class ScheduleTransferRunsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start_time = null; + /** + * Required. End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $end_time = null; + + /** + * @param string $parent Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. Please see + * {@see DataTransferServiceClient::transferConfigName()} for help formatting this field. + * @param \Google\Protobuf\Timestamp $startTime Required. Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + * @param \Google\Protobuf\Timestamp $endTime Required. End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\ScheduleTransferRunsRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Protobuf\Timestamp $startTime, \Google\Protobuf\Timestamp $endTime): self + { + return (new self()) + ->setParent($parent) + ->setStartTime($startTime) + ->setEndTime($endTime); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @type \Google\Protobuf\Timestamp $start_time + * Required. Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + * @type \Google\Protobuf\Timestamp $end_time + * Required. End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Required. Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Required. End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Required. End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleTransferRunsResponse.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleTransferRunsResponse.php new file mode 100644 index 000000000000..673793b8f344 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/ScheduleTransferRunsResponse.php @@ -0,0 +1,67 @@ +google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + */ +class ScheduleTransferRunsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The transfer runs that were scheduled. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferRun runs = 1; + */ + private $runs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\DataTransfer\V1\TransferRun>|\Google\Protobuf\Internal\RepeatedField $runs + * The transfer runs that were scheduled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * The transfer runs that were scheduled. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferRun runs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRuns() + { + return $this->runs; + } + + /** + * The transfer runs that were scheduled. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferRun runs = 1; + * @param array<\Google\Cloud\BigQuery\DataTransfer\V1\TransferRun>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRuns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\TransferRun::class); + $this->runs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/StartManualTransferRunsRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/StartManualTransferRunsRequest.php new file mode 100644 index 000000000000..2248a14c5c92 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/StartManualTransferRunsRequest.php @@ -0,0 +1,168 @@ +google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + */ +class StartManualTransferRunsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + protected $time; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @type \Google\Cloud\BigQuery\DataTransfer\V1\StartManualTransferRunsRequest\TimeRange $requested_time_range + * A time_range start and end timestamp for historical data files or reports + * that are scheduled to be transferred by the scheduled transfer run. + * requested_time_range must be a past time and cannot include future time + * values. + * @type \Google\Protobuf\Timestamp $requested_run_time + * A run_time timestamp for historical data files or reports + * that are scheduled to be transferred by the scheduled transfer run. + * requested_run_time must be a past time and cannot include future time + * values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * A time_range start and end timestamp for historical data files or reports + * that are scheduled to be transferred by the scheduled transfer run. + * requested_time_range must be a past time and cannot include future time + * values. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange requested_time_range = 3; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\StartManualTransferRunsRequest\TimeRange|null + */ + public function getRequestedTimeRange() + { + return $this->readOneof(3); + } + + public function hasRequestedTimeRange() + { + return $this->hasOneof(3); + } + + /** + * A time_range start and end timestamp for historical data files or reports + * that are scheduled to be transferred by the scheduled transfer run. + * requested_time_range must be a past time and cannot include future time + * values. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange requested_time_range = 3; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\StartManualTransferRunsRequest\TimeRange $var + * @return $this + */ + public function setRequestedTimeRange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\StartManualTransferRunsRequest\TimeRange::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A run_time timestamp for historical data files or reports + * that are scheduled to be transferred by the scheduled transfer run. + * requested_run_time must be a past time and cannot include future time + * values. + * + * Generated from protobuf field .google.protobuf.Timestamp requested_run_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRequestedRunTime() + { + return $this->readOneof(4); + } + + public function hasRequestedRunTime() + { + return $this->hasOneof(4); + } + + /** + * A run_time timestamp for historical data files or reports + * that are scheduled to be transferred by the scheduled transfer run. + * requested_run_time must be a past time and cannot include future time + * values. + * + * Generated from protobuf field .google.protobuf.Timestamp requested_run_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRequestedRunTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getTime() + { + return $this->whichOneof("time"); + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/StartManualTransferRunsRequest/TimeRange.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/StartManualTransferRunsRequest/TimeRange.php new file mode 100644 index 000000000000..3916e079bfe7 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/StartManualTransferRunsRequest/TimeRange.php @@ -0,0 +1,149 @@ +google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + */ +class TimeRange extends \Google\Protobuf\Internal\Message +{ + /** + * Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. The start_time must be strictly less than + * the end_time. Creates transfer runs where run_time is in the range + * between start_time (inclusive) and end_time (exclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. The end_time must not be in the future. + * Creates transfer runs where run_time is in the range between start_time + * (inclusive) and end_time (exclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. The start_time must be strictly less than + * the end_time. Creates transfer runs where run_time is in the range + * between start_time (inclusive) and end_time (exclusive). + * @type \Google\Protobuf\Timestamp $end_time + * End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. The end_time must not be in the future. + * Creates transfer runs where run_time is in the range between start_time + * (inclusive) and end_time (exclusive). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. The start_time must be strictly less than + * the end_time. Creates transfer runs where run_time is in the range + * between start_time (inclusive) and end_time (exclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. The start_time must be strictly less than + * the end_time. Creates transfer runs where run_time is in the range + * between start_time (inclusive) and end_time (exclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. The end_time must not be in the future. + * Creates transfer runs where run_time is in the range between start_time + * (inclusive) and end_time (exclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. The end_time must not be in the future. + * Creates transfer runs where run_time is in the range between start_time + * (inclusive) and end_time (exclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TimeRange::class, \Google\Cloud\BigQuery\DataTransfer\V1\StartManualTransferRunsRequest_TimeRange::class); + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/StartManualTransferRunsResponse.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/StartManualTransferRunsResponse.php new file mode 100644 index 000000000000..2c891f31e726 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/StartManualTransferRunsResponse.php @@ -0,0 +1,67 @@ +google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + */ +class StartManualTransferRunsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The transfer runs that were created. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferRun runs = 1; + */ + private $runs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\DataTransfer\V1\TransferRun>|\Google\Protobuf\Internal\RepeatedField $runs + * The transfer runs that were created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * The transfer runs that were created. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferRun runs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRuns() + { + return $this->runs; + } + + /** + * The transfer runs that were created. + * + * Generated from protobuf field repeated .google.cloud.bigquery.datatransfer.v1.TransferRun runs = 1; + * @param array<\Google\Cloud\BigQuery\DataTransfer\V1\TransferRun>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRuns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\TransferRun::class); + $this->runs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TimeBasedSchedule.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TimeBasedSchedule.php new file mode 100644 index 000000000000..11981b94a608 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TimeBasedSchedule.php @@ -0,0 +1,220 @@ +google.cloud.bigquery.datatransfer.v1.TimeBasedSchedule + */ +class TimeBasedSchedule extends \Google\Protobuf\Internal\Message +{ + /** + * Data transfer schedule. + * If the data source does not support a custom schedule, this should be + * empty. If it is empty, the default value for the data source will be used. + * The specified times are in UTC. + * Examples of valid format: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * See more explanation about the format here: + * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + * NOTE: The minimum interval time between recurring transfers depends on the + * data source; refer to the documentation for your data source. + * + * Generated from protobuf field string schedule = 1; + */ + protected $schedule = ''; + /** + * Specifies time to start scheduling transfer runs. The first run will be + * scheduled at or after the start time according to a recurrence pattern + * defined in the schedule string. The start time can be changed at any + * moment. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + */ + protected $start_time = null; + /** + * Defines time to stop scheduling transfer runs. A transfer run cannot be + * scheduled at or after the end time. The end time can be changed at any + * moment. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $schedule + * Data transfer schedule. + * If the data source does not support a custom schedule, this should be + * empty. If it is empty, the default value for the data source will be used. + * The specified times are in UTC. + * Examples of valid format: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * See more explanation about the format here: + * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + * NOTE: The minimum interval time between recurring transfers depends on the + * data source; refer to the documentation for your data source. + * @type \Google\Protobuf\Timestamp $start_time + * Specifies time to start scheduling transfer runs. The first run will be + * scheduled at or after the start time according to a recurrence pattern + * defined in the schedule string. The start time can be changed at any + * moment. + * @type \Google\Protobuf\Timestamp $end_time + * Defines time to stop scheduling transfer runs. A transfer run cannot be + * scheduled at or after the end time. The end time can be changed at any + * moment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce(); + parent::__construct($data); + } + + /** + * Data transfer schedule. + * If the data source does not support a custom schedule, this should be + * empty. If it is empty, the default value for the data source will be used. + * The specified times are in UTC. + * Examples of valid format: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * See more explanation about the format here: + * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + * NOTE: The minimum interval time between recurring transfers depends on the + * data source; refer to the documentation for your data source. + * + * Generated from protobuf field string schedule = 1; + * @return string + */ + public function getSchedule() + { + return $this->schedule; + } + + /** + * Data transfer schedule. + * If the data source does not support a custom schedule, this should be + * empty. If it is empty, the default value for the data source will be used. + * The specified times are in UTC. + * Examples of valid format: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * See more explanation about the format here: + * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + * NOTE: The minimum interval time between recurring transfers depends on the + * data source; refer to the documentation for your data source. + * + * Generated from protobuf field string schedule = 1; + * @param string $var + * @return $this + */ + public function setSchedule($var) + { + GPBUtil::checkString($var, True); + $this->schedule = $var; + + return $this; + } + + /** + * Specifies time to start scheduling transfer runs. The first run will be + * scheduled at or after the start time according to a recurrence pattern + * defined in the schedule string. The start time can be changed at any + * moment. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Specifies time to start scheduling transfer runs. The first run will be + * scheduled at or after the start time according to a recurrence pattern + * defined in the schedule string. The start time can be changed at any + * moment. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Defines time to stop scheduling transfer runs. A transfer run cannot be + * scheduled at or after the end time. The end time can be changed at any + * moment. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Defines time to stop scheduling transfer runs. A transfer run cannot be + * scheduled at or after the end time. The end time can be changed at any + * moment. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferConfig.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferConfig.php new file mode 100644 index 000000000000..e02892d345a5 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferConfig.php @@ -0,0 +1,980 @@ +google.cloud.bigquery.datatransfer.v1.TransferConfig + */ +class TransferConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the transfer config. + * Transfer config names have the form either + * `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or + * `projects/{project_id}/transferConfigs/{config_id}`, + * where `config_id` is usually a UUID, even though it is not + * guaranteed or required. The name is ignored when creating a transfer + * config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * User specified display name for the data transfer. + * + * Generated from protobuf field string display_name = 3; + */ + protected $display_name = ''; + /** + * Data source ID. This cannot be changed once data transfer is created. The + * full list of available data source IDs can be returned through an API call: + * https://cloud.google.com/bigquery-transfer/docs/reference/datatransfer/rest/v1/projects.locations.dataSources/list + * + * Generated from protobuf field string data_source_id = 5; + */ + protected $data_source_id = ''; + /** + * Parameters specific to each data source. For more information see the + * bq tab in the 'Setting up a data transfer' section for each data source. + * For example the parameters for Cloud Storage transfers are listed here: + * https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + * + * Generated from protobuf field .google.protobuf.Struct params = 9; + */ + protected $params = null; + /** + * Data transfer schedule. + * If the data source does not support a custom schedule, this should be + * empty. If it is empty, the default value for the data source will be used. + * The specified times are in UTC. + * Examples of valid format: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * See more explanation about the format here: + * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + * NOTE: The minimum interval time between recurring transfers depends on the + * data source; refer to the documentation for your data source. + * + * Generated from protobuf field string schedule = 7; + */ + protected $schedule = ''; + /** + * Options customizing the data transfer schedule. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.ScheduleOptions schedule_options = 24; + */ + protected $schedule_options = null; + /** + * Options customizing different types of data transfer schedule. + * This field replaces "schedule" and "schedule_options" fields. + * ScheduleOptionsV2 cannot be used together with ScheduleOptions/Schedule. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2 schedule_options_v2 = 31; + */ + protected $schedule_options_v2 = null; + /** + * The number of days to look back to automatically refresh the data. + * For example, if `data_refresh_window_days = 10`, then every day + * BigQuery reingests data for [today-10, today-1], rather than ingesting data + * for just [today-1]. + * Only valid if the data source supports the feature. Set the value to 0 + * to use the default value. + * + * Generated from protobuf field int32 data_refresh_window_days = 12; + */ + protected $data_refresh_window_days = 0; + /** + * Is this config disabled. When set to true, no runs will be scheduled for + * this transfer config. + * + * Generated from protobuf field bool disabled = 13; + */ + protected $disabled = false; + /** + * Output only. Data transfer modification time. Ignored by server on input. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Next time when data transfer will run. + * + * Generated from protobuf field .google.protobuf.Timestamp next_run_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $next_run_time = null; + /** + * Output only. State of the most recently updated transfer run. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Deprecated. Unique ID of the user on whose behalf transfer is done. + * + * Generated from protobuf field int64 user_id = 11; + */ + protected $user_id = 0; + /** + * Output only. Region in which BigQuery dataset is located. + * + * Generated from protobuf field string dataset_region = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $dataset_region = ''; + /** + * Pub/Sub topic where notifications will be sent after transfer runs + * associated with this transfer config finish. + * The format for specifying a pubsub topic is: + * `projects/{project_id}/topics/{topic_id}` + * + * Generated from protobuf field string notification_pubsub_topic = 15; + */ + protected $notification_pubsub_topic = ''; + /** + * Email notifications will be sent according to these preferences + * to the email address of the user who owns this transfer config. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.EmailPreferences email_preferences = 18; + */ + protected $email_preferences = null; + /** + * Output only. Information about the user whose credentials are used to + * transfer data. Populated only for `transferConfigs.get` requests. In case + * the user information is not available, this field will not be populated. + * + * Generated from protobuf field optional .google.cloud.bigquery.datatransfer.v1.UserInfo owner_info = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $owner_info = null; + /** + * The encryption configuration part. Currently, it is only used for the + * optional KMS key name. The BigQuery service account of your project must be + * granted permissions to use the key. Read methods will return the key name + * applied in effect. Write methods will apply the key if it is present, or + * otherwise try to apply project default keys if it is absent. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.EncryptionConfiguration encryption_configuration = 28; + */ + protected $encryption_configuration = null; + /** + * Output only. Error code with detailed information about reason of the + * latest config failure. + * + * Generated from protobuf field .google.rpc.Status error = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $error = null; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the transfer config. + * Transfer config names have the form either + * `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or + * `projects/{project_id}/transferConfigs/{config_id}`, + * where `config_id` is usually a UUID, even though it is not + * guaranteed or required. The name is ignored when creating a transfer + * config. + * @type string $destination_dataset_id + * The BigQuery target dataset id. + * @type string $display_name + * User specified display name for the data transfer. + * @type string $data_source_id + * Data source ID. This cannot be changed once data transfer is created. The + * full list of available data source IDs can be returned through an API call: + * https://cloud.google.com/bigquery-transfer/docs/reference/datatransfer/rest/v1/projects.locations.dataSources/list + * @type \Google\Protobuf\Struct $params + * Parameters specific to each data source. For more information see the + * bq tab in the 'Setting up a data transfer' section for each data source. + * For example the parameters for Cloud Storage transfers are listed here: + * https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + * @type string $schedule + * Data transfer schedule. + * If the data source does not support a custom schedule, this should be + * empty. If it is empty, the default value for the data source will be used. + * The specified times are in UTC. + * Examples of valid format: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * See more explanation about the format here: + * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + * NOTE: The minimum interval time between recurring transfers depends on the + * data source; refer to the documentation for your data source. + * @type \Google\Cloud\BigQuery\DataTransfer\V1\ScheduleOptions $schedule_options + * Options customizing the data transfer schedule. + * @type \Google\Cloud\BigQuery\DataTransfer\V1\ScheduleOptionsV2 $schedule_options_v2 + * Options customizing different types of data transfer schedule. + * This field replaces "schedule" and "schedule_options" fields. + * ScheduleOptionsV2 cannot be used together with ScheduleOptions/Schedule. + * @type int $data_refresh_window_days + * The number of days to look back to automatically refresh the data. + * For example, if `data_refresh_window_days = 10`, then every day + * BigQuery reingests data for [today-10, today-1], rather than ingesting data + * for just [today-1]. + * Only valid if the data source supports the feature. Set the value to 0 + * to use the default value. + * @type bool $disabled + * Is this config disabled. When set to true, no runs will be scheduled for + * this transfer config. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Data transfer modification time. Ignored by server on input. + * @type \Google\Protobuf\Timestamp $next_run_time + * Output only. Next time when data transfer will run. + * @type int $state + * Output only. State of the most recently updated transfer run. + * @type int|string $user_id + * Deprecated. Unique ID of the user on whose behalf transfer is done. + * @type string $dataset_region + * Output only. Region in which BigQuery dataset is located. + * @type string $notification_pubsub_topic + * Pub/Sub topic where notifications will be sent after transfer runs + * associated with this transfer config finish. + * The format for specifying a pubsub topic is: + * `projects/{project_id}/topics/{topic_id}` + * @type \Google\Cloud\BigQuery\DataTransfer\V1\EmailPreferences $email_preferences + * Email notifications will be sent according to these preferences + * to the email address of the user who owns this transfer config. + * @type \Google\Cloud\BigQuery\DataTransfer\V1\UserInfo $owner_info + * Output only. Information about the user whose credentials are used to + * transfer data. Populated only for `transferConfigs.get` requests. In case + * the user information is not available, this field will not be populated. + * @type \Google\Cloud\BigQuery\DataTransfer\V1\EncryptionConfiguration $encryption_configuration + * The encryption configuration part. Currently, it is only used for the + * optional KMS key name. The BigQuery service account of your project must be + * granted permissions to use the key. Read methods will return the key name + * applied in effect. Write methods will apply the key if it is present, or + * otherwise try to apply project default keys if it is absent. + * @type \Google\Rpc\Status $error + * Output only. Error code with detailed information about reason of the + * latest config failure. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the transfer config. + * Transfer config names have the form either + * `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or + * `projects/{project_id}/transferConfigs/{config_id}`, + * where `config_id` is usually a UUID, even though it is not + * guaranteed or required. The name is ignored when creating a transfer + * config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the transfer config. + * Transfer config names have the form either + * `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or + * `projects/{project_id}/transferConfigs/{config_id}`, + * where `config_id` is usually a UUID, even though it is not + * guaranteed or required. The name is ignored when creating a transfer + * config. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The BigQuery target dataset id. + * + * Generated from protobuf field string destination_dataset_id = 2; + * @return string + */ + public function getDestinationDatasetId() + { + return $this->readOneof(2); + } + + public function hasDestinationDatasetId() + { + return $this->hasOneof(2); + } + + /** + * The BigQuery target dataset id. + * + * Generated from protobuf field string destination_dataset_id = 2; + * @param string $var + * @return $this + */ + public function setDestinationDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * User specified display name for the data transfer. + * + * Generated from protobuf field string display_name = 3; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User specified display name for the data transfer. + * + * Generated from protobuf field string display_name = 3; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Data source ID. This cannot be changed once data transfer is created. The + * full list of available data source IDs can be returned through an API call: + * https://cloud.google.com/bigquery-transfer/docs/reference/datatransfer/rest/v1/projects.locations.dataSources/list + * + * Generated from protobuf field string data_source_id = 5; + * @return string + */ + public function getDataSourceId() + { + return $this->data_source_id; + } + + /** + * Data source ID. This cannot be changed once data transfer is created. The + * full list of available data source IDs can be returned through an API call: + * https://cloud.google.com/bigquery-transfer/docs/reference/datatransfer/rest/v1/projects.locations.dataSources/list + * + * Generated from protobuf field string data_source_id = 5; + * @param string $var + * @return $this + */ + public function setDataSourceId($var) + { + GPBUtil::checkString($var, True); + $this->data_source_id = $var; + + return $this; + } + + /** + * Parameters specific to each data source. For more information see the + * bq tab in the 'Setting up a data transfer' section for each data source. + * For example the parameters for Cloud Storage transfers are listed here: + * https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + * + * Generated from protobuf field .google.protobuf.Struct params = 9; + * @return \Google\Protobuf\Struct|null + */ + public function getParams() + { + return $this->params; + } + + public function hasParams() + { + return isset($this->params); + } + + public function clearParams() + { + unset($this->params); + } + + /** + * Parameters specific to each data source. For more information see the + * bq tab in the 'Setting up a data transfer' section for each data source. + * For example the parameters for Cloud Storage transfers are listed here: + * https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + * + * Generated from protobuf field .google.protobuf.Struct params = 9; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParams($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->params = $var; + + return $this; + } + + /** + * Data transfer schedule. + * If the data source does not support a custom schedule, this should be + * empty. If it is empty, the default value for the data source will be used. + * The specified times are in UTC. + * Examples of valid format: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * See more explanation about the format here: + * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + * NOTE: The minimum interval time between recurring transfers depends on the + * data source; refer to the documentation for your data source. + * + * Generated from protobuf field string schedule = 7; + * @return string + */ + public function getSchedule() + { + return $this->schedule; + } + + /** + * Data transfer schedule. + * If the data source does not support a custom schedule, this should be + * empty. If it is empty, the default value for the data source will be used. + * The specified times are in UTC. + * Examples of valid format: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * See more explanation about the format here: + * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + * NOTE: The minimum interval time between recurring transfers depends on the + * data source; refer to the documentation for your data source. + * + * Generated from protobuf field string schedule = 7; + * @param string $var + * @return $this + */ + public function setSchedule($var) + { + GPBUtil::checkString($var, True); + $this->schedule = $var; + + return $this; + } + + /** + * Options customizing the data transfer schedule. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.ScheduleOptions schedule_options = 24; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\ScheduleOptions|null + */ + public function getScheduleOptions() + { + return $this->schedule_options; + } + + public function hasScheduleOptions() + { + return isset($this->schedule_options); + } + + public function clearScheduleOptions() + { + unset($this->schedule_options); + } + + /** + * Options customizing the data transfer schedule. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.ScheduleOptions schedule_options = 24; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\ScheduleOptions $var + * @return $this + */ + public function setScheduleOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\ScheduleOptions::class); + $this->schedule_options = $var; + + return $this; + } + + /** + * Options customizing different types of data transfer schedule. + * This field replaces "schedule" and "schedule_options" fields. + * ScheduleOptionsV2 cannot be used together with ScheduleOptions/Schedule. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2 schedule_options_v2 = 31; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\ScheduleOptionsV2|null + */ + public function getScheduleOptionsV2() + { + return $this->schedule_options_v2; + } + + public function hasScheduleOptionsV2() + { + return isset($this->schedule_options_v2); + } + + public function clearScheduleOptionsV2() + { + unset($this->schedule_options_v2); + } + + /** + * Options customizing different types of data transfer schedule. + * This field replaces "schedule" and "schedule_options" fields. + * ScheduleOptionsV2 cannot be used together with ScheduleOptions/Schedule. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2 schedule_options_v2 = 31; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\ScheduleOptionsV2 $var + * @return $this + */ + public function setScheduleOptionsV2($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\ScheduleOptionsV2::class); + $this->schedule_options_v2 = $var; + + return $this; + } + + /** + * The number of days to look back to automatically refresh the data. + * For example, if `data_refresh_window_days = 10`, then every day + * BigQuery reingests data for [today-10, today-1], rather than ingesting data + * for just [today-1]. + * Only valid if the data source supports the feature. Set the value to 0 + * to use the default value. + * + * Generated from protobuf field int32 data_refresh_window_days = 12; + * @return int + */ + public function getDataRefreshWindowDays() + { + return $this->data_refresh_window_days; + } + + /** + * The number of days to look back to automatically refresh the data. + * For example, if `data_refresh_window_days = 10`, then every day + * BigQuery reingests data for [today-10, today-1], rather than ingesting data + * for just [today-1]. + * Only valid if the data source supports the feature. Set the value to 0 + * to use the default value. + * + * Generated from protobuf field int32 data_refresh_window_days = 12; + * @param int $var + * @return $this + */ + public function setDataRefreshWindowDays($var) + { + GPBUtil::checkInt32($var); + $this->data_refresh_window_days = $var; + + return $this; + } + + /** + * Is this config disabled. When set to true, no runs will be scheduled for + * this transfer config. + * + * Generated from protobuf field bool disabled = 13; + * @return bool + */ + public function getDisabled() + { + return $this->disabled; + } + + /** + * Is this config disabled. When set to true, no runs will be scheduled for + * this transfer config. + * + * Generated from protobuf field bool disabled = 13; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * Output only. Data transfer modification time. Ignored by server on input. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Data transfer modification time. Ignored by server on input. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Next time when data transfer will run. + * + * Generated from protobuf field .google.protobuf.Timestamp next_run_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getNextRunTime() + { + return $this->next_run_time; + } + + public function hasNextRunTime() + { + return isset($this->next_run_time); + } + + public function clearNextRunTime() + { + unset($this->next_run_time); + } + + /** + * Output only. Next time when data transfer will run. + * + * Generated from protobuf field .google.protobuf.Timestamp next_run_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setNextRunTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->next_run_time = $var; + + return $this; + } + + /** + * Output only. State of the most recently updated transfer run. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the most recently updated transfer run. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferState::class); + $this->state = $var; + + return $this; + } + + /** + * Deprecated. Unique ID of the user on whose behalf transfer is done. + * + * Generated from protobuf field int64 user_id = 11; + * @return int|string + */ + public function getUserId() + { + return $this->user_id; + } + + /** + * Deprecated. Unique ID of the user on whose behalf transfer is done. + * + * Generated from protobuf field int64 user_id = 11; + * @param int|string $var + * @return $this + */ + public function setUserId($var) + { + GPBUtil::checkInt64($var); + $this->user_id = $var; + + return $this; + } + + /** + * Output only. Region in which BigQuery dataset is located. + * + * Generated from protobuf field string dataset_region = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDatasetRegion() + { + return $this->dataset_region; + } + + /** + * Output only. Region in which BigQuery dataset is located. + * + * Generated from protobuf field string dataset_region = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDatasetRegion($var) + { + GPBUtil::checkString($var, True); + $this->dataset_region = $var; + + return $this; + } + + /** + * Pub/Sub topic where notifications will be sent after transfer runs + * associated with this transfer config finish. + * The format for specifying a pubsub topic is: + * `projects/{project_id}/topics/{topic_id}` + * + * Generated from protobuf field string notification_pubsub_topic = 15; + * @return string + */ + public function getNotificationPubsubTopic() + { + return $this->notification_pubsub_topic; + } + + /** + * Pub/Sub topic where notifications will be sent after transfer runs + * associated with this transfer config finish. + * The format for specifying a pubsub topic is: + * `projects/{project_id}/topics/{topic_id}` + * + * Generated from protobuf field string notification_pubsub_topic = 15; + * @param string $var + * @return $this + */ + public function setNotificationPubsubTopic($var) + { + GPBUtil::checkString($var, True); + $this->notification_pubsub_topic = $var; + + return $this; + } + + /** + * Email notifications will be sent according to these preferences + * to the email address of the user who owns this transfer config. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.EmailPreferences email_preferences = 18; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\EmailPreferences|null + */ + public function getEmailPreferences() + { + return $this->email_preferences; + } + + public function hasEmailPreferences() + { + return isset($this->email_preferences); + } + + public function clearEmailPreferences() + { + unset($this->email_preferences); + } + + /** + * Email notifications will be sent according to these preferences + * to the email address of the user who owns this transfer config. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.EmailPreferences email_preferences = 18; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\EmailPreferences $var + * @return $this + */ + public function setEmailPreferences($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\EmailPreferences::class); + $this->email_preferences = $var; + + return $this; + } + + /** + * Output only. Information about the user whose credentials are used to + * transfer data. Populated only for `transferConfigs.get` requests. In case + * the user information is not available, this field will not be populated. + * + * Generated from protobuf field optional .google.cloud.bigquery.datatransfer.v1.UserInfo owner_info = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\UserInfo|null + */ + public function getOwnerInfo() + { + return $this->owner_info; + } + + public function hasOwnerInfo() + { + return isset($this->owner_info); + } + + public function clearOwnerInfo() + { + unset($this->owner_info); + } + + /** + * Output only. Information about the user whose credentials are used to + * transfer data. Populated only for `transferConfigs.get` requests. In case + * the user information is not available, this field will not be populated. + * + * Generated from protobuf field optional .google.cloud.bigquery.datatransfer.v1.UserInfo owner_info = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\UserInfo $var + * @return $this + */ + public function setOwnerInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\UserInfo::class); + $this->owner_info = $var; + + return $this; + } + + /** + * The encryption configuration part. Currently, it is only used for the + * optional KMS key name. The BigQuery service account of your project must be + * granted permissions to use the key. Read methods will return the key name + * applied in effect. Write methods will apply the key if it is present, or + * otherwise try to apply project default keys if it is absent. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.EncryptionConfiguration encryption_configuration = 28; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\EncryptionConfiguration|null + */ + public function getEncryptionConfiguration() + { + return $this->encryption_configuration; + } + + public function hasEncryptionConfiguration() + { + return isset($this->encryption_configuration); + } + + public function clearEncryptionConfiguration() + { + unset($this->encryption_configuration); + } + + /** + * The encryption configuration part. Currently, it is only used for the + * optional KMS key name. The BigQuery service account of your project must be + * granted permissions to use the key. Read methods will return the key name + * applied in effect. Write methods will apply the key if it is present, or + * otherwise try to apply project default keys if it is absent. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.EncryptionConfiguration encryption_configuration = 28; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\EncryptionConfiguration $var + * @return $this + */ + public function setEncryptionConfiguration($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\EncryptionConfiguration::class); + $this->encryption_configuration = $var; + + return $this; + } + + /** + * Output only. Error code with detailed information about reason of the + * latest config failure. + * + * Generated from protobuf field .google.rpc.Status error = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Output only. Error code with detailed information about reason of the + * latest config failure. + * + * Generated from protobuf field .google.rpc.Status error = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error = $var; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferMessage.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferMessage.php new file mode 100644 index 000000000000..a870acd7fa2d --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferMessage.php @@ -0,0 +1,145 @@ +google.cloud.bigquery.datatransfer.v1.TransferMessage + */ +class TransferMessage extends \Google\Protobuf\Internal\Message +{ + /** + * Time when message was logged. + * + * Generated from protobuf field .google.protobuf.Timestamp message_time = 1; + */ + protected $message_time = null; + /** + * Message severity. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity severity = 2; + */ + protected $severity = 0; + /** + * Message text. + * + * Generated from protobuf field string message_text = 3; + */ + protected $message_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $message_time + * Time when message was logged. + * @type int $severity + * Message severity. + * @type string $message_text + * Message text. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce(); + parent::__construct($data); + } + + /** + * Time when message was logged. + * + * Generated from protobuf field .google.protobuf.Timestamp message_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getMessageTime() + { + return $this->message_time; + } + + public function hasMessageTime() + { + return isset($this->message_time); + } + + public function clearMessageTime() + { + unset($this->message_time); + } + + /** + * Time when message was logged. + * + * Generated from protobuf field .google.protobuf.Timestamp message_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setMessageTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->message_time = $var; + + return $this; + } + + /** + * Message severity. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity severity = 2; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * Message severity. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity severity = 2; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage\MessageSeverity::class); + $this->severity = $var; + + return $this; + } + + /** + * Message text. + * + * Generated from protobuf field string message_text = 3; + * @return string + */ + public function getMessageText() + { + return $this->message_text; + } + + /** + * Message text. + * + * Generated from protobuf field string message_text = 3; + * @param string $var + * @return $this + */ + public function setMessageText($var) + { + GPBUtil::checkString($var, True); + $this->message_text = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferMessage/MessageSeverity.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferMessage/MessageSeverity.php new file mode 100644 index 000000000000..60b5fec68483 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferMessage/MessageSeverity.php @@ -0,0 +1,71 @@ +google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity + */ +class MessageSeverity +{ + /** + * No severity specified. + * + * Generated from protobuf enum MESSAGE_SEVERITY_UNSPECIFIED = 0; + */ + const MESSAGE_SEVERITY_UNSPECIFIED = 0; + /** + * Informational message. + * + * Generated from protobuf enum INFO = 1; + */ + const INFO = 1; + /** + * Warning message. + * + * Generated from protobuf enum WARNING = 2; + */ + const WARNING = 2; + /** + * Error message. + * + * Generated from protobuf enum ERROR = 3; + */ + const ERROR = 3; + + private static $valueToName = [ + self::MESSAGE_SEVERITY_UNSPECIFIED => 'MESSAGE_SEVERITY_UNSPECIFIED', + self::INFO => 'INFO', + self::WARNING => 'WARNING', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MessageSeverity::class, \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage_MessageSeverity::class); + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferRun.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferRun.php new file mode 100644 index 000000000000..849c9f95aec3 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferRun.php @@ -0,0 +1,707 @@ +google.cloud.bigquery.datatransfer.v1.TransferRun + */ +class TransferRun extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the transfer run. + * Transfer run names have the form + * `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. + * The name is ignored when creating a transfer run. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Minimum time after which a transfer run can be started. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 3; + */ + protected $schedule_time = null; + /** + * For batch transfer runs, specifies the date and time of the data should be + * ingested. + * + * Generated from protobuf field .google.protobuf.Timestamp run_time = 10; + */ + protected $run_time = null; + /** + * Status of the transfer run. + * + * Generated from protobuf field .google.rpc.Status error_status = 21; + */ + protected $error_status = null; + /** + * Output only. Time when transfer run was started. + * Parameter ignored by server for input requests. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. Time when transfer run ended. + * Parameter ignored by server for input requests. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Last time the data transfer run state was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Parameters specific to each data source. For more information + * see the bq tab in the 'Setting up a data transfer' section for each data + * source. For example the parameters for Cloud Storage transfers are listed + * here: + * https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + * + * Generated from protobuf field .google.protobuf.Struct params = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $params = null; + /** + * Output only. Data source id. + * + * Generated from protobuf field string data_source_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $data_source_id = ''; + /** + * Data transfer run state. Ignored for input requests. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferState state = 8; + */ + protected $state = 0; + /** + * Deprecated. Unique ID of the user on whose behalf transfer is done. + * + * Generated from protobuf field int64 user_id = 11; + */ + protected $user_id = 0; + /** + * Output only. Describes the schedule of this transfer run if it was + * created as part of a regular schedule. For batch transfer runs that are + * scheduled manually, this is empty. + * NOTE: the system might choose to delay the schedule depending on the + * current load, so `schedule_time` doesn't always match this. + * + * Generated from protobuf field string schedule = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $schedule = ''; + /** + * Output only. Pub/Sub topic where a notification will be sent after this + * transfer run finishes. + * The format for specifying a pubsub topic is: + * `projects/{project_id}/topics/{topic_id}` + * + * Generated from protobuf field string notification_pubsub_topic = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $notification_pubsub_topic = ''; + /** + * Output only. Email notifications will be sent according to these + * preferences to the email address of the user who owns the transfer config + * this run was derived from. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.EmailPreferences email_preferences = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $email_preferences = null; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the transfer run. + * Transfer run names have the form + * `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. + * The name is ignored when creating a transfer run. + * @type \Google\Protobuf\Timestamp $schedule_time + * Minimum time after which a transfer run can be started. + * @type \Google\Protobuf\Timestamp $run_time + * For batch transfer runs, specifies the date and time of the data should be + * ingested. + * @type \Google\Rpc\Status $error_status + * Status of the transfer run. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. Time when transfer run was started. + * Parameter ignored by server for input requests. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. Time when transfer run ended. + * Parameter ignored by server for input requests. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Last time the data transfer run state was updated. + * @type \Google\Protobuf\Struct $params + * Output only. Parameters specific to each data source. For more information + * see the bq tab in the 'Setting up a data transfer' section for each data + * source. For example the parameters for Cloud Storage transfers are listed + * here: + * https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + * @type string $destination_dataset_id + * Output only. The BigQuery target dataset id. + * @type string $data_source_id + * Output only. Data source id. + * @type int $state + * Data transfer run state. Ignored for input requests. + * @type int|string $user_id + * Deprecated. Unique ID of the user on whose behalf transfer is done. + * @type string $schedule + * Output only. Describes the schedule of this transfer run if it was + * created as part of a regular schedule. For batch transfer runs that are + * scheduled manually, this is empty. + * NOTE: the system might choose to delay the schedule depending on the + * current load, so `schedule_time` doesn't always match this. + * @type string $notification_pubsub_topic + * Output only. Pub/Sub topic where a notification will be sent after this + * transfer run finishes. + * The format for specifying a pubsub topic is: + * `projects/{project_id}/topics/{topic_id}` + * @type \Google\Cloud\BigQuery\DataTransfer\V1\EmailPreferences $email_preferences + * Output only. Email notifications will be sent according to these + * preferences to the email address of the user who owns the transfer config + * this run was derived from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the transfer run. + * Transfer run names have the form + * `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. + * The name is ignored when creating a transfer run. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the transfer run. + * Transfer run names have the form + * `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. + * The name is ignored when creating a transfer run. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Minimum time after which a transfer run can be started. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * Minimum time after which a transfer run can be started. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + + /** + * For batch transfer runs, specifies the date and time of the data should be + * ingested. + * + * Generated from protobuf field .google.protobuf.Timestamp run_time = 10; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRunTime() + { + return $this->run_time; + } + + public function hasRunTime() + { + return isset($this->run_time); + } + + public function clearRunTime() + { + unset($this->run_time); + } + + /** + * For batch transfer runs, specifies the date and time of the data should be + * ingested. + * + * Generated from protobuf field .google.protobuf.Timestamp run_time = 10; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRunTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->run_time = $var; + + return $this; + } + + /** + * Status of the transfer run. + * + * Generated from protobuf field .google.rpc.Status error_status = 21; + * @return \Google\Rpc\Status|null + */ + public function getErrorStatus() + { + return $this->error_status; + } + + public function hasErrorStatus() + { + return isset($this->error_status); + } + + public function clearErrorStatus() + { + unset($this->error_status); + } + + /** + * Status of the transfer run. + * + * Generated from protobuf field .google.rpc.Status error_status = 21; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setErrorStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error_status = $var; + + return $this; + } + + /** + * Output only. Time when transfer run was started. + * Parameter ignored by server for input requests. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. Time when transfer run was started. + * Parameter ignored by server for input requests. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. Time when transfer run ended. + * Parameter ignored by server for input requests. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. Time when transfer run ended. + * Parameter ignored by server for input requests. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Last time the data transfer run state was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Last time the data transfer run state was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Parameters specific to each data source. For more information + * see the bq tab in the 'Setting up a data transfer' section for each data + * source. For example the parameters for Cloud Storage transfers are listed + * here: + * https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + * + * Generated from protobuf field .google.protobuf.Struct params = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Struct|null + */ + public function getParams() + { + return $this->params; + } + + public function hasParams() + { + return isset($this->params); + } + + public function clearParams() + { + unset($this->params); + } + + /** + * Output only. Parameters specific to each data source. For more information + * see the bq tab in the 'Setting up a data transfer' section for each data + * source. For example the parameters for Cloud Storage transfers are listed + * here: + * https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + * + * Generated from protobuf field .google.protobuf.Struct params = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParams($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->params = $var; + + return $this; + } + + /** + * Output only. The BigQuery target dataset id. + * + * Generated from protobuf field string destination_dataset_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDestinationDatasetId() + { + return $this->readOneof(2); + } + + public function hasDestinationDatasetId() + { + return $this->hasOneof(2); + } + + /** + * Output only. The BigQuery target dataset id. + * + * Generated from protobuf field string destination_dataset_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDestinationDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Output only. Data source id. + * + * Generated from protobuf field string data_source_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDataSourceId() + { + return $this->data_source_id; + } + + /** + * Output only. Data source id. + * + * Generated from protobuf field string data_source_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDataSourceId($var) + { + GPBUtil::checkString($var, True); + $this->data_source_id = $var; + + return $this; + } + + /** + * Data transfer run state. Ignored for input requests. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferState state = 8; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Data transfer run state. Ignored for input requests. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferState state = 8; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferState::class); + $this->state = $var; + + return $this; + } + + /** + * Deprecated. Unique ID of the user on whose behalf transfer is done. + * + * Generated from protobuf field int64 user_id = 11; + * @return int|string + */ + public function getUserId() + { + return $this->user_id; + } + + /** + * Deprecated. Unique ID of the user on whose behalf transfer is done. + * + * Generated from protobuf field int64 user_id = 11; + * @param int|string $var + * @return $this + */ + public function setUserId($var) + { + GPBUtil::checkInt64($var); + $this->user_id = $var; + + return $this; + } + + /** + * Output only. Describes the schedule of this transfer run if it was + * created as part of a regular schedule. For batch transfer runs that are + * scheduled manually, this is empty. + * NOTE: the system might choose to delay the schedule depending on the + * current load, so `schedule_time` doesn't always match this. + * + * Generated from protobuf field string schedule = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSchedule() + { + return $this->schedule; + } + + /** + * Output only. Describes the schedule of this transfer run if it was + * created as part of a regular schedule. For batch transfer runs that are + * scheduled manually, this is empty. + * NOTE: the system might choose to delay the schedule depending on the + * current load, so `schedule_time` doesn't always match this. + * + * Generated from protobuf field string schedule = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSchedule($var) + { + GPBUtil::checkString($var, True); + $this->schedule = $var; + + return $this; + } + + /** + * Output only. Pub/Sub topic where a notification will be sent after this + * transfer run finishes. + * The format for specifying a pubsub topic is: + * `projects/{project_id}/topics/{topic_id}` + * + * Generated from protobuf field string notification_pubsub_topic = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNotificationPubsubTopic() + { + return $this->notification_pubsub_topic; + } + + /** + * Output only. Pub/Sub topic where a notification will be sent after this + * transfer run finishes. + * The format for specifying a pubsub topic is: + * `projects/{project_id}/topics/{topic_id}` + * + * Generated from protobuf field string notification_pubsub_topic = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNotificationPubsubTopic($var) + { + GPBUtil::checkString($var, True); + $this->notification_pubsub_topic = $var; + + return $this; + } + + /** + * Output only. Email notifications will be sent according to these + * preferences to the email address of the user who owns the transfer config + * this run was derived from. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.EmailPreferences email_preferences = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\EmailPreferences|null + */ + public function getEmailPreferences() + { + return $this->email_preferences; + } + + public function hasEmailPreferences() + { + return isset($this->email_preferences); + } + + public function clearEmailPreferences() + { + unset($this->email_preferences); + } + + /** + * Output only. Email notifications will be sent according to these + * preferences to the email address of the user who owns the transfer config + * this run was derived from. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.EmailPreferences email_preferences = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\EmailPreferences $var + * @return $this + */ + public function setEmailPreferences($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\EmailPreferences::class); + $this->email_preferences = $var; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferState.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferState.php new file mode 100644 index 000000000000..37f2117d5072 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferState.php @@ -0,0 +1,83 @@ +google.cloud.bigquery.datatransfer.v1.TransferState + */ +class TransferState +{ + /** + * State placeholder (0). + * + * Generated from protobuf enum TRANSFER_STATE_UNSPECIFIED = 0; + */ + const TRANSFER_STATE_UNSPECIFIED = 0; + /** + * Data transfer is scheduled and is waiting to be picked up by + * data transfer backend (2). + * + * Generated from protobuf enum PENDING = 2; + */ + const PENDING = 2; + /** + * Data transfer is in progress (3). + * + * Generated from protobuf enum RUNNING = 3; + */ + const RUNNING = 3; + /** + * Data transfer completed successfully (4). + * + * Generated from protobuf enum SUCCEEDED = 4; + */ + const SUCCEEDED = 4; + /** + * Data transfer failed (5). + * + * Generated from protobuf enum FAILED = 5; + */ + const FAILED = 5; + /** + * Data transfer is cancelled (6). + * + * Generated from protobuf enum CANCELLED = 6; + */ + const CANCELLED = 6; + + private static $valueToName = [ + self::TRANSFER_STATE_UNSPECIFIED => 'TRANSFER_STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::RUNNING => 'RUNNING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::CANCELLED => 'CANCELLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferType.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferType.php new file mode 100644 index 000000000000..175c432ce5db --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/TransferType.php @@ -0,0 +1,63 @@ +google.cloud.bigquery.datatransfer.v1.TransferType + */ +class TransferType +{ + /** + * Invalid or Unknown transfer type placeholder. + * + * Generated from protobuf enum TRANSFER_TYPE_UNSPECIFIED = 0; + */ + const TRANSFER_TYPE_UNSPECIFIED = 0; + /** + * Batch data transfer. + * + * Generated from protobuf enum BATCH = 1; + */ + const BATCH = 1; + /** + * Streaming data transfer. Streaming data source currently doesn't + * support multiple transfer configs per project. + * + * Generated from protobuf enum STREAMING = 2; + */ + const STREAMING = 2; + + private static $valueToName = [ + self::TRANSFER_TYPE_UNSPECIFIED => 'TRANSFER_TYPE_UNSPECIFIED', + self::BATCH => 'BATCH', + self::STREAMING => 'STREAMING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/UnenrollDataSourcesRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/UnenrollDataSourcesRequest.php new file mode 100644 index 000000000000..b95df4cd08eb --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/UnenrollDataSourcesRequest.php @@ -0,0 +1,110 @@ +google.cloud.bigquery.datatransfer.v1.UnenrollDataSourcesRequest + */ +class UnenrollDataSourcesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project resource in the form: + * `projects/{project_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Data sources that are unenrolled. It is required to provide at least one + * data source id. + * + * Generated from protobuf field repeated string data_source_ids = 2; + */ + private $data_source_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the project resource in the form: + * `projects/{project_id}` + * @type array|\Google\Protobuf\Internal\RepeatedField $data_source_ids + * Data sources that are unenrolled. It is required to provide at least one + * data source id. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project resource in the form: + * `projects/{project_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the project resource in the form: + * `projects/{project_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Data sources that are unenrolled. It is required to provide at least one + * data source id. + * + * Generated from protobuf field repeated string data_source_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataSourceIds() + { + return $this->data_source_ids; + } + + /** + * Data sources that are unenrolled. It is required to provide at least one + * data source id. + * + * Generated from protobuf field repeated string data_source_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataSourceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->data_source_ids = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/UpdateTransferConfigRequest.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/UpdateTransferConfigRequest.php new file mode 100644 index 000000000000..a6a1b12a9307 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/UpdateTransferConfigRequest.php @@ -0,0 +1,388 @@ +google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + */ +class UpdateTransferConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Data transfer configuration to create. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferConfig transfer_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $transfer_config = null; + /** + * Deprecated: Authorization code was required when + * `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + * in any data sources. Use `version_info` instead. + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + * and new credentials are needed, as indicated by `CheckValidCreds`. In order + * to obtain authorization_code, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * update the transfer config. + * + * Generated from protobuf field string authorization_code = 3 [deprecated = true]; + * @deprecated + */ + protected $authorization_code = ''; + /** + * Required. Required list of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials + * are needed, as indicated by `CheckValidCreds`. In order to obtain version + * info, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * update the transfer config. + * + * Generated from protobuf field string version_info = 5; + */ + protected $version_info = ''; + /** + * Optional service account email. If this field is set, the transfer config + * will be created with this service account's credentials. It requires that + * the requesting user calling this API has permissions to act as this service + * account. + * Note that not all data sources support service account credentials when + * creating a transfer config. For the latest list of data sources, read about + * [using service + * accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). + * + * Generated from protobuf field string service_account_name = 6; + */ + protected $service_account_name = ''; + + /** + * @param \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig $transferConfig Required. Data transfer configuration to create. + * @param \Google\Protobuf\FieldMask $updateMask Required. Required list of fields to be updated in this request. + * + * @return \Google\Cloud\BigQuery\DataTransfer\V1\UpdateTransferConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig $transferConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setTransferConfig($transferConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig $transfer_config + * Required. Data transfer configuration to create. + * @type string $authorization_code + * Deprecated: Authorization code was required when + * `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + * in any data sources. Use `version_info` instead. + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + * and new credentials are needed, as indicated by `CheckValidCreds`. In order + * to obtain authorization_code, make a request to the following URL: + *
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     *           
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * update the transfer config. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Required list of fields to be updated in this request. + * @type string $version_info + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials + * are needed, as indicated by `CheckValidCreds`. In order to obtain version + * info, make a request to the following URL: + *
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     *           
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * update the transfer config. + * @type string $service_account_name + * Optional service account email. If this field is set, the transfer config + * will be created with this service account's credentials. It requires that + * the requesting user calling this API has permissions to act as this service + * account. + * Note that not all data sources support service account credentials when + * creating a transfer config. For the latest list of data sources, read about + * [using service + * accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datatransfer::initOnce(); + parent::__construct($data); + } + + /** + * Required. Data transfer configuration to create. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferConfig transfer_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig|null + */ + public function getTransferConfig() + { + return $this->transfer_config; + } + + public function hasTransferConfig() + { + return isset($this->transfer_config); + } + + public function clearTransferConfig() + { + unset($this->transfer_config); + } + + /** + * Required. Data transfer configuration to create. + * + * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferConfig transfer_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig $var + * @return $this + */ + public function setTransferConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig::class); + $this->transfer_config = $var; + + return $this; + } + + /** + * Deprecated: Authorization code was required when + * `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + * in any data sources. Use `version_info` instead. + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + * and new credentials are needed, as indicated by `CheckValidCreds`. In order + * to obtain authorization_code, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * update the transfer config. + * + * Generated from protobuf field string authorization_code = 3 [deprecated = true]; + * @return string + * @deprecated + */ + public function getAuthorizationCode() + { + @trigger_error('authorization_code is deprecated.', E_USER_DEPRECATED); + return $this->authorization_code; + } + + /** + * Deprecated: Authorization code was required when + * `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + * in any data sources. Use `version_info` instead. + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + * and new credentials are needed, as indicated by `CheckValidCreds`. In order + * to obtain authorization_code, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * update the transfer config. + * + * Generated from protobuf field string authorization_code = 3 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setAuthorizationCode($var) + { + @trigger_error('authorization_code is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->authorization_code = $var; + + return $this; + } + + /** + * Required. Required list of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Required list of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials + * are needed, as indicated by `CheckValidCreds`. In order to obtain version + * info, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * update the transfer config. + * + * Generated from protobuf field string version_info = 5; + * @return string + */ + public function getVersionInfo() + { + return $this->version_info; + } + + /** + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials + * are needed, as indicated by `CheckValidCreds`. In order to obtain version + * info, make a request to the following URL: + *
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * 
+ * * The client_id is the OAuth client_id of the data source as + * returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources + * method. + * Note that this should not be set when `service_account_name` is used to + * update the transfer config. + * + * Generated from protobuf field string version_info = 5; + * @param string $var + * @return $this + */ + public function setVersionInfo($var) + { + GPBUtil::checkString($var, True); + $this->version_info = $var; + + return $this; + } + + /** + * Optional service account email. If this field is set, the transfer config + * will be created with this service account's credentials. It requires that + * the requesting user calling this API has permissions to act as this service + * account. + * Note that not all data sources support service account credentials when + * creating a transfer config. For the latest list of data sources, read about + * [using service + * accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). + * + * Generated from protobuf field string service_account_name = 6; + * @return string + */ + public function getServiceAccountName() + { + return $this->service_account_name; + } + + /** + * Optional service account email. If this field is set, the transfer config + * will be created with this service account's credentials. It requires that + * the requesting user calling this API has permissions to act as this service + * account. + * Note that not all data sources support service account credentials when + * creating a transfer config. For the latest list of data sources, read about + * [using service + * accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). + * + * Generated from protobuf field string service_account_name = 6; + * @param string $var + * @return $this + */ + public function setServiceAccountName($var) + { + GPBUtil::checkString($var, True); + $this->service_account_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/UserInfo.php b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/UserInfo.php new file mode 100644 index 000000000000..c1443d0e955d --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/proto/src/Google/Cloud/BigQuery/DataTransfer/V1/UserInfo.php @@ -0,0 +1,77 @@ +google.cloud.bigquery.datatransfer.v1.UserInfo + */ +class UserInfo extends \Google\Protobuf\Internal\Message +{ + /** + * E-mail address of the user. + * + * Generated from protobuf field optional string email = 1; + */ + protected $email = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $email + * E-mail address of the user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce(); + parent::__construct($data); + } + + /** + * E-mail address of the user. + * + * Generated from protobuf field optional string email = 1; + * @return string + */ + public function getEmail() + { + return isset($this->email) ? $this->email : ''; + } + + public function hasEmail() + { + return isset($this->email); + } + + public function clearEmail() + { + unset($this->email); + } + + /** + * E-mail address of the user. + * + * Generated from protobuf field optional string email = 1; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/check_valid_creds.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/check_valid_creds.php new file mode 100644 index 000000000000..fd44c27b79c6 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/check_valid_creds.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CheckValidCredsResponse $response */ + $response = $dataTransferServiceClient->checkValidCreds($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DataTransferServiceClient::dataSourceName('[PROJECT]', '[DATA_SOURCE]'); + + check_valid_creds_sample($formattedName); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_CheckValidCreds_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/create_transfer_config.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/create_transfer_config.php new file mode 100644 index 000000000000..8fd517d92263 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/create_transfer_config.php @@ -0,0 +1,77 @@ +setParent($formattedParent) + ->setTransferConfig($transferConfig); + + // Call the API and handle any network failures. + try { + /** @var TransferConfig $response */ + $response = $dataTransferServiceClient->createTransferConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DataTransferServiceClient::projectName('[PROJECT]'); + + create_transfer_config_sample($formattedParent); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_CreateTransferConfig_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/delete_transfer_config.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/delete_transfer_config.php new file mode 100644 index 000000000000..b61329e4e465 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/delete_transfer_config.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $dataTransferServiceClient->deleteTransferConfig($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DataTransferServiceClient::transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + + delete_transfer_config_sample($formattedName); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferConfig_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/delete_transfer_run.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/delete_transfer_run.php new file mode 100644 index 000000000000..ce7b3ea6cf04 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/delete_transfer_run.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $dataTransferServiceClient->deleteTransferRun($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DataTransferServiceClient::runName('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]'); + + delete_transfer_run_sample($formattedName); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferRun_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/enroll_data_sources.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/enroll_data_sources.php new file mode 100644 index 000000000000..61f2edc53140 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/enroll_data_sources.php @@ -0,0 +1,62 @@ +enrollDataSources($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_EnrollDataSources_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_data_source.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_data_source.php new file mode 100644 index 000000000000..c39115e7a0da --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_data_source.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DataSource $response */ + $response = $dataTransferServiceClient->getDataSource($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DataTransferServiceClient::dataSourceName('[PROJECT]', '[DATA_SOURCE]'); + + get_data_source_sample($formattedName); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_GetDataSource_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_location.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_location.php new file mode 100644 index 000000000000..c1d7d545dd69 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_GetLocation_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_transfer_config.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_transfer_config.php new file mode 100644 index 000000000000..61aa88b01764 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_transfer_config.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var TransferConfig $response */ + $response = $dataTransferServiceClient->getTransferConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DataTransferServiceClient::transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + + get_transfer_config_sample($formattedName); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_GetTransferConfig_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_transfer_run.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_transfer_run.php new file mode 100644 index 000000000000..a47824de7290 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/get_transfer_run.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var TransferRun $response */ + $response = $dataTransferServiceClient->getTransferRun($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DataTransferServiceClient::runName('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]'); + + get_transfer_run_sample($formattedName); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_GetTransferRun_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_data_sources.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_data_sources.php new file mode 100644 index 000000000000..ed56eb6de375 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_data_sources.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dataTransferServiceClient->listDataSources($request); + + /** @var DataSource $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DataTransferServiceClient::projectName('[PROJECT]'); + + list_data_sources_sample($formattedParent); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_ListDataSources_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_locations.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_locations.php new file mode 100644 index 000000000000..292209afe3af --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_ListLocations_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_transfer_configs.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_transfer_configs.php new file mode 100644 index 000000000000..83ed0e4f60bb --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_transfer_configs.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dataTransferServiceClient->listTransferConfigs($request); + + /** @var TransferConfig $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DataTransferServiceClient::projectName('[PROJECT]'); + + list_transfer_configs_sample($formattedParent); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferConfigs_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_transfer_logs.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_transfer_logs.php new file mode 100644 index 000000000000..ae83b475dd8c --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_transfer_logs.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dataTransferServiceClient->listTransferLogs($request); + + /** @var TransferMessage $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DataTransferServiceClient::runName('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]'); + + list_transfer_logs_sample($formattedParent); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferLogs_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_transfer_runs.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_transfer_runs.php new file mode 100644 index 000000000000..fdf0bc8552e5 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/list_transfer_runs.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dataTransferServiceClient->listTransferRuns($request); + + /** @var TransferRun $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DataTransferServiceClient::transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + + list_transfer_runs_sample($formattedParent); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferRuns_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/schedule_transfer_runs.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/schedule_transfer_runs.php new file mode 100644 index 000000000000..eb4bc5505a14 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/schedule_transfer_runs.php @@ -0,0 +1,82 @@ +setParent($formattedParent) + ->setStartTime($startTime) + ->setEndTime($endTime); + + // Call the API and handle any network failures. + try { + /** @var ScheduleTransferRunsResponse $response */ + $response = $dataTransferServiceClient->scheduleTransferRuns($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DataTransferServiceClient::transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + + schedule_transfer_runs_sample($formattedParent); +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_ScheduleTransferRuns_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/start_manual_transfer_runs.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/start_manual_transfer_runs.php new file mode 100644 index 000000000000..38bf28def1e7 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/start_manual_transfer_runs.php @@ -0,0 +1,60 @@ +startManualTransferRuns($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_StartManualTransferRuns_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/unenroll_data_sources.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/unenroll_data_sources.php new file mode 100644 index 000000000000..0bdd9433964c --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/unenroll_data_sources.php @@ -0,0 +1,59 @@ +unenrollDataSources($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_UnenrollDataSources_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/update_transfer_config.php b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/update_transfer_config.php new file mode 100644 index 000000000000..1a25f828d7b2 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/samples/V1/DataTransferServiceClient/update_transfer_config.php @@ -0,0 +1,63 @@ +setTransferConfig($transferConfig) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var TransferConfig $response */ + $response = $dataTransferServiceClient->updateTransferConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigquerydatatransfer_v1_generated_DataTransferService_UpdateTransferConfig_sync] diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/Client/DataTransferServiceClient.php b/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/Client/DataTransferServiceClient.php new file mode 100644 index 000000000000..05031720c479 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/Client/DataTransferServiceClient.php @@ -0,0 +1,940 @@ + checkValidCredsAsync(CheckValidCredsRequest $request, array $optionalArgs = []) + * @method PromiseInterface createTransferConfigAsync(CreateTransferConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteTransferConfigAsync(DeleteTransferConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteTransferRunAsync(DeleteTransferRunRequest $request, array $optionalArgs = []) + * @method PromiseInterface enrollDataSourcesAsync(EnrollDataSourcesRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDataSourceAsync(GetDataSourceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getTransferConfigAsync(GetTransferConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface getTransferRunAsync(GetTransferRunRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDataSourcesAsync(ListDataSourcesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTransferConfigsAsync(ListTransferConfigsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTransferLogsAsync(ListTransferLogsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTransferRunsAsync(ListTransferRunsRequest $request, array $optionalArgs = []) + * @method PromiseInterface scheduleTransferRunsAsync(ScheduleTransferRunsRequest $request, array $optionalArgs = []) + * @method PromiseInterface startManualTransferRunsAsync(StartManualTransferRunsRequest $request, array $optionalArgs = []) + * @method PromiseInterface unenrollDataSourcesAsync(UnenrollDataSourcesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateTransferConfigAsync(UpdateTransferConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class DataTransferServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.bigquery.datatransfer.v1.DataTransferService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'bigquerydatatransfer.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'bigquerydatatransfer.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/data_transfer_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/data_transfer_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/data_transfer_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/data_transfer_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a data_source + * resource. + * + * @param string $project + * @param string $dataSource + * + * @return string The formatted data_source resource. + */ + public static function dataSourceName(string $project, string $dataSource): string + { + return self::getPathTemplate('dataSource')->render([ + 'project' => $project, + 'data_source' => $dataSource, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_data_source resource. + * + * @param string $project + * @param string $dataSource + * + * @return string The formatted project_data_source resource. + */ + public static function projectDataSourceName(string $project, string $dataSource): string + { + return self::getPathTemplate('projectDataSource')->render([ + 'project' => $project, + 'data_source' => $dataSource, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_source resource. + * + * @param string $project + * @param string $location + * @param string $dataSource + * + * @return string The formatted project_location_data_source resource. + */ + public static function projectLocationDataSourceName(string $project, string $location, string $dataSource): string + { + return self::getPathTemplate('projectLocationDataSource')->render([ + 'project' => $project, + 'location' => $location, + 'data_source' => $dataSource, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_transfer_config resource. + * + * @param string $project + * @param string $location + * @param string $transferConfig + * + * @return string The formatted project_location_transfer_config resource. + */ + public static function projectLocationTransferConfigName(string $project, string $location, string $transferConfig): string + { + return self::getPathTemplate('projectLocationTransferConfig')->render([ + 'project' => $project, + 'location' => $location, + 'transfer_config' => $transferConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_transfer_config_run resource. + * + * @param string $project + * @param string $location + * @param string $transferConfig + * @param string $run + * + * @return string The formatted project_location_transfer_config_run resource. + */ + public static function projectLocationTransferConfigRunName(string $project, string $location, string $transferConfig, string $run): string + { + return self::getPathTemplate('projectLocationTransferConfigRun')->render([ + 'project' => $project, + 'location' => $location, + 'transfer_config' => $transferConfig, + 'run' => $run, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_transfer_config resource. + * + * @param string $project + * @param string $transferConfig + * + * @return string The formatted project_transfer_config resource. + */ + public static function projectTransferConfigName(string $project, string $transferConfig): string + { + return self::getPathTemplate('projectTransferConfig')->render([ + 'project' => $project, + 'transfer_config' => $transferConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_transfer_config_run resource. + * + * @param string $project + * @param string $transferConfig + * @param string $run + * + * @return string The formatted project_transfer_config_run resource. + */ + public static function projectTransferConfigRunName(string $project, string $transferConfig, string $run): string + { + return self::getPathTemplate('projectTransferConfigRun')->render([ + 'project' => $project, + 'transfer_config' => $transferConfig, + 'run' => $run, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a run + * resource. + * + * @param string $project + * @param string $transferConfig + * @param string $run + * + * @return string The formatted run resource. + */ + public static function runName(string $project, string $transferConfig, string $run): string + { + return self::getPathTemplate('run')->render([ + 'project' => $project, + 'transfer_config' => $transferConfig, + 'run' => $run, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * transfer_config resource. + * + * @param string $project + * @param string $transferConfig + * + * @return string The formatted transfer_config resource. + */ + public static function transferConfigName(string $project, string $transferConfig): string + { + return self::getPathTemplate('transferConfig')->render([ + 'project' => $project, + 'transfer_config' => $transferConfig, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - dataSource: projects/{project}/dataSources/{data_source} + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * - projectDataSource: projects/{project}/dataSources/{data_source} + * - projectLocationDataSource: projects/{project}/locations/{location}/dataSources/{data_source} + * - projectLocationTransferConfig: projects/{project}/locations/{location}/transferConfigs/{transfer_config} + * - projectLocationTransferConfigRun: projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run} + * - projectTransferConfig: projects/{project}/transferConfigs/{transfer_config} + * - projectTransferConfigRun: projects/{project}/transferConfigs/{transfer_config}/runs/{run} + * - run: projects/{project}/transferConfigs/{transfer_config}/runs/{run} + * - transferConfig: projects/{project}/transferConfigs/{transfer_config} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'bigquerydatatransfer.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns true if valid credentials exist for the given data source and + * requesting user. + * + * The async variant is {@see DataTransferServiceClient::checkValidCredsAsync()} . + * + * @example samples/V1/DataTransferServiceClient/check_valid_creds.php + * + * @param CheckValidCredsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CheckValidCredsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function checkValidCreds(CheckValidCredsRequest $request, array $callOptions = []): CheckValidCredsResponse + { + return $this->startApiCall('CheckValidCreds', $request, $callOptions)->wait(); + } + + /** + * Creates a new data transfer configuration. + * + * The async variant is + * {@see DataTransferServiceClient::createTransferConfigAsync()} . + * + * @example samples/V1/DataTransferServiceClient/create_transfer_config.php + * + * @param CreateTransferConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TransferConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTransferConfig(CreateTransferConfigRequest $request, array $callOptions = []): TransferConfig + { + return $this->startApiCall('CreateTransferConfig', $request, $callOptions)->wait(); + } + + /** + * Deletes a data transfer configuration, including any associated transfer + * runs and logs. + * + * The async variant is + * {@see DataTransferServiceClient::deleteTransferConfigAsync()} . + * + * @example samples/V1/DataTransferServiceClient/delete_transfer_config.php + * + * @param DeleteTransferConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteTransferConfig(DeleteTransferConfigRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteTransferConfig', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified transfer run. + * + * The async variant is {@see DataTransferServiceClient::deleteTransferRunAsync()} + * . + * + * @example samples/V1/DataTransferServiceClient/delete_transfer_run.php + * + * @param DeleteTransferRunRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteTransferRun(DeleteTransferRunRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteTransferRun', $request, $callOptions)->wait(); + } + + /** + * Enroll data sources in a user project. This allows users to create transfer + * configurations for these data sources. They will also appear in the + * ListDataSources RPC and as such, will appear in the + * [BigQuery UI](https://console.cloud.google.com/bigquery), and the documents + * can be found in the public guide for + * [BigQuery Web UI](https://cloud.google.com/bigquery/bigquery-web-ui) and + * [Data Transfer + * Service](https://cloud.google.com/bigquery/docs/working-with-transfers). + * + * The async variant is {@see DataTransferServiceClient::enrollDataSourcesAsync()} + * . + * + * @example samples/V1/DataTransferServiceClient/enroll_data_sources.php + * + * @param EnrollDataSourcesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function enrollDataSources(EnrollDataSourcesRequest $request, array $callOptions = []): void + { + $this->startApiCall('EnrollDataSources', $request, $callOptions)->wait(); + } + + /** + * Retrieves a supported data source and returns its settings. + * + * The async variant is {@see DataTransferServiceClient::getDataSourceAsync()} . + * + * @example samples/V1/DataTransferServiceClient/get_data_source.php + * + * @param GetDataSourceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataSource + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDataSource(GetDataSourceRequest $request, array $callOptions = []): DataSource + { + return $this->startApiCall('GetDataSource', $request, $callOptions)->wait(); + } + + /** + * Returns information about a data transfer config. + * + * The async variant is {@see DataTransferServiceClient::getTransferConfigAsync()} + * . + * + * @example samples/V1/DataTransferServiceClient/get_transfer_config.php + * + * @param GetTransferConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TransferConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTransferConfig(GetTransferConfigRequest $request, array $callOptions = []): TransferConfig + { + return $this->startApiCall('GetTransferConfig', $request, $callOptions)->wait(); + } + + /** + * Returns information about the particular transfer run. + * + * The async variant is {@see DataTransferServiceClient::getTransferRunAsync()} . + * + * @example samples/V1/DataTransferServiceClient/get_transfer_run.php + * + * @param GetTransferRunRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TransferRun + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTransferRun(GetTransferRunRequest $request, array $callOptions = []): TransferRun + { + return $this->startApiCall('GetTransferRun', $request, $callOptions)->wait(); + } + + /** + * Lists supported data sources and returns their settings. + * + * The async variant is {@see DataTransferServiceClient::listDataSourcesAsync()} . + * + * @example samples/V1/DataTransferServiceClient/list_data_sources.php + * + * @param ListDataSourcesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDataSources(ListDataSourcesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDataSources', $request, $callOptions); + } + + /** + * Returns information about all transfer configs owned by a project in the + * specified location. + * + * The async variant is + * {@see DataTransferServiceClient::listTransferConfigsAsync()} . + * + * @example samples/V1/DataTransferServiceClient/list_transfer_configs.php + * + * @param ListTransferConfigsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTransferConfigs(ListTransferConfigsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTransferConfigs', $request, $callOptions); + } + + /** + * Returns log messages for the transfer run. + * + * The async variant is {@see DataTransferServiceClient::listTransferLogsAsync()} . + * + * @example samples/V1/DataTransferServiceClient/list_transfer_logs.php + * + * @param ListTransferLogsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTransferLogs(ListTransferLogsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTransferLogs', $request, $callOptions); + } + + /** + * Returns information about running and completed transfer runs. + * + * The async variant is {@see DataTransferServiceClient::listTransferRunsAsync()} . + * + * @example samples/V1/DataTransferServiceClient/list_transfer_runs.php + * + * @param ListTransferRunsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTransferRuns(ListTransferRunsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTransferRuns', $request, $callOptions); + } + + /** + * Creates transfer runs for a time range [start_time, end_time]. + * For each date - or whatever granularity the data source supports - in the + * range, one transfer run is created. + * Note that runs are created per UTC time in the time range. + * DEPRECATED: use StartManualTransferRuns instead. + * + * The async variant is + * {@see DataTransferServiceClient::scheduleTransferRunsAsync()} . + * + * @example samples/V1/DataTransferServiceClient/schedule_transfer_runs.php + * + * @param ScheduleTransferRunsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ScheduleTransferRunsResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @deprecated This method will be removed in the next major version update. + */ + public function scheduleTransferRuns(ScheduleTransferRunsRequest $request, array $callOptions = []): ScheduleTransferRunsResponse + { + return $this->startApiCall('ScheduleTransferRuns', $request, $callOptions)->wait(); + } + + /** + * Start manual transfer runs to be executed now with schedule_time equal to + * current time. The transfer runs can be created for a time range where the + * run_time is between start_time (inclusive) and end_time (exclusive), or for + * a specific run_time. + * + * The async variant is + * {@see DataTransferServiceClient::startManualTransferRunsAsync()} . + * + * @example samples/V1/DataTransferServiceClient/start_manual_transfer_runs.php + * + * @param StartManualTransferRunsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return StartManualTransferRunsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function startManualTransferRuns(StartManualTransferRunsRequest $request, array $callOptions = []): StartManualTransferRunsResponse + { + return $this->startApiCall('StartManualTransferRuns', $request, $callOptions)->wait(); + } + + /** + * Unenroll data sources in a user project. This allows users to remove + * transfer configurations for these data sources. They will no longer appear + * in the ListDataSources RPC and will also no longer appear in the [BigQuery + * UI](https://console.cloud.google.com/bigquery). Data transfers + * configurations of unenrolled data sources will not be scheduled. + * + * The async variant is + * {@see DataTransferServiceClient::unenrollDataSourcesAsync()} . + * + * @example samples/V1/DataTransferServiceClient/unenroll_data_sources.php + * + * @param UnenrollDataSourcesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function unenrollDataSources(UnenrollDataSourcesRequest $request, array $callOptions = []): void + { + $this->startApiCall('UnenrollDataSources', $request, $callOptions)->wait(); + } + + /** + * Updates a data transfer configuration. + * All fields must be set, even if they are not updated. + * + * The async variant is + * {@see DataTransferServiceClient::updateTransferConfigAsync()} . + * + * @example samples/V1/DataTransferServiceClient/update_transfer_config.php + * + * @param UpdateTransferConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TransferConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateTransferConfig(UpdateTransferConfigRequest $request, array $callOptions = []): TransferConfig + { + return $this->startApiCall('UpdateTransferConfig', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see DataTransferServiceClient::getLocationAsync()} . + * + * @example samples/V1/DataTransferServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see DataTransferServiceClient::listLocationsAsync()} . + * + * @example samples/V1/DataTransferServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..23bf9fbef1f5 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/gapic_metadata.json @@ -0,0 +1,108 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.bigquery.datatransfer.v1", + "libraryPackage": "Google\\Cloud\\BigQuery\\DataTransfer\\V1", + "services": { + "DataTransferService": { + "clients": { + "grpc": { + "libraryClient": "DataTransferServiceGapicClient", + "rpcs": { + "CheckValidCreds": { + "methods": [ + "checkValidCreds" + ] + }, + "CreateTransferConfig": { + "methods": [ + "createTransferConfig" + ] + }, + "DeleteTransferConfig": { + "methods": [ + "deleteTransferConfig" + ] + }, + "DeleteTransferRun": { + "methods": [ + "deleteTransferRun" + ] + }, + "EnrollDataSources": { + "methods": [ + "enrollDataSources" + ] + }, + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "GetTransferConfig": { + "methods": [ + "getTransferConfig" + ] + }, + "GetTransferRun": { + "methods": [ + "getTransferRun" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources" + ] + }, + "ListTransferConfigs": { + "methods": [ + "listTransferConfigs" + ] + }, + "ListTransferLogs": { + "methods": [ + "listTransferLogs" + ] + }, + "ListTransferRuns": { + "methods": [ + "listTransferRuns" + ] + }, + "ScheduleTransferRuns": { + "methods": [ + "scheduleTransferRuns" + ] + }, + "StartManualTransferRuns": { + "methods": [ + "startManualTransferRuns" + ] + }, + "UnenrollDataSources": { + "methods": [ + "unenrollDataSources" + ] + }, + "UpdateTransferConfig": { + "methods": [ + "updateTransferConfig" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/resources/data_transfer_service_client_config.json b/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/resources/data_transfer_service_client_config.json new file mode 100644 index 000000000000..80caf7d9cba5 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/resources/data_transfer_service_client_config.json @@ -0,0 +1,135 @@ +{ + "interfaces": { + "google.cloud.bigquery.datatransfer.v1.DataTransferService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 20000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "CheckValidCreds": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateTransferConfig": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteTransferConfig": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteTransferRun": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "EnrollDataSources": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetDataSource": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTransferConfig": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTransferRun": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDataSources": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTransferConfigs": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTransferLogs": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTransferRuns": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ScheduleTransferRuns": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StartManualTransferRuns": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UnenrollDataSources": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateTransferConfig": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/resources/data_transfer_service_descriptor_config.php b/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/resources/data_transfer_service_descriptor_config.php new file mode 100644 index 000000000000..fa7c2336fc25 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/resources/data_transfer_service_descriptor_config.php @@ -0,0 +1,300 @@ + [ + 'google.cloud.bigquery.datatransfer.v1.DataTransferService' => [ + 'CheckValidCreds' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\CheckValidCredsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateTransferConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteTransferConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTransferRun' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'EnrollDataSources' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDataSource' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\DataSource', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetTransferConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetTransferRun' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\TransferRun', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListDataSources' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataSources', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\ListDataSourcesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListTransferConfigs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTransferConfigs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\ListTransferConfigsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListTransferLogs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTransferMessages', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\ListTransferLogsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListTransferRuns' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTransferRuns', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\ListTransferRunsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ScheduleTransferRuns' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\ScheduleTransferRunsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'StartManualTransferRuns' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\StartManualTransferRunsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UnenrollDataSources' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateTransferConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig', + 'headerParams' => [ + [ + 'keyName' => 'transfer_config.name', + 'fieldAccessors' => [ + 'getTransferConfig', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'dataSource' => 'projects/{project}/dataSources/{data_source}', + 'location' => 'projects/{project}/locations/{location}', + 'project' => 'projects/{project}', + 'projectDataSource' => 'projects/{project}/dataSources/{data_source}', + 'projectLocationDataSource' => 'projects/{project}/locations/{location}/dataSources/{data_source}', + 'projectLocationTransferConfig' => 'projects/{project}/locations/{location}/transferConfigs/{transfer_config}', + 'projectLocationTransferConfigRun' => 'projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}', + 'projectTransferConfig' => 'projects/{project}/transferConfigs/{transfer_config}', + 'projectTransferConfigRun' => 'projects/{project}/transferConfigs/{transfer_config}/runs/{run}', + 'run' => 'projects/{project}/transferConfigs/{transfer_config}/runs/{run}', + 'transferConfig' => 'projects/{project}/transferConfigs/{transfer_config}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/resources/data_transfer_service_rest_client_config.php b/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/resources/data_transfer_service_rest_client_config.php new file mode 100644 index 000000000000..ba2556ef3d8d --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/src/V1/resources/data_transfer_service_rest_client_config.php @@ -0,0 +1,339 @@ + [ + 'google.cloud.bigquery.datatransfer.v1.DataTransferService' => [ + 'CheckValidCreds' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataSources/*}:checkValidCreds', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/dataSources/*}:checkValidCreds', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateTransferConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/transferConfigs', + 'body' => 'transfer_config', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}/transferConfigs', + 'body' => 'transfer_config', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteTransferConfig' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/transferConfigs/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/transferConfigs/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTransferRun' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/transferConfigs/*/runs/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'EnrollDataSources' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}:enrollDataSources', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*}:enrollDataSources', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDataSource' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataSources/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/dataSources/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTransferConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/transferConfigs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/transferConfigs/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTransferRun' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/transferConfigs/*/runs/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListDataSources' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/dataSources', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*}/dataSources', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTransferConfigs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/transferConfigs', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*}/transferConfigs', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTransferLogs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/transferConfigs/*/runs/*}/transferLogs', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/transferConfigs/*/runs/*}/transferLogs', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTransferRuns' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/transferConfigs/*}/runs', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/transferConfigs/*}/runs', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ScheduleTransferRuns' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/transferConfigs/*}:scheduleRuns', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/transferConfigs/*}:scheduleRuns', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'StartManualTransferRuns' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/transferConfigs/*}:startManualRuns', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/transferConfigs/*}:startManualRuns', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UnenrollDataSources' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}:unenrollDataSources', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateTransferConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{transfer_config.name=projects/*/locations/*/transferConfigs/*}', + 'body' => 'transfer_config', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{transfer_config.name=projects/*/transferConfigs/*}', + 'body' => 'transfer_config', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'transfer_config.name' => [ + 'getters' => [ + 'getTransferConfig', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/BigQueryDataTransfer/v1/tests/Unit/V1/Client/DataTransferServiceClientTest.php b/owl-bot-staging/BigQueryDataTransfer/v1/tests/Unit/V1/Client/DataTransferServiceClientTest.php new file mode 100644 index 000000000000..b68964a97156 --- /dev/null +++ b/owl-bot-staging/BigQueryDataTransfer/v1/tests/Unit/V1/Client/DataTransferServiceClientTest.php @@ -0,0 +1,1373 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DataTransferServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DataTransferServiceClient($options); + } + + /** @test */ + public function checkValidCredsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $hasValidCreds = false; + $expectedResponse = new CheckValidCredsResponse(); + $expectedResponse->setHasValidCreds($hasValidCreds); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[DATA_SOURCE]'); + $request = (new CheckValidCredsRequest()) + ->setName($formattedName); + $response = $gapicClient->checkValidCreds($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/CheckValidCreds', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function checkValidCredsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[DATA_SOURCE]'); + $request = (new CheckValidCredsRequest()) + ->setName($formattedName); + try { + $gapicClient->checkValidCreds($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTransferConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $destinationDatasetId = 'destinationDatasetId1541564179'; + $displayName = 'displayName1615086568'; + $dataSourceId = 'dataSourceId-1015796374'; + $schedule = 'schedule-697920873'; + $dataRefreshWindowDays = 327632845; + $disabled = true; + $userId = 147132913; + $datasetRegion = 'datasetRegion959248539'; + $notificationPubsubTopic = 'notificationPubsubTopic1794281191'; + $expectedResponse = new TransferConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDestinationDatasetId($destinationDatasetId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDataSourceId($dataSourceId); + $expectedResponse->setSchedule($schedule); + $expectedResponse->setDataRefreshWindowDays($dataRefreshWindowDays); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setUserId($userId); + $expectedResponse->setDatasetRegion($datasetRegion); + $expectedResponse->setNotificationPubsubTopic($notificationPubsubTopic); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $transferConfig = new TransferConfig(); + $request = (new CreateTransferConfigRequest()) + ->setParent($formattedParent) + ->setTransferConfig($transferConfig); + $response = $gapicClient->createTransferConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/CreateTransferConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTransferConfig(); + $this->assertProtobufEquals($transferConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTransferConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $transferConfig = new TransferConfig(); + $request = (new CreateTransferConfigRequest()) + ->setParent($formattedParent) + ->setTransferConfig($transferConfig); + try { + $gapicClient->createTransferConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTransferConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + $request = (new DeleteTransferConfigRequest()) + ->setName($formattedName); + $gapicClient->deleteTransferConfig($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/DeleteTransferConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTransferConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + $request = (new DeleteTransferConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteTransferConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTransferRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]'); + $request = (new DeleteTransferRunRequest()) + ->setName($formattedName); + $gapicClient->deleteTransferRun($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/DeleteTransferRun', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTransferRunExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]'); + $request = (new DeleteTransferRunRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteTransferRun($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function enrollDataSourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + $request = new EnrollDataSourcesRequest(); + $gapicClient->enrollDataSources($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/EnrollDataSources', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function enrollDataSourcesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new EnrollDataSourcesRequest(); + try { + $gapicClient->enrollDataSources($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataSourceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $dataSourceId = 'dataSourceId-1015796374'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $clientId = 'clientId-1904089585'; + $supportsMultipleTransfers = true; + $updateDeadlineSeconds = 991471694; + $defaultSchedule = 'defaultSchedule-800168235'; + $supportsCustomSchedule = true; + $helpUrl = 'helpUrl-789431439'; + $defaultDataRefreshWindowDays = 1804935157; + $manualRunsDisabled = true; + $expectedResponse = new DataSource(); + $expectedResponse->setName($name2); + $expectedResponse->setDataSourceId($dataSourceId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setClientId($clientId); + $expectedResponse->setSupportsMultipleTransfers($supportsMultipleTransfers); + $expectedResponse->setUpdateDeadlineSeconds($updateDeadlineSeconds); + $expectedResponse->setDefaultSchedule($defaultSchedule); + $expectedResponse->setSupportsCustomSchedule($supportsCustomSchedule); + $expectedResponse->setHelpUrl($helpUrl); + $expectedResponse->setDefaultDataRefreshWindowDays($defaultDataRefreshWindowDays); + $expectedResponse->setManualRunsDisabled($manualRunsDisabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[DATA_SOURCE]'); + $request = (new GetDataSourceRequest()) + ->setName($formattedName); + $response = $gapicClient->getDataSource($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/GetDataSource', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataSourceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[DATA_SOURCE]'); + $request = (new GetDataSourceRequest()) + ->setName($formattedName); + try { + $gapicClient->getDataSource($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTransferConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $destinationDatasetId = 'destinationDatasetId1541564179'; + $displayName = 'displayName1615086568'; + $dataSourceId = 'dataSourceId-1015796374'; + $schedule = 'schedule-697920873'; + $dataRefreshWindowDays = 327632845; + $disabled = true; + $userId = 147132913; + $datasetRegion = 'datasetRegion959248539'; + $notificationPubsubTopic = 'notificationPubsubTopic1794281191'; + $expectedResponse = new TransferConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setDestinationDatasetId($destinationDatasetId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDataSourceId($dataSourceId); + $expectedResponse->setSchedule($schedule); + $expectedResponse->setDataRefreshWindowDays($dataRefreshWindowDays); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setUserId($userId); + $expectedResponse->setDatasetRegion($datasetRegion); + $expectedResponse->setNotificationPubsubTopic($notificationPubsubTopic); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + $request = (new GetTransferConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getTransferConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/GetTransferConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTransferConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + $request = (new GetTransferConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->getTransferConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTransferRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $destinationDatasetId = 'destinationDatasetId1541564179'; + $dataSourceId = 'dataSourceId-1015796374'; + $userId = 147132913; + $schedule = 'schedule-697920873'; + $notificationPubsubTopic = 'notificationPubsubTopic1794281191'; + $expectedResponse = new TransferRun(); + $expectedResponse->setName($name2); + $expectedResponse->setDestinationDatasetId($destinationDatasetId); + $expectedResponse->setDataSourceId($dataSourceId); + $expectedResponse->setUserId($userId); + $expectedResponse->setSchedule($schedule); + $expectedResponse->setNotificationPubsubTopic($notificationPubsubTopic); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]'); + $request = (new GetTransferRunRequest()) + ->setName($formattedName); + $response = $gapicClient->getTransferRun($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/GetTransferRun', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTransferRunExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]'); + $request = (new GetTransferRunRequest()) + ->setName($formattedName); + try { + $gapicClient->getTransferRun($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataSourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataSourcesElement = new DataSource(); + $dataSources = [ + $dataSourcesElement, + ]; + $expectedResponse = new ListDataSourcesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataSources($dataSources); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListDataSourcesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listDataSources($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataSources()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListDataSources', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataSourcesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListDataSourcesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listDataSources($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTransferConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $transferConfigsElement = new TransferConfig(); + $transferConfigs = [ + $transferConfigsElement, + ]; + $expectedResponse = new ListTransferConfigsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTransferConfigs($transferConfigs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListTransferConfigsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listTransferConfigs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTransferConfigs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListTransferConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTransferConfigsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListTransferConfigsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listTransferConfigs($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTransferLogsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $transferMessagesElement = new TransferMessage(); + $transferMessages = [ + $transferMessagesElement, + ]; + $expectedResponse = new ListTransferLogsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTransferMessages($transferMessages); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->runName('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]'); + $request = (new ListTransferLogsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listTransferLogs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTransferMessages()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListTransferLogs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTransferLogsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->runName('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]'); + $request = (new ListTransferLogsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listTransferLogs($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTransferRunsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $transferRunsElement = new TransferRun(); + $transferRuns = [ + $transferRunsElement, + ]; + $expectedResponse = new ListTransferRunsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTransferRuns($transferRuns); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + $request = (new ListTransferRunsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listTransferRuns($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTransferRuns()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListTransferRuns', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTransferRunsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + $request = (new ListTransferRunsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listTransferRuns($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function scheduleTransferRunsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ScheduleTransferRunsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + $startTime = new Timestamp(); + $endTime = new Timestamp(); + $request = (new ScheduleTransferRunsRequest()) + ->setParent($formattedParent) + ->setStartTime($startTime) + ->setEndTime($endTime); + $response = $gapicClient->scheduleTransferRuns($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/ScheduleTransferRuns', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getStartTime(); + $this->assertProtobufEquals($startTime, $actualValue); + $actualValue = $actualRequestObject->getEndTime(); + $this->assertProtobufEquals($endTime, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function scheduleTransferRunsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->transferConfigName('[PROJECT]', '[TRANSFER_CONFIG]'); + $startTime = new Timestamp(); + $endTime = new Timestamp(); + $request = (new ScheduleTransferRunsRequest()) + ->setParent($formattedParent) + ->setStartTime($startTime) + ->setEndTime($endTime); + try { + $gapicClient->scheduleTransferRuns($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function startManualTransferRunsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new StartManualTransferRunsResponse(); + $transport->addResponse($expectedResponse); + $request = new StartManualTransferRunsRequest(); + $response = $gapicClient->startManualTransferRuns($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/StartManualTransferRuns', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function startManualTransferRunsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new StartManualTransferRunsRequest(); + try { + $gapicClient->startManualTransferRuns($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function unenrollDataSourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + $request = new UnenrollDataSourcesRequest(); + $gapicClient->unenrollDataSources($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/UnenrollDataSources', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function unenrollDataSourcesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new UnenrollDataSourcesRequest(); + try { + $gapicClient->unenrollDataSources($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTransferConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $destinationDatasetId = 'destinationDatasetId1541564179'; + $displayName = 'displayName1615086568'; + $dataSourceId = 'dataSourceId-1015796374'; + $schedule = 'schedule-697920873'; + $dataRefreshWindowDays = 327632845; + $disabled = true; + $userId = 147132913; + $datasetRegion = 'datasetRegion959248539'; + $notificationPubsubTopic = 'notificationPubsubTopic1794281191'; + $expectedResponse = new TransferConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDestinationDatasetId($destinationDatasetId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDataSourceId($dataSourceId); + $expectedResponse->setSchedule($schedule); + $expectedResponse->setDataRefreshWindowDays($dataRefreshWindowDays); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setUserId($userId); + $expectedResponse->setDatasetRegion($datasetRegion); + $expectedResponse->setNotificationPubsubTopic($notificationPubsubTopic); + $transport->addResponse($expectedResponse); + // Mock request + $transferConfig = new TransferConfig(); + $updateMask = new FieldMask(); + $request = (new UpdateTransferConfigRequest()) + ->setTransferConfig($transferConfig) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateTransferConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/UpdateTransferConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getTransferConfig(); + $this->assertProtobufEquals($transferConfig, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTransferConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $transferConfig = new TransferConfig(); + $updateMask = new FieldMask(); + $request = (new UpdateTransferConfigRequest()) + ->setTransferConfig($transferConfig) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateTransferConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function checkValidCredsAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $hasValidCreds = false; + $expectedResponse = new CheckValidCredsResponse(); + $expectedResponse->setHasValidCreds($hasValidCreds); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[DATA_SOURCE]'); + $request = (new CheckValidCredsRequest()) + ->setName($formattedName); + $response = $gapicClient->checkValidCredsAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.datatransfer.v1.DataTransferService/CheckValidCreds', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationEntities.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationEntities.php new file mode 100644 index 000000000000..28064ec72497 Binary files /dev/null and b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationEntities.php differ diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationErrorDetails.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationErrorDetails.php new file mode 100644 index 000000000000..b26a2b6d5950 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationErrorDetails.php @@ -0,0 +1,40 @@ +internalAddGeneratedFile( + ' +ß +@google/cloud/bigquery/migration/v2/migration_error_details.proto"google.cloud.bigquery.migration.v2google/rpc/error_details.proto"² +ResourceErrorDetail4 + resource_info ( 2.google.rpc.ResourceInfoBàAK + error_details ( 2/.google.cloud.bigquery.migration.v2.ErrorDetailBàA + error_count (BàA"‡ + ErrorDetailH +location ( 21.google.cloud.bigquery.migration.v2.ErrorLocationBàA. + +error_info ( 2.google.rpc.ErrorInfoBàA"7 + ErrorLocation +line (BàA +column (BàABÖ +&com.google.cloud.bigquery.migration.v2BMigrationErrorDetailsProtoPZDcloud.google.com/go/bigquery/migration/apiv2/migrationpb;migrationpbª"Google.Cloud.BigQuery.Migration.V2Ê"Google\\Cloud\\BigQuery\\Migration\\V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationMetrics.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationMetrics.php new file mode 100644 index 000000000000..217888903451 Binary files /dev/null and b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationMetrics.php differ diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationService.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationService.php new file mode 100644 index 000000000000..012edf02f09c --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/MigrationService.php @@ -0,0 +1,81 @@ +internalAddGeneratedFile( + ' +Ô +:google/cloud/bigquery/migration/v2/migration_service.proto"google.cloud.bigquery.migration.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto;google/cloud/bigquery/migration/v2/migration_entities.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"³ +CreateMigrationWorkflowRequest9 +parent ( B)àAúA# +!locations.googleapis.com/LocationV +migration_workflow ( 25.google.cloud.bigquery.migration.v2.MigrationWorkflowBàA"– +GetMigrationWorkflowRequestH +name ( B:àAúA4 +2bigquerymigration.googleapis.com/MigrationWorkflow- + read_mask ( 2.google.protobuf.FieldMask"° +ListMigrationWorkflowsRequest9 +parent ( B)àAúA# +!locations.googleapis.com/Location- + read_mask ( 2.google.protobuf.FieldMask + page_size ( + +page_token ( " +ListMigrationWorkflowsResponseR +migration_workflows ( 25.google.cloud.bigquery.migration.v2.MigrationWorkflow +next_page_token ( "j +DeleteMigrationWorkflowRequestH +name ( B:àAúA4 +2bigquerymigration.googleapis.com/MigrationWorkflow"i +StartMigrationWorkflowRequestH +name ( B:àAúA4 +2bigquerymigration.googleapis.com/MigrationWorkflow"™ +GetMigrationSubtaskRequestG +name ( B9àAúA3 +1bigquerymigration.googleapis.com/MigrationSubtask2 + read_mask ( 2.google.protobuf.FieldMaskBàA"ä +ListMigrationSubtasksRequestJ +parent ( B:àAúA4 +2bigquerymigration.googleapis.com/MigrationWorkflow2 + read_mask ( 2.google.protobuf.FieldMaskBàA + page_size (BàA + +page_token ( BàA +filter ( BàA"Š +ListMigrationSubtasksResponseP +migration_subtasks ( 24.google.cloud.bigquery.migration.v2.MigrationSubtask +next_page_token ( 2Ë +MigrationServiceû +CreateMigrationWorkflowB.google.cloud.bigquery.migration.v2.CreateMigrationWorkflowRequest5.google.cloud.bigquery.migration.v2.MigrationWorkflow"eÚAparent,migration_workflow‚Óä“C"-/v2/{parent=projects/*/locations/*}/workflows:migration_workflowÌ +GetMigrationWorkflow?.google.cloud.bigquery.migration.v2.GetMigrationWorkflowRequest5.google.cloud.bigquery.migration.v2.MigrationWorkflow"<ÚAname‚Óä“/-/v2/{name=projects/*/locations/*/workflows/*}ß +ListMigrationWorkflowsA.google.cloud.bigquery.migration.v2.ListMigrationWorkflowsRequestB.google.cloud.bigquery.migration.v2.ListMigrationWorkflowsResponse">ÚAparent‚Óä“/-/v2/{parent=projects/*/locations/*}/workflows³ +DeleteMigrationWorkflowB.google.cloud.bigquery.migration.v2.DeleteMigrationWorkflowRequest.google.protobuf.Empty"<ÚAname‚Óä“/*-/v2/{name=projects/*/locations/*/workflows/*}º +StartMigrationWorkflowA.google.cloud.bigquery.migration.v2.StartMigrationWorkflowRequest.google.protobuf.Empty"EÚAname‚Óä“8"3/v2/{name=projects/*/locations/*/workflows/*}:start:*Ô +GetMigrationSubtask>.google.cloud.bigquery.migration.v2.GetMigrationSubtaskRequest4.google.cloud.bigquery.migration.v2.MigrationSubtask"GÚAname‚Óä“:8/v2/{name=projects/*/locations/*/workflows/*/subtasks/*}ç +ListMigrationSubtasks@.google.cloud.bigquery.migration.v2.ListMigrationSubtasksRequestA.google.cloud.bigquery.migration.v2.ListMigrationSubtasksResponse"IÚAparent‚Óä“:8/v2/{parent=projects/*/locations/*/workflows/*}/subtasksTÊA bigquerymigration.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBÑ +&com.google.cloud.bigquery.migration.v2BMigrationServiceProtoPZDcloud.google.com/go/bigquery/migration/apiv2/migrationpb;migrationpbª"Google.Cloud.BigQuery.Migration.V2Ê"Google\\Cloud\\BigQuery\\Migration\\V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationConfig.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationConfig.php new file mode 100644 index 000000000000..7bf3333eef5a Binary files /dev/null and b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationConfig.php differ diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationDetails.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationDetails.php new file mode 100644 index 000000000000..a5cc48171d10 Binary files /dev/null and b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationDetails.php differ diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationSuggestion.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationSuggestion.php new file mode 100644 index 000000000000..8d2e5fe3fa88 Binary files /dev/null and b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationSuggestion.php differ diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationUsability.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationUsability.php new file mode 100644 index 000000000000..e741adf2e14f --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/GPBMetadata/Google/Cloud/Bigquery/Migration/V2/TranslationUsability.php @@ -0,0 +1,42 @@ +internalAddGeneratedFile( + ' +Ø +>google/cloud/bigquery/migration/v2/translation_usability.proto"google.cloud.bigquery.migration.v2google/api/resource.proto"ö +GcsReportLogMessage +severity (  +category (  + file_path (  +filename (  +source_script_line ( +source_script_column ( +message (  +script_context (  +action (  +effect + (  + object_name ( BÕ +&com.google.cloud.bigquery.migration.v2BTranslationUsabilityProtoPZDcloud.google.com/go/bigquery/migration/apiv2/migrationpb;migrationpbª"Google.Cloud.BigQuery.Migration.V2Ê"Google\\Cloud\\BigQuery\\Migration\\V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/AzureSynapseDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/AzureSynapseDialect.php new file mode 100644 index 000000000000..4cd1024c3f8c --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/AzureSynapseDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.AzureSynapseDialect + */ +class AzureSynapseDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/BigQueryDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/BigQueryDialect.php new file mode 100644 index 000000000000..633c28794cb2 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/BigQueryDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.BigQueryDialect + */ +class BigQueryDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/CreateMigrationWorkflowRequest.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/CreateMigrationWorkflowRequest.php new file mode 100644 index 000000000000..cf86b9f22bb6 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/CreateMigrationWorkflowRequest.php @@ -0,0 +1,132 @@ +google.cloud.bigquery.migration.v2.CreateMigrationWorkflowRequest + */ +class CreateMigrationWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project to which this migration workflow belongs. + * Example: `projects/foo/locations/bar` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The migration workflow to create. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationWorkflow migration_workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $migration_workflow = null; + + /** + * @param string $parent Required. The name of the project to which this migration workflow belongs. + * Example: `projects/foo/locations/bar` + * Please see {@see MigrationServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow $migrationWorkflow Required. The migration workflow to create. + * + * @return \Google\Cloud\BigQuery\Migration\V2\CreateMigrationWorkflowRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow $migrationWorkflow): self + { + return (new self()) + ->setParent($parent) + ->setMigrationWorkflow($migrationWorkflow); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project to which this migration workflow belongs. + * Example: `projects/foo/locations/bar` + * @type \Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow $migration_workflow + * Required. The migration workflow to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project to which this migration workflow belongs. + * Example: `projects/foo/locations/bar` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the project to which this migration workflow belongs. + * Example: `projects/foo/locations/bar` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The migration workflow to create. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationWorkflow migration_workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow|null + */ + public function getMigrationWorkflow() + { + return $this->migration_workflow; + } + + public function hasMigrationWorkflow() + { + return isset($this->migration_workflow); + } + + public function clearMigrationWorkflow() + { + unset($this->migration_workflow); + } + + /** + * Required. The migration workflow to create. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationWorkflow migration_workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow $var + * @return $this + */ + public function setMigrationWorkflow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow::class); + $this->migration_workflow = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/DB2Dialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/DB2Dialect.php new file mode 100644 index 000000000000..1b6645ef9a1a --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/DB2Dialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.DB2Dialect + */ +class DB2Dialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/DeleteMigrationWorkflowRequest.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/DeleteMigrationWorkflowRequest.php new file mode 100644 index 000000000000..8d1a839efb89 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/DeleteMigrationWorkflowRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.migration.v2.DeleteMigrationWorkflowRequest + */ +class DeleteMigrationWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * Please see {@see MigrationServiceClient::migrationWorkflowName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Migration\V2\DeleteMigrationWorkflowRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/Dialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/Dialect.php new file mode 100644 index 000000000000..85655db62741 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/Dialect.php @@ -0,0 +1,603 @@ +google.cloud.bigquery.migration.v2.Dialect + */ +class Dialect extends \Google\Protobuf\Internal\Message +{ + protected $dialect_value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Migration\V2\BigQueryDialect $bigquery_dialect + * The BigQuery dialect + * @type \Google\Cloud\BigQuery\Migration\V2\HiveQLDialect $hiveql_dialect + * The HiveQL dialect + * @type \Google\Cloud\BigQuery\Migration\V2\RedshiftDialect $redshift_dialect + * The Redshift dialect + * @type \Google\Cloud\BigQuery\Migration\V2\TeradataDialect $teradata_dialect + * The Teradata dialect + * @type \Google\Cloud\BigQuery\Migration\V2\OracleDialect $oracle_dialect + * The Oracle dialect + * @type \Google\Cloud\BigQuery\Migration\V2\SparkSQLDialect $sparksql_dialect + * The SparkSQL dialect + * @type \Google\Cloud\BigQuery\Migration\V2\SnowflakeDialect $snowflake_dialect + * The Snowflake dialect + * @type \Google\Cloud\BigQuery\Migration\V2\NetezzaDialect $netezza_dialect + * The Netezza dialect + * @type \Google\Cloud\BigQuery\Migration\V2\AzureSynapseDialect $azure_synapse_dialect + * The Azure Synapse dialect + * @type \Google\Cloud\BigQuery\Migration\V2\VerticaDialect $vertica_dialect + * The Vertica dialect + * @type \Google\Cloud\BigQuery\Migration\V2\SQLServerDialect $sql_server_dialect + * The SQL Server dialect + * @type \Google\Cloud\BigQuery\Migration\V2\PostgresqlDialect $postgresql_dialect + * The Postgresql dialect + * @type \Google\Cloud\BigQuery\Migration\V2\PrestoDialect $presto_dialect + * The Presto dialect + * @type \Google\Cloud\BigQuery\Migration\V2\MySQLDialect $mysql_dialect + * The MySQL dialect + * @type \Google\Cloud\BigQuery\Migration\V2\DB2Dialect $db2_dialect + * DB2 dialect + * @type \Google\Cloud\BigQuery\Migration\V2\SQLiteDialect $sqlite_dialect + * SQLite dialect + * @type \Google\Cloud\BigQuery\Migration\V2\GreenplumDialect $greenplum_dialect + * Greenplum dialect + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + + /** + * The BigQuery dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.BigQueryDialect bigquery_dialect = 1; + * @return \Google\Cloud\BigQuery\Migration\V2\BigQueryDialect|null + */ + public function getBigqueryDialect() + { + return $this->readOneof(1); + } + + public function hasBigqueryDialect() + { + return $this->hasOneof(1); + } + + /** + * The BigQuery dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.BigQueryDialect bigquery_dialect = 1; + * @param \Google\Cloud\BigQuery\Migration\V2\BigQueryDialect $var + * @return $this + */ + public function setBigqueryDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\BigQueryDialect::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The HiveQL dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.HiveQLDialect hiveql_dialect = 2; + * @return \Google\Cloud\BigQuery\Migration\V2\HiveQLDialect|null + */ + public function getHiveqlDialect() + { + return $this->readOneof(2); + } + + public function hasHiveqlDialect() + { + return $this->hasOneof(2); + } + + /** + * The HiveQL dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.HiveQLDialect hiveql_dialect = 2; + * @param \Google\Cloud\BigQuery\Migration\V2\HiveQLDialect $var + * @return $this + */ + public function setHiveqlDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\HiveQLDialect::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The Redshift dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.RedshiftDialect redshift_dialect = 3; + * @return \Google\Cloud\BigQuery\Migration\V2\RedshiftDialect|null + */ + public function getRedshiftDialect() + { + return $this->readOneof(3); + } + + public function hasRedshiftDialect() + { + return $this->hasOneof(3); + } + + /** + * The Redshift dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.RedshiftDialect redshift_dialect = 3; + * @param \Google\Cloud\BigQuery\Migration\V2\RedshiftDialect $var + * @return $this + */ + public function setRedshiftDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\RedshiftDialect::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The Teradata dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TeradataDialect teradata_dialect = 4; + * @return \Google\Cloud\BigQuery\Migration\V2\TeradataDialect|null + */ + public function getTeradataDialect() + { + return $this->readOneof(4); + } + + public function hasTeradataDialect() + { + return $this->hasOneof(4); + } + + /** + * The Teradata dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TeradataDialect teradata_dialect = 4; + * @param \Google\Cloud\BigQuery\Migration\V2\TeradataDialect $var + * @return $this + */ + public function setTeradataDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\TeradataDialect::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * The Oracle dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.OracleDialect oracle_dialect = 5; + * @return \Google\Cloud\BigQuery\Migration\V2\OracleDialect|null + */ + public function getOracleDialect() + { + return $this->readOneof(5); + } + + public function hasOracleDialect() + { + return $this->hasOneof(5); + } + + /** + * The Oracle dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.OracleDialect oracle_dialect = 5; + * @param \Google\Cloud\BigQuery\Migration\V2\OracleDialect $var + * @return $this + */ + public function setOracleDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\OracleDialect::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The SparkSQL dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SparkSQLDialect sparksql_dialect = 6; + * @return \Google\Cloud\BigQuery\Migration\V2\SparkSQLDialect|null + */ + public function getSparksqlDialect() + { + return $this->readOneof(6); + } + + public function hasSparksqlDialect() + { + return $this->hasOneof(6); + } + + /** + * The SparkSQL dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SparkSQLDialect sparksql_dialect = 6; + * @param \Google\Cloud\BigQuery\Migration\V2\SparkSQLDialect $var + * @return $this + */ + public function setSparksqlDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\SparkSQLDialect::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The Snowflake dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SnowflakeDialect snowflake_dialect = 7; + * @return \Google\Cloud\BigQuery\Migration\V2\SnowflakeDialect|null + */ + public function getSnowflakeDialect() + { + return $this->readOneof(7); + } + + public function hasSnowflakeDialect() + { + return $this->hasOneof(7); + } + + /** + * The Snowflake dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SnowflakeDialect snowflake_dialect = 7; + * @param \Google\Cloud\BigQuery\Migration\V2\SnowflakeDialect $var + * @return $this + */ + public function setSnowflakeDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\SnowflakeDialect::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * The Netezza dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.NetezzaDialect netezza_dialect = 8; + * @return \Google\Cloud\BigQuery\Migration\V2\NetezzaDialect|null + */ + public function getNetezzaDialect() + { + return $this->readOneof(8); + } + + public function hasNetezzaDialect() + { + return $this->hasOneof(8); + } + + /** + * The Netezza dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.NetezzaDialect netezza_dialect = 8; + * @param \Google\Cloud\BigQuery\Migration\V2\NetezzaDialect $var + * @return $this + */ + public function setNetezzaDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\NetezzaDialect::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * The Azure Synapse dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.AzureSynapseDialect azure_synapse_dialect = 9; + * @return \Google\Cloud\BigQuery\Migration\V2\AzureSynapseDialect|null + */ + public function getAzureSynapseDialect() + { + return $this->readOneof(9); + } + + public function hasAzureSynapseDialect() + { + return $this->hasOneof(9); + } + + /** + * The Azure Synapse dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.AzureSynapseDialect azure_synapse_dialect = 9; + * @param \Google\Cloud\BigQuery\Migration\V2\AzureSynapseDialect $var + * @return $this + */ + public function setAzureSynapseDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\AzureSynapseDialect::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * The Vertica dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.VerticaDialect vertica_dialect = 10; + * @return \Google\Cloud\BigQuery\Migration\V2\VerticaDialect|null + */ + public function getVerticaDialect() + { + return $this->readOneof(10); + } + + public function hasVerticaDialect() + { + return $this->hasOneof(10); + } + + /** + * The Vertica dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.VerticaDialect vertica_dialect = 10; + * @param \Google\Cloud\BigQuery\Migration\V2\VerticaDialect $var + * @return $this + */ + public function setVerticaDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\VerticaDialect::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * The SQL Server dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SQLServerDialect sql_server_dialect = 11; + * @return \Google\Cloud\BigQuery\Migration\V2\SQLServerDialect|null + */ + public function getSqlServerDialect() + { + return $this->readOneof(11); + } + + public function hasSqlServerDialect() + { + return $this->hasOneof(11); + } + + /** + * The SQL Server dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SQLServerDialect sql_server_dialect = 11; + * @param \Google\Cloud\BigQuery\Migration\V2\SQLServerDialect $var + * @return $this + */ + public function setSqlServerDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\SQLServerDialect::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * The Postgresql dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.PostgresqlDialect postgresql_dialect = 12; + * @return \Google\Cloud\BigQuery\Migration\V2\PostgresqlDialect|null + */ + public function getPostgresqlDialect() + { + return $this->readOneof(12); + } + + public function hasPostgresqlDialect() + { + return $this->hasOneof(12); + } + + /** + * The Postgresql dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.PostgresqlDialect postgresql_dialect = 12; + * @param \Google\Cloud\BigQuery\Migration\V2\PostgresqlDialect $var + * @return $this + */ + public function setPostgresqlDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\PostgresqlDialect::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * The Presto dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.PrestoDialect presto_dialect = 13; + * @return \Google\Cloud\BigQuery\Migration\V2\PrestoDialect|null + */ + public function getPrestoDialect() + { + return $this->readOneof(13); + } + + public function hasPrestoDialect() + { + return $this->hasOneof(13); + } + + /** + * The Presto dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.PrestoDialect presto_dialect = 13; + * @param \Google\Cloud\BigQuery\Migration\V2\PrestoDialect $var + * @return $this + */ + public function setPrestoDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\PrestoDialect::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * The MySQL dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14; + * @return \Google\Cloud\BigQuery\Migration\V2\MySQLDialect|null + */ + public function getMysqlDialect() + { + return $this->readOneof(14); + } + + public function hasMysqlDialect() + { + return $this->hasOneof(14); + } + + /** + * The MySQL dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14; + * @param \Google\Cloud\BigQuery\Migration\V2\MySQLDialect $var + * @return $this + */ + public function setMysqlDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\MySQLDialect::class); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * DB2 dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.DB2Dialect db2_dialect = 15; + * @return \Google\Cloud\BigQuery\Migration\V2\DB2Dialect|null + */ + public function getDb2Dialect() + { + return $this->readOneof(15); + } + + public function hasDb2Dialect() + { + return $this->hasOneof(15); + } + + /** + * DB2 dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.DB2Dialect db2_dialect = 15; + * @param \Google\Cloud\BigQuery\Migration\V2\DB2Dialect $var + * @return $this + */ + public function setDb2Dialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\DB2Dialect::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * SQLite dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SQLiteDialect sqlite_dialect = 16; + * @return \Google\Cloud\BigQuery\Migration\V2\SQLiteDialect|null + */ + public function getSqliteDialect() + { + return $this->readOneof(16); + } + + public function hasSqliteDialect() + { + return $this->hasOneof(16); + } + + /** + * SQLite dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SQLiteDialect sqlite_dialect = 16; + * @param \Google\Cloud\BigQuery\Migration\V2\SQLiteDialect $var + * @return $this + */ + public function setSqliteDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\SQLiteDialect::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Greenplum dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.GreenplumDialect greenplum_dialect = 17; + * @return \Google\Cloud\BigQuery\Migration\V2\GreenplumDialect|null + */ + public function getGreenplumDialect() + { + return $this->readOneof(17); + } + + public function hasGreenplumDialect() + { + return $this->hasOneof(17); + } + + /** + * Greenplum dialect + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.GreenplumDialect greenplum_dialect = 17; + * @param \Google\Cloud\BigQuery\Migration\V2\GreenplumDialect $var + * @return $this + */ + public function setGreenplumDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\GreenplumDialect::class); + $this->writeOneof(17, $var); + + return $this; + } + + /** + * @return string + */ + public function getDialectValue() + { + return $this->whichOneof("dialect_value"); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ErrorDetail.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ErrorDetail.php new file mode 100644 index 000000000000..b12388d8d92f --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ErrorDetail.php @@ -0,0 +1,122 @@ +google.cloud.bigquery.migration.v2.ErrorDetail + */ +class ErrorDetail extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The exact location within the resource (if applicable). + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.ErrorLocation location = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $location = null; + /** + * Required. Describes the cause of the error with structured detail. + * + * Generated from protobuf field .google.rpc.ErrorInfo error_info = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $error_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Migration\V2\ErrorLocation $location + * Optional. The exact location within the resource (if applicable). + * @type \Google\Rpc\ErrorInfo $error_info + * Required. Describes the cause of the error with structured detail. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The exact location within the resource (if applicable). + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.ErrorLocation location = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\Migration\V2\ErrorLocation|null + */ + public function getLocation() + { + return $this->location; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * Optional. The exact location within the resource (if applicable). + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.ErrorLocation location = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\Migration\V2\ErrorLocation $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\ErrorLocation::class); + $this->location = $var; + + return $this; + } + + /** + * Required. Describes the cause of the error with structured detail. + * + * Generated from protobuf field .google.rpc.ErrorInfo error_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Rpc\ErrorInfo|null + */ + public function getErrorInfo() + { + return $this->error_info; + } + + public function hasErrorInfo() + { + return isset($this->error_info); + } + + public function clearErrorInfo() + { + unset($this->error_info); + } + + /** + * Required. Describes the cause of the error with structured detail. + * + * Generated from protobuf field .google.rpc.ErrorInfo error_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Rpc\ErrorInfo $var + * @return $this + */ + public function setErrorInfo($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\ErrorInfo::class); + $this->error_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ErrorLocation.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ErrorLocation.php new file mode 100644 index 000000000000..b2d7144c0b51 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ErrorLocation.php @@ -0,0 +1,109 @@ +google.cloud.bigquery.migration.v2.ErrorLocation + */ +class ErrorLocation extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If applicable, denotes the line where the error occurred. A zero + * value means that there is no line information. + * + * Generated from protobuf field int32 line = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $line = 0; + /** + * Optional. If applicable, denotes the column where the error occurred. A + * zero value means that there is no columns information. + * + * Generated from protobuf field int32 column = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $column = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $line + * Optional. If applicable, denotes the line where the error occurred. A zero + * value means that there is no line information. + * @type int $column + * Optional. If applicable, denotes the column where the error occurred. A + * zero value means that there is no columns information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If applicable, denotes the line where the error occurred. A zero + * value means that there is no line information. + * + * Generated from protobuf field int32 line = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getLine() + { + return $this->line; + } + + /** + * Optional. If applicable, denotes the line where the error occurred. A zero + * value means that there is no line information. + * + * Generated from protobuf field int32 line = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setLine($var) + { + GPBUtil::checkInt32($var); + $this->line = $var; + + return $this; + } + + /** + * Optional. If applicable, denotes the column where the error occurred. A + * zero value means that there is no columns information. + * + * Generated from protobuf field int32 column = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getColumn() + { + return $this->column; + } + + /** + * Optional. If applicable, denotes the column where the error occurred. A + * zero value means that there is no columns information. + * + * Generated from protobuf field int32 column = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setColumn($var) + { + GPBUtil::checkInt32($var); + $this->column = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GcsReportLogMessage.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GcsReportLogMessage.php new file mode 100644 index 000000000000..94d6aa4ab8bc --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GcsReportLogMessage.php @@ -0,0 +1,415 @@ +google.cloud.bigquery.migration.v2.GcsReportLogMessage + */ +class GcsReportLogMessage extends \Google\Protobuf\Internal\Message +{ + /** + * Severity of the translation record. + * + * Generated from protobuf field string severity = 1; + */ + protected $severity = ''; + /** + * Category of the error/warning. Example: SyntaxError + * + * Generated from protobuf field string category = 2; + */ + protected $category = ''; + /** + * The file path in which the error occurred + * + * Generated from protobuf field string file_path = 3; + */ + protected $file_path = ''; + /** + * The file name in which the error occurred + * + * Generated from protobuf field string filename = 4; + */ + protected $filename = ''; + /** + * Specifies the row from the source text where the error occurred (0 based, + * -1 for messages without line location). Example: 2 + * + * Generated from protobuf field int32 source_script_line = 5; + */ + protected $source_script_line = 0; + /** + * Specifies the column from the source texts where the error occurred. (0 + * based, -1 for messages without column location) example: 6 + * + * Generated from protobuf field int32 source_script_column = 6; + */ + protected $source_script_column = 0; + /** + * Detailed message of the record. + * + * Generated from protobuf field string message = 7; + */ + protected $message = ''; + /** + * The script context (obfuscated) in which the error occurred + * + * Generated from protobuf field string script_context = 8; + */ + protected $script_context = ''; + /** + * Category of the error/warning. Example: SyntaxError + * + * Generated from protobuf field string action = 9; + */ + protected $action = ''; + /** + * Effect of the error/warning. Example: COMPATIBILITY + * + * Generated from protobuf field string effect = 10; + */ + protected $effect = ''; + /** + * Name of the affected object in the log message. + * + * Generated from protobuf field string object_name = 11; + */ + protected $object_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $severity + * Severity of the translation record. + * @type string $category + * Category of the error/warning. Example: SyntaxError + * @type string $file_path + * The file path in which the error occurred + * @type string $filename + * The file name in which the error occurred + * @type int $source_script_line + * Specifies the row from the source text where the error occurred (0 based, + * -1 for messages without line location). Example: 2 + * @type int $source_script_column + * Specifies the column from the source texts where the error occurred. (0 + * based, -1 for messages without column location) example: 6 + * @type string $message + * Detailed message of the record. + * @type string $script_context + * The script context (obfuscated) in which the error occurred + * @type string $action + * Category of the error/warning. Example: SyntaxError + * @type string $effect + * Effect of the error/warning. Example: COMPATIBILITY + * @type string $object_name + * Name of the affected object in the log message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationUsability::initOnce(); + parent::__construct($data); + } + + /** + * Severity of the translation record. + * + * Generated from protobuf field string severity = 1; + * @return string + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * Severity of the translation record. + * + * Generated from protobuf field string severity = 1; + * @param string $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkString($var, True); + $this->severity = $var; + + return $this; + } + + /** + * Category of the error/warning. Example: SyntaxError + * + * Generated from protobuf field string category = 2; + * @return string + */ + public function getCategory() + { + return $this->category; + } + + /** + * Category of the error/warning. Example: SyntaxError + * + * Generated from protobuf field string category = 2; + * @param string $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkString($var, True); + $this->category = $var; + + return $this; + } + + /** + * The file path in which the error occurred + * + * Generated from protobuf field string file_path = 3; + * @return string + */ + public function getFilePath() + { + return $this->file_path; + } + + /** + * The file path in which the error occurred + * + * Generated from protobuf field string file_path = 3; + * @param string $var + * @return $this + */ + public function setFilePath($var) + { + GPBUtil::checkString($var, True); + $this->file_path = $var; + + return $this; + } + + /** + * The file name in which the error occurred + * + * Generated from protobuf field string filename = 4; + * @return string + */ + public function getFilename() + { + return $this->filename; + } + + /** + * The file name in which the error occurred + * + * Generated from protobuf field string filename = 4; + * @param string $var + * @return $this + */ + public function setFilename($var) + { + GPBUtil::checkString($var, True); + $this->filename = $var; + + return $this; + } + + /** + * Specifies the row from the source text where the error occurred (0 based, + * -1 for messages without line location). Example: 2 + * + * Generated from protobuf field int32 source_script_line = 5; + * @return int + */ + public function getSourceScriptLine() + { + return $this->source_script_line; + } + + /** + * Specifies the row from the source text where the error occurred (0 based, + * -1 for messages without line location). Example: 2 + * + * Generated from protobuf field int32 source_script_line = 5; + * @param int $var + * @return $this + */ + public function setSourceScriptLine($var) + { + GPBUtil::checkInt32($var); + $this->source_script_line = $var; + + return $this; + } + + /** + * Specifies the column from the source texts where the error occurred. (0 + * based, -1 for messages without column location) example: 6 + * + * Generated from protobuf field int32 source_script_column = 6; + * @return int + */ + public function getSourceScriptColumn() + { + return $this->source_script_column; + } + + /** + * Specifies the column from the source texts where the error occurred. (0 + * based, -1 for messages without column location) example: 6 + * + * Generated from protobuf field int32 source_script_column = 6; + * @param int $var + * @return $this + */ + public function setSourceScriptColumn($var) + { + GPBUtil::checkInt32($var); + $this->source_script_column = $var; + + return $this; + } + + /** + * Detailed message of the record. + * + * Generated from protobuf field string message = 7; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Detailed message of the record. + * + * Generated from protobuf field string message = 7; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * The script context (obfuscated) in which the error occurred + * + * Generated from protobuf field string script_context = 8; + * @return string + */ + public function getScriptContext() + { + return $this->script_context; + } + + /** + * The script context (obfuscated) in which the error occurred + * + * Generated from protobuf field string script_context = 8; + * @param string $var + * @return $this + */ + public function setScriptContext($var) + { + GPBUtil::checkString($var, True); + $this->script_context = $var; + + return $this; + } + + /** + * Category of the error/warning. Example: SyntaxError + * + * Generated from protobuf field string action = 9; + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * Category of the error/warning. Example: SyntaxError + * + * Generated from protobuf field string action = 9; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * Effect of the error/warning. Example: COMPATIBILITY + * + * Generated from protobuf field string effect = 10; + * @return string + */ + public function getEffect() + { + return $this->effect; + } + + /** + * Effect of the error/warning. Example: COMPATIBILITY + * + * Generated from protobuf field string effect = 10; + * @param string $var + * @return $this + */ + public function setEffect($var) + { + GPBUtil::checkString($var, True); + $this->effect = $var; + + return $this; + } + + /** + * Name of the affected object in the log message. + * + * Generated from protobuf field string object_name = 11; + * @return string + */ + public function getObjectName() + { + return $this->object_name; + } + + /** + * Name of the affected object in the log message. + * + * Generated from protobuf field string object_name = 11; + * @param string $var + * @return $this + */ + public function setObjectName($var) + { + GPBUtil::checkString($var, True); + $this->object_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GetMigrationSubtaskRequest.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GetMigrationSubtaskRequest.php new file mode 100644 index 000000000000..ac8f15bd9e87 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GetMigrationSubtaskRequest.php @@ -0,0 +1,130 @@ +google.cloud.bigquery.migration.v2.GetMigrationSubtaskRequest + */ +class GetMigrationSubtaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier for the migration subtask. + * Example: `projects/123/locations/us/workflows/1234/subtasks/543` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $read_mask = null; + + /** + * @param string $name Required. The unique identifier for the migration subtask. + * Example: `projects/123/locations/us/workflows/1234/subtasks/543` + * Please see {@see MigrationServiceClient::migrationSubtaskName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Migration\V2\GetMigrationSubtaskRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier for the migration subtask. + * Example: `projects/123/locations/us/workflows/1234/subtasks/543` + * @type \Google\Protobuf\FieldMask $read_mask + * Optional. The list of fields to be retrieved. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier for the migration subtask. + * Example: `projects/123/locations/us/workflows/1234/subtasks/543` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier for the migration subtask. + * Example: `projects/123/locations/us/workflows/1234/subtasks/543` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getReadMask() + { + return $this->read_mask; + } + + public function hasReadMask() + { + return isset($this->read_mask); + } + + public function clearReadMask() + { + unset($this->read_mask); + } + + /** + * Optional. The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setReadMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->read_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GetMigrationWorkflowRequest.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GetMigrationWorkflowRequest.php new file mode 100644 index 000000000000..cf20c5101842 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GetMigrationWorkflowRequest.php @@ -0,0 +1,130 @@ +google.cloud.bigquery.migration.v2.GetMigrationWorkflowRequest + */ +class GetMigrationWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2; + */ + protected $read_mask = null; + + /** + * @param string $name Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * Please see {@see MigrationServiceClient::migrationWorkflowName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Migration\V2\GetMigrationWorkflowRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * @type \Google\Protobuf\FieldMask $read_mask + * The list of fields to be retrieved. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getReadMask() + { + return $this->read_mask; + } + + public function hasReadMask() + { + return isset($this->read_mask); + } + + public function clearReadMask() + { + unset($this->read_mask); + } + + /** + * The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setReadMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->read_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GreenplumDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GreenplumDialect.php new file mode 100644 index 000000000000..f07458775fb2 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/GreenplumDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.GreenplumDialect + */ +class GreenplumDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/HiveQLDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/HiveQLDialect.php new file mode 100644 index 000000000000..4eba620616c9 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/HiveQLDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.HiveQLDialect + */ +class HiveQLDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationSubtasksRequest.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationSubtasksRequest.php new file mode 100644 index 000000000000..5cdf51450e54 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationSubtasksRequest.php @@ -0,0 +1,256 @@ +google.cloud.bigquery.migration.v2.ListMigrationSubtasksRequest + */ +class ListMigrationSubtasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The migration task of the subtasks to list. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $read_mask = null; + /** + * Optional. The maximum number of migration tasks to return. The service may + * return fewer than this number. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from previous `ListMigrationSubtasks` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMigrationSubtasks` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The filter to apply. This can be used to get the subtasks of a + * specific tasks in a workflow, e.g. `migration_task = "ab012"` where + * `"ab012"` is the task ID (not the name in the named map). + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The migration task of the subtasks to list. + * Example: `projects/123/locations/us/workflows/1234` + * Please see {@see MigrationServiceClient::migrationWorkflowName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Migration\V2\ListMigrationSubtasksRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The migration task of the subtasks to list. + * Example: `projects/123/locations/us/workflows/1234` + * @type \Google\Protobuf\FieldMask $read_mask + * Optional. The list of fields to be retrieved. + * @type int $page_size + * Optional. The maximum number of migration tasks to return. The service may + * return fewer than this number. + * @type string $page_token + * Optional. A page token, received from previous `ListMigrationSubtasks` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMigrationSubtasks` + * must match the call that provided the page token. + * @type string $filter + * Optional. The filter to apply. This can be used to get the subtasks of a + * specific tasks in a workflow, e.g. `migration_task = "ab012"` where + * `"ab012"` is the task ID (not the name in the named map). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The migration task of the subtasks to list. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The migration task of the subtasks to list. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getReadMask() + { + return $this->read_mask; + } + + public function hasReadMask() + { + return isset($this->read_mask); + } + + public function clearReadMask() + { + unset($this->read_mask); + } + + /** + * Optional. The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setReadMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->read_mask = $var; + + return $this; + } + + /** + * Optional. The maximum number of migration tasks to return. The service may + * return fewer than this number. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of migration tasks to return. The service may + * return fewer than this number. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from previous `ListMigrationSubtasks` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMigrationSubtasks` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from previous `ListMigrationSubtasks` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMigrationSubtasks` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The filter to apply. This can be used to get the subtasks of a + * specific tasks in a workflow, e.g. `migration_task = "ab012"` where + * `"ab012"` is the task ID (not the name in the named map). + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter to apply. This can be used to get the subtasks of a + * specific tasks in a workflow, e.g. `migration_task = "ab012"` where + * `"ab012"` is the task ID (not the name in the named map). + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationSubtasksResponse.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationSubtasksResponse.php new file mode 100644 index 000000000000..5ef10e1eda97 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationSubtasksResponse.php @@ -0,0 +1,105 @@ +google.cloud.bigquery.migration.v2.ListMigrationSubtasksResponse + */ +class ListMigrationSubtasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The migration subtasks for the specified task. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.MigrationSubtask migration_subtasks = 1; + */ + private $migration_subtasks; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\Migration\V2\MigrationSubtask>|\Google\Protobuf\Internal\RepeatedField $migration_subtasks + * The migration subtasks for the specified task. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationService::initOnce(); + parent::__construct($data); + } + + /** + * The migration subtasks for the specified task. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.MigrationSubtask migration_subtasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMigrationSubtasks() + { + return $this->migration_subtasks; + } + + /** + * The migration subtasks for the specified task. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.MigrationSubtask migration_subtasks = 1; + * @param array<\Google\Cloud\BigQuery\Migration\V2\MigrationSubtask>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMigrationSubtasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\MigrationSubtask::class); + $this->migration_subtasks = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationWorkflowsRequest.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationWorkflowsRequest.php new file mode 100644 index 000000000000..e3637ad33ae3 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationWorkflowsRequest.php @@ -0,0 +1,214 @@ +google.cloud.bigquery.migration.v2.ListMigrationWorkflowsRequest + */ +class ListMigrationWorkflowsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location of the migration workflows to list. + * Example: `projects/123/locations/us` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2; + */ + protected $read_mask = null; + /** + * The maximum number of migration workflows to return. The service may return + * fewer than this number. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A page token, received from previous `ListMigrationWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMigrationWorkflows` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project and location of the migration workflows to list. + * Example: `projects/123/locations/us` + * Please see {@see MigrationServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Migration\V2\ListMigrationWorkflowsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location of the migration workflows to list. + * Example: `projects/123/locations/us` + * @type \Google\Protobuf\FieldMask $read_mask + * The list of fields to be retrieved. + * @type int $page_size + * The maximum number of migration workflows to return. The service may return + * fewer than this number. + * @type string $page_token + * A page token, received from previous `ListMigrationWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMigrationWorkflows` + * must match the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location of the migration workflows to list. + * Example: `projects/123/locations/us` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location of the migration workflows to list. + * Example: `projects/123/locations/us` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getReadMask() + { + return $this->read_mask; + } + + public function hasReadMask() + { + return isset($this->read_mask); + } + + public function clearReadMask() + { + unset($this->read_mask); + } + + /** + * The list of fields to be retrieved. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setReadMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->read_mask = $var; + + return $this; + } + + /** + * The maximum number of migration workflows to return. The service may return + * fewer than this number. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of migration workflows to return. The service may return + * fewer than this number. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token, received from previous `ListMigrationWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMigrationWorkflows` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from previous `ListMigrationWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMigrationWorkflows` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationWorkflowsResponse.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationWorkflowsResponse.php new file mode 100644 index 000000000000..41d31c2cfebd --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ListMigrationWorkflowsResponse.php @@ -0,0 +1,105 @@ +google.cloud.bigquery.migration.v2.ListMigrationWorkflowsResponse + */ +class ListMigrationWorkflowsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The migration workflows for the specified project / location. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.MigrationWorkflow migration_workflows = 1; + */ + private $migration_workflows; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow>|\Google\Protobuf\Internal\RepeatedField $migration_workflows + * The migration workflows for the specified project / location. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationService::initOnce(); + parent::__construct($data); + } + + /** + * The migration workflows for the specified project / location. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.MigrationWorkflow migration_workflows = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMigrationWorkflows() + { + return $this->migration_workflows; + } + + /** + * The migration workflows for the specified project / location. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.MigrationWorkflow migration_workflows = 1; + * @param array<\Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMigrationWorkflows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow::class); + $this->migration_workflows = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/Literal.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/Literal.php new file mode 100644 index 000000000000..bf0dc573e7ed --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/Literal.php @@ -0,0 +1,142 @@ +google.cloud.bigquery.migration.v2.Literal + */ +class Literal extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The identifier of the literal entry. + * + * Generated from protobuf field string relative_path = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $relative_path = ''; + protected $literal_data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $literal_string + * Literal string data. + * @type string $literal_bytes + * Literal byte data. + * @type string $relative_path + * Required. The identifier of the literal entry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationDetails::initOnce(); + parent::__construct($data); + } + + /** + * Literal string data. + * + * Generated from protobuf field string literal_string = 2; + * @return string + */ + public function getLiteralString() + { + return $this->readOneof(2); + } + + public function hasLiteralString() + { + return $this->hasOneof(2); + } + + /** + * Literal string data. + * + * Generated from protobuf field string literal_string = 2; + * @param string $var + * @return $this + */ + public function setLiteralString($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Literal byte data. + * + * Generated from protobuf field bytes literal_bytes = 3; + * @return string + */ + public function getLiteralBytes() + { + return $this->readOneof(3); + } + + public function hasLiteralBytes() + { + return $this->hasOneof(3); + } + + /** + * Literal byte data. + * + * Generated from protobuf field bytes literal_bytes = 3; + * @param string $var + * @return $this + */ + public function setLiteralBytes($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. The identifier of the literal entry. + * + * Generated from protobuf field string relative_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRelativePath() + { + return $this->relative_path; + } + + /** + * Required. The identifier of the literal entry. + * + * Generated from protobuf field string relative_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRelativePath($var) + { + GPBUtil::checkString($var, True); + $this->relative_path = $var; + + return $this; + } + + /** + * @return string + */ + public function getLiteralData() + { + return $this->whichOneof("literal_data"); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationSubtask.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationSubtask.php new file mode 100644 index 000000000000..89a6b5afbe96 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationSubtask.php @@ -0,0 +1,449 @@ +google.cloud.bigquery.migration.v2.MigrationSubtask + */ +class MigrationSubtask extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Immutable. The resource name for the migration subtask. The ID + * is server-generated. + * Example: `projects/123/locations/us/workflows/345/subtasks/678` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * The unique ID of the task to which this subtask belongs. + * + * Generated from protobuf field string task_id = 2; + */ + protected $task_id = ''; + /** + * The type of the Subtask. The migration service does not check whether this + * is a known type. It is up to the task creator (i.e. orchestrator or worker) + * to ensure it only creates subtasks for which there are compatible workers + * polling for Subtasks. + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + /** + * Output only. The current state of the subtask. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationSubtask.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. An explanation that may be populated when the task is in + * FAILED state. + * + * Generated from protobuf field .google.rpc.ErrorInfo processing_error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $processing_error = null; + /** + * Output only. Provides details to errors and issues encountered while + * processing the subtask. Presence of error details does not mean that the + * subtask failed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ResourceErrorDetail resource_error_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $resource_error_details; + /** + * The number or resources with errors. Note: This is not the total + * number of errors as each resource can have more than one error. + * This is used to indicate truncation by having a `resource_error_count` + * that is higher than the size of `resource_error_details`. + * + * Generated from protobuf field int32 resource_error_count = 13; + */ + protected $resource_error_count = 0; + /** + * Time when the subtask was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + */ + protected $create_time = null; + /** + * Time when the subtask was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 8; + */ + protected $last_update_time = null; + /** + * The metrics for the subtask. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.TimeSeries metrics = 11; + */ + private $metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Immutable. The resource name for the migration subtask. The ID + * is server-generated. + * Example: `projects/123/locations/us/workflows/345/subtasks/678` + * @type string $task_id + * The unique ID of the task to which this subtask belongs. + * @type string $type + * The type of the Subtask. The migration service does not check whether this + * is a known type. It is up to the task creator (i.e. orchestrator or worker) + * to ensure it only creates subtasks for which there are compatible workers + * polling for Subtasks. + * @type int $state + * Output only. The current state of the subtask. + * @type \Google\Rpc\ErrorInfo $processing_error + * Output only. An explanation that may be populated when the task is in + * FAILED state. + * @type array<\Google\Cloud\BigQuery\Migration\V2\ResourceErrorDetail>|\Google\Protobuf\Internal\RepeatedField $resource_error_details + * Output only. Provides details to errors and issues encountered while + * processing the subtask. Presence of error details does not mean that the + * subtask failed. + * @type int $resource_error_count + * The number or resources with errors. Note: This is not the total + * number of errors as each resource can have more than one error. + * This is used to indicate truncation by having a `resource_error_count` + * that is higher than the size of `resource_error_details`. + * @type \Google\Protobuf\Timestamp $create_time + * Time when the subtask was created. + * @type \Google\Protobuf\Timestamp $last_update_time + * Time when the subtask was last updated. + * @type array<\Google\Cloud\BigQuery\Migration\V2\TimeSeries>|\Google\Protobuf\Internal\RepeatedField $metrics + * The metrics for the subtask. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Immutable. The resource name for the migration subtask. The ID + * is server-generated. + * Example: `projects/123/locations/us/workflows/345/subtasks/678` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Immutable. The resource name for the migration subtask. The ID + * is server-generated. + * Example: `projects/123/locations/us/workflows/345/subtasks/678` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The unique ID of the task to which this subtask belongs. + * + * Generated from protobuf field string task_id = 2; + * @return string + */ + public function getTaskId() + { + return $this->task_id; + } + + /** + * The unique ID of the task to which this subtask belongs. + * + * Generated from protobuf field string task_id = 2; + * @param string $var + * @return $this + */ + public function setTaskId($var) + { + GPBUtil::checkString($var, True); + $this->task_id = $var; + + return $this; + } + + /** + * The type of the Subtask. The migration service does not check whether this + * is a known type. It is up to the task creator (i.e. orchestrator or worker) + * to ensure it only creates subtasks for which there are compatible workers + * polling for Subtasks. + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the Subtask. The migration service does not check whether this + * is a known type. It is up to the task creator (i.e. orchestrator or worker) + * to ensure it only creates subtasks for which there are compatible workers + * polling for Subtasks. + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Output only. The current state of the subtask. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationSubtask.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the subtask. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationSubtask.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Migration\V2\MigrationSubtask\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. An explanation that may be populated when the task is in + * FAILED state. + * + * Generated from protobuf field .google.rpc.ErrorInfo processing_error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\ErrorInfo|null + */ + public function getProcessingError() + { + return $this->processing_error; + } + + public function hasProcessingError() + { + return isset($this->processing_error); + } + + public function clearProcessingError() + { + unset($this->processing_error); + } + + /** + * Output only. An explanation that may be populated when the task is in + * FAILED state. + * + * Generated from protobuf field .google.rpc.ErrorInfo processing_error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\ErrorInfo $var + * @return $this + */ + public function setProcessingError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\ErrorInfo::class); + $this->processing_error = $var; + + return $this; + } + + /** + * Output only. Provides details to errors and issues encountered while + * processing the subtask. Presence of error details does not mean that the + * subtask failed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ResourceErrorDetail resource_error_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceErrorDetails() + { + return $this->resource_error_details; + } + + /** + * Output only. Provides details to errors and issues encountered while + * processing the subtask. Presence of error details does not mean that the + * subtask failed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ResourceErrorDetail resource_error_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BigQuery\Migration\V2\ResourceErrorDetail>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceErrorDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\ResourceErrorDetail::class); + $this->resource_error_details = $arr; + + return $this; + } + + /** + * The number or resources with errors. Note: This is not the total + * number of errors as each resource can have more than one error. + * This is used to indicate truncation by having a `resource_error_count` + * that is higher than the size of `resource_error_details`. + * + * Generated from protobuf field int32 resource_error_count = 13; + * @return int + */ + public function getResourceErrorCount() + { + return $this->resource_error_count; + } + + /** + * The number or resources with errors. Note: This is not the total + * number of errors as each resource can have more than one error. + * This is used to indicate truncation by having a `resource_error_count` + * that is higher than the size of `resource_error_details`. + * + * Generated from protobuf field int32 resource_error_count = 13; + * @param int $var + * @return $this + */ + public function setResourceErrorCount($var) + { + GPBUtil::checkInt32($var); + $this->resource_error_count = $var; + + return $this; + } + + /** + * Time when the subtask was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Time when the subtask was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Time when the subtask was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 8; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastUpdateTime() + { + return $this->last_update_time; + } + + public function hasLastUpdateTime() + { + return isset($this->last_update_time); + } + + public function clearLastUpdateTime() + { + unset($this->last_update_time); + } + + /** + * Time when the subtask was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 8; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_update_time = $var; + + return $this; + } + + /** + * The metrics for the subtask. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.TimeSeries metrics = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetrics() + { + return $this->metrics; + } + + /** + * The metrics for the subtask. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.TimeSeries metrics = 11; + * @param array<\Google\Cloud\BigQuery\Migration\V2\TimeSeries>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\TimeSeries::class); + $this->metrics = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationSubtask/State.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationSubtask/State.php new file mode 100644 index 000000000000..69f3698eaf48 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationSubtask/State.php @@ -0,0 +1,94 @@ +google.cloud.bigquery.migration.v2.MigrationSubtask.State + */ +class State +{ + /** + * The state is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The subtask is ready, i.e. it is ready for execution. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The subtask is running, i.e. it is assigned to a worker for execution. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * The subtask finished successfully. + * + * Generated from protobuf enum SUCCEEDED = 3; + */ + const SUCCEEDED = 3; + /** + * The subtask finished unsuccessfully. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + /** + * The subtask is paused, i.e., it will not be scheduled. If it was already + * assigned,it might still finish but no new lease renewals will be granted. + * + * Generated from protobuf enum PAUSED = 5; + */ + const PAUSED = 5; + /** + * The subtask is pending a dependency. It will be scheduled once its + * dependencies are done. + * + * Generated from protobuf enum PENDING_DEPENDENCY = 6; + */ + const PENDING_DEPENDENCY = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::RUNNING => 'RUNNING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::PAUSED => 'PAUSED', + self::PENDING_DEPENDENCY => 'PENDING_DEPENDENCY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BigQuery\Migration\V2\MigrationSubtask_State::class); + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationTask.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationTask.php new file mode 100644 index 000000000000..38a9467bd6cb --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationTask.php @@ -0,0 +1,609 @@ +google.cloud.bigquery.migration.v2.MigrationTask + */ +class MigrationTask extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Immutable. The unique identifier for the migration task. The + * ID is server-generated. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $id = ''; + /** + * The type of the task. This must be one of the supported task types: + * Translation_Teradata2BQ, Translation_Redshift2BQ, Translation_Bteq2BQ, + * Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ, + * Translation_Snowflake2BQ, Translation_Netezza2BQ, + * Translation_AzureSynapse2BQ, Translation_Vertica2BQ, + * Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ, + * Translation_Postgresql2BQ, Translation_SQLite2BQ, Translation_Greenplum2BQ. + * + * Generated from protobuf field string type = 2; + */ + protected $type = ''; + /** + * Output only. The current state of the task. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationTask.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. An explanation that may be populated when the task is in + * FAILED state. + * + * Generated from protobuf field .google.rpc.ErrorInfo processing_error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $processing_error = null; + /** + * Time when the task was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; + */ + protected $create_time = null; + /** + * Time when the task was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 7; + */ + protected $last_update_time = null; + /** + * Output only. Provides details to errors and issues encountered while + * processing the task. Presence of error details does not mean that the task + * failed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ResourceErrorDetail resource_error_details = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $resource_error_details; + /** + * The number or resources with errors. Note: This is not the total + * number of errors as each resource can have more than one error. + * This is used to indicate truncation by having a `resource_error_count` + * that is higher than the size of `resource_error_details`. + * + * Generated from protobuf field int32 resource_error_count = 18; + */ + protected $resource_error_count = 0; + /** + * The metrics for the task. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.TimeSeries metrics = 19; + */ + private $metrics; + /** + * Output only. The result of the task. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationTaskResult task_result = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $task_result = null; + /** + * Count of all the processing errors in this task and its subtasks. + * + * Generated from protobuf field int32 total_processing_error_count = 21; + */ + protected $total_processing_error_count = 0; + /** + * Count of all the resource errors in this task and its subtasks. + * + * Generated from protobuf field int32 total_resource_error_count = 22; + */ + protected $total_resource_error_count = 0; + protected $task_details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Migration\V2\TranslationConfigDetails $translation_config_details + * Task configuration for CW Batch/Offline SQL Translation. + * @type \Google\Cloud\BigQuery\Migration\V2\TranslationDetails $translation_details + * Task details for unified SQL Translation. + * @type string $id + * Output only. Immutable. The unique identifier for the migration task. The + * ID is server-generated. + * @type string $type + * The type of the task. This must be one of the supported task types: + * Translation_Teradata2BQ, Translation_Redshift2BQ, Translation_Bteq2BQ, + * Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ, + * Translation_Snowflake2BQ, Translation_Netezza2BQ, + * Translation_AzureSynapse2BQ, Translation_Vertica2BQ, + * Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ, + * Translation_Postgresql2BQ, Translation_SQLite2BQ, Translation_Greenplum2BQ. + * @type int $state + * Output only. The current state of the task. + * @type \Google\Rpc\ErrorInfo $processing_error + * Output only. An explanation that may be populated when the task is in + * FAILED state. + * @type \Google\Protobuf\Timestamp $create_time + * Time when the task was created. + * @type \Google\Protobuf\Timestamp $last_update_time + * Time when the task was last updated. + * @type array<\Google\Cloud\BigQuery\Migration\V2\ResourceErrorDetail>|\Google\Protobuf\Internal\RepeatedField $resource_error_details + * Output only. Provides details to errors and issues encountered while + * processing the task. Presence of error details does not mean that the task + * failed. + * @type int $resource_error_count + * The number or resources with errors. Note: This is not the total + * number of errors as each resource can have more than one error. + * This is used to indicate truncation by having a `resource_error_count` + * that is higher than the size of `resource_error_details`. + * @type array<\Google\Cloud\BigQuery\Migration\V2\TimeSeries>|\Google\Protobuf\Internal\RepeatedField $metrics + * The metrics for the task. + * @type \Google\Cloud\BigQuery\Migration\V2\MigrationTaskResult $task_result + * Output only. The result of the task. + * @type int $total_processing_error_count + * Count of all the processing errors in this task and its subtasks. + * @type int $total_resource_error_count + * Count of all the resource errors in this task and its subtasks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce(); + parent::__construct($data); + } + + /** + * Task configuration for CW Batch/Offline SQL Translation. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TranslationConfigDetails translation_config_details = 14; + * @return \Google\Cloud\BigQuery\Migration\V2\TranslationConfigDetails|null + */ + public function getTranslationConfigDetails() + { + return $this->readOneof(14); + } + + public function hasTranslationConfigDetails() + { + return $this->hasOneof(14); + } + + /** + * Task configuration for CW Batch/Offline SQL Translation. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TranslationConfigDetails translation_config_details = 14; + * @param \Google\Cloud\BigQuery\Migration\V2\TranslationConfigDetails $var + * @return $this + */ + public function setTranslationConfigDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\TranslationConfigDetails::class); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * Task details for unified SQL Translation. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TranslationDetails translation_details = 16; + * @return \Google\Cloud\BigQuery\Migration\V2\TranslationDetails|null + */ + public function getTranslationDetails() + { + return $this->readOneof(16); + } + + public function hasTranslationDetails() + { + return $this->hasOneof(16); + } + + /** + * Task details for unified SQL Translation. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TranslationDetails translation_details = 16; + * @param \Google\Cloud\BigQuery\Migration\V2\TranslationDetails $var + * @return $this + */ + public function setTranslationDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\TranslationDetails::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Output only. Immutable. The unique identifier for the migration task. The + * ID is server-generated. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Output only. Immutable. The unique identifier for the migration task. The + * ID is server-generated. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The type of the task. This must be one of the supported task types: + * Translation_Teradata2BQ, Translation_Redshift2BQ, Translation_Bteq2BQ, + * Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ, + * Translation_Snowflake2BQ, Translation_Netezza2BQ, + * Translation_AzureSynapse2BQ, Translation_Vertica2BQ, + * Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ, + * Translation_Postgresql2BQ, Translation_SQLite2BQ, Translation_Greenplum2BQ. + * + * Generated from protobuf field string type = 2; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the task. This must be one of the supported task types: + * Translation_Teradata2BQ, Translation_Redshift2BQ, Translation_Bteq2BQ, + * Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ, + * Translation_Snowflake2BQ, Translation_Netezza2BQ, + * Translation_AzureSynapse2BQ, Translation_Vertica2BQ, + * Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ, + * Translation_Postgresql2BQ, Translation_SQLite2BQ, Translation_Greenplum2BQ. + * + * Generated from protobuf field string type = 2; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Output only. The current state of the task. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationTask.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the task. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationTask.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Migration\V2\MigrationTask\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. An explanation that may be populated when the task is in + * FAILED state. + * + * Generated from protobuf field .google.rpc.ErrorInfo processing_error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\ErrorInfo|null + */ + public function getProcessingError() + { + return $this->processing_error; + } + + public function hasProcessingError() + { + return isset($this->processing_error); + } + + public function clearProcessingError() + { + unset($this->processing_error); + } + + /** + * Output only. An explanation that may be populated when the task is in + * FAILED state. + * + * Generated from protobuf field .google.rpc.ErrorInfo processing_error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\ErrorInfo $var + * @return $this + */ + public function setProcessingError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\ErrorInfo::class); + $this->processing_error = $var; + + return $this; + } + + /** + * Time when the task was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Time when the task was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Time when the task was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastUpdateTime() + { + return $this->last_update_time; + } + + public function hasLastUpdateTime() + { + return isset($this->last_update_time); + } + + public function clearLastUpdateTime() + { + unset($this->last_update_time); + } + + /** + * Time when the task was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_update_time = $var; + + return $this; + } + + /** + * Output only. Provides details to errors and issues encountered while + * processing the task. Presence of error details does not mean that the task + * failed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ResourceErrorDetail resource_error_details = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceErrorDetails() + { + return $this->resource_error_details; + } + + /** + * Output only. Provides details to errors and issues encountered while + * processing the task. Presence of error details does not mean that the task + * failed. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ResourceErrorDetail resource_error_details = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BigQuery\Migration\V2\ResourceErrorDetail>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceErrorDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\ResourceErrorDetail::class); + $this->resource_error_details = $arr; + + return $this; + } + + /** + * The number or resources with errors. Note: This is not the total + * number of errors as each resource can have more than one error. + * This is used to indicate truncation by having a `resource_error_count` + * that is higher than the size of `resource_error_details`. + * + * Generated from protobuf field int32 resource_error_count = 18; + * @return int + */ + public function getResourceErrorCount() + { + return $this->resource_error_count; + } + + /** + * The number or resources with errors. Note: This is not the total + * number of errors as each resource can have more than one error. + * This is used to indicate truncation by having a `resource_error_count` + * that is higher than the size of `resource_error_details`. + * + * Generated from protobuf field int32 resource_error_count = 18; + * @param int $var + * @return $this + */ + public function setResourceErrorCount($var) + { + GPBUtil::checkInt32($var); + $this->resource_error_count = $var; + + return $this; + } + + /** + * The metrics for the task. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.TimeSeries metrics = 19; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetrics() + { + return $this->metrics; + } + + /** + * The metrics for the task. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.TimeSeries metrics = 19; + * @param array<\Google\Cloud\BigQuery\Migration\V2\TimeSeries>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\TimeSeries::class); + $this->metrics = $arr; + + return $this; + } + + /** + * Output only. The result of the task. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationTaskResult task_result = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BigQuery\Migration\V2\MigrationTaskResult|null + */ + public function getTaskResult() + { + return $this->task_result; + } + + public function hasTaskResult() + { + return isset($this->task_result); + } + + public function clearTaskResult() + { + unset($this->task_result); + } + + /** + * Output only. The result of the task. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationTaskResult task_result = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Migration\V2\MigrationTaskResult $var + * @return $this + */ + public function setTaskResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\MigrationTaskResult::class); + $this->task_result = $var; + + return $this; + } + + /** + * Count of all the processing errors in this task and its subtasks. + * + * Generated from protobuf field int32 total_processing_error_count = 21; + * @return int + */ + public function getTotalProcessingErrorCount() + { + return $this->total_processing_error_count; + } + + /** + * Count of all the processing errors in this task and its subtasks. + * + * Generated from protobuf field int32 total_processing_error_count = 21; + * @param int $var + * @return $this + */ + public function setTotalProcessingErrorCount($var) + { + GPBUtil::checkInt32($var); + $this->total_processing_error_count = $var; + + return $this; + } + + /** + * Count of all the resource errors in this task and its subtasks. + * + * Generated from protobuf field int32 total_resource_error_count = 22; + * @return int + */ + public function getTotalResourceErrorCount() + { + return $this->total_resource_error_count; + } + + /** + * Count of all the resource errors in this task and its subtasks. + * + * Generated from protobuf field int32 total_resource_error_count = 22; + * @param int $var + * @return $this + */ + public function setTotalResourceErrorCount($var) + { + GPBUtil::checkInt32($var); + $this->total_resource_error_count = $var; + + return $this; + } + + /** + * @return string + */ + public function getTaskDetails() + { + return $this->whichOneof("task_details"); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationTask/State.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationTask/State.php new file mode 100644 index 000000000000..e55eb83b5525 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationTask/State.php @@ -0,0 +1,93 @@ +google.cloud.bigquery.migration.v2.MigrationTask.State + */ +class State +{ + /** + * The state is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The task is waiting for orchestration. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The task is assigned to an orchestrator. + * + * Generated from protobuf enum ORCHESTRATING = 2; + */ + const ORCHESTRATING = 2; + /** + * The task is running, i.e. its subtasks are ready for execution. + * + * Generated from protobuf enum RUNNING = 3; + */ + const RUNNING = 3; + /** + * Tha task is paused. Assigned subtasks can continue, but no new subtasks + * will be scheduled. + * + * Generated from protobuf enum PAUSED = 4; + */ + const PAUSED = 4; + /** + * The task finished successfully. + * + * Generated from protobuf enum SUCCEEDED = 5; + */ + const SUCCEEDED = 5; + /** + * The task finished unsuccessfully. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::ORCHESTRATING => 'ORCHESTRATING', + self::RUNNING => 'RUNNING', + self::PAUSED => 'PAUSED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BigQuery\Migration\V2\MigrationTask_State::class); + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationTaskResult.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationTaskResult.php new file mode 100644 index 000000000000..b232b1eab376 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationTaskResult.php @@ -0,0 +1,75 @@ +google.cloud.bigquery.migration.v2.MigrationTaskResult + */ +class MigrationTaskResult extends \Google\Protobuf\Internal\Message +{ + protected $details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Migration\V2\TranslationTaskResult $translation_task_result + * Details specific to translation task types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce(); + parent::__construct($data); + } + + /** + * Details specific to translation task types. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TranslationTaskResult translation_task_result = 2; + * @return \Google\Cloud\BigQuery\Migration\V2\TranslationTaskResult|null + */ + public function getTranslationTaskResult() + { + return $this->readOneof(2); + } + + public function hasTranslationTaskResult() + { + return $this->hasOneof(2); + } + + /** + * Details specific to translation task types. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TranslationTaskResult translation_task_result = 2; + * @param \Google\Cloud\BigQuery\Migration\V2\TranslationTaskResult $var + * @return $this + */ + public function setTranslationTaskResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\TranslationTaskResult::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getDetails() + { + return $this->whichOneof("details"); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationWorkflow.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationWorkflow.php new file mode 100644 index 000000000000..09dd9ef34d5e --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationWorkflow.php @@ -0,0 +1,278 @@ +google.cloud.bigquery.migration.v2.MigrationWorkflow + */ +class MigrationWorkflow extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Immutable. Identifier. The unique identifier for the migration + * workflow. The ID is server-generated. + * Example: `projects/123/locations/us/workflows/345` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * The display name of the workflow. This can be set to give a workflow + * a descriptive name. There is no guarantee or enforcement of uniqueness. + * + * Generated from protobuf field string display_name = 6; + */ + protected $display_name = ''; + /** + * The tasks in a workflow in a named map. The name (i.e. key) has no + * meaning and is merely a convenient way to address a specific task + * in a workflow. + * + * Generated from protobuf field map tasks = 2; + */ + private $tasks; + /** + * Output only. That status of the workflow. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationWorkflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Time when the workflow was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + */ + protected $create_time = null; + /** + * Time when the workflow was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 5; + */ + protected $last_update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Immutable. Identifier. The unique identifier for the migration + * workflow. The ID is server-generated. + * Example: `projects/123/locations/us/workflows/345` + * @type string $display_name + * The display name of the workflow. This can be set to give a workflow + * a descriptive name. There is no guarantee or enforcement of uniqueness. + * @type array|\Google\Protobuf\Internal\MapField $tasks + * The tasks in a workflow in a named map. The name (i.e. key) has no + * meaning and is merely a convenient way to address a specific task + * in a workflow. + * @type int $state + * Output only. That status of the workflow. + * @type \Google\Protobuf\Timestamp $create_time + * Time when the workflow was created. + * @type \Google\Protobuf\Timestamp $last_update_time + * Time when the workflow was last updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Immutable. Identifier. The unique identifier for the migration + * workflow. The ID is server-generated. + * Example: `projects/123/locations/us/workflows/345` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Immutable. Identifier. The unique identifier for the migration + * workflow. The ID is server-generated. + * Example: `projects/123/locations/us/workflows/345` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The display name of the workflow. This can be set to give a workflow + * a descriptive name. There is no guarantee or enforcement of uniqueness. + * + * Generated from protobuf field string display_name = 6; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the workflow. This can be set to give a workflow + * a descriptive name. There is no guarantee or enforcement of uniqueness. + * + * Generated from protobuf field string display_name = 6; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The tasks in a workflow in a named map. The name (i.e. key) has no + * meaning and is merely a convenient way to address a specific task + * in a workflow. + * + * Generated from protobuf field map tasks = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * The tasks in a workflow in a named map. The name (i.e. key) has no + * meaning and is merely a convenient way to address a specific task + * in a workflow. + * + * Generated from protobuf field map tasks = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\MigrationTask::class); + $this->tasks = $arr; + + return $this; + } + + /** + * Output only. That status of the workflow. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationWorkflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. That status of the workflow. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.MigrationWorkflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow\State::class); + $this->state = $var; + + return $this; + } + + /** + * Time when the workflow was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Time when the workflow was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Time when the workflow was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastUpdateTime() + { + return $this->last_update_time; + } + + public function hasLastUpdateTime() + { + return isset($this->last_update_time); + } + + public function clearLastUpdateTime() + { + unset($this->last_update_time); + } + + /** + * Time when the workflow was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_update_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationWorkflow/State.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationWorkflow/State.php new file mode 100644 index 000000000000..a3d08c0f69bd --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MigrationWorkflow/State.php @@ -0,0 +1,82 @@ +google.cloud.bigquery.migration.v2.MigrationWorkflow.State + */ +class State +{ + /** + * Workflow state is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Workflow is in draft status, i.e. tasks are not yet eligible for + * execution. + * + * Generated from protobuf enum DRAFT = 1; + */ + const DRAFT = 1; + /** + * Workflow is running (i.e. tasks are eligible for execution). + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * Workflow is paused. Tasks currently in progress may continue, but no + * further tasks will be scheduled. + * + * Generated from protobuf enum PAUSED = 3; + */ + const PAUSED = 3; + /** + * Workflow is complete. There should not be any task in a non-terminal + * state, but if they are (e.g. forced termination), they will not be + * scheduled. + * + * Generated from protobuf enum COMPLETED = 4; + */ + const COMPLETED = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::DRAFT => 'DRAFT', + self::RUNNING => 'RUNNING', + self::PAUSED => 'PAUSED', + self::COMPLETED => 'COMPLETED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow_State::class); + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MySQLDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MySQLDialect.php new file mode 100644 index 000000000000..0537001d6700 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/MySQLDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.MySQLDialect + */ +class MySQLDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NameMappingKey.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NameMappingKey.php new file mode 100644 index 000000000000..685893ad9db5 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NameMappingKey.php @@ -0,0 +1,216 @@ +google.cloud.bigquery.migration.v2.NameMappingKey + */ +class NameMappingKey extends \Google\Protobuf\Internal\Message +{ + /** + * The type of object that is being mapped. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.NameMappingKey.Type type = 1; + */ + protected $type = 0; + /** + * The database name (BigQuery project ID equivalent in the source data + * warehouse). + * + * Generated from protobuf field string database = 2; + */ + protected $database = ''; + /** + * The schema name (BigQuery dataset equivalent in the source data warehouse). + * + * Generated from protobuf field string schema = 3; + */ + protected $schema = ''; + /** + * The relation name (BigQuery table or view equivalent in the source data + * warehouse). + * + * Generated from protobuf field string relation = 4; + */ + protected $relation = ''; + /** + * The attribute name (BigQuery column equivalent in the source data + * warehouse). + * + * Generated from protobuf field string attribute = 5; + */ + protected $attribute = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The type of object that is being mapped. + * @type string $database + * The database name (BigQuery project ID equivalent in the source data + * warehouse). + * @type string $schema + * The schema name (BigQuery dataset equivalent in the source data warehouse). + * @type string $relation + * The relation name (BigQuery table or view equivalent in the source data + * warehouse). + * @type string $attribute + * The attribute name (BigQuery column equivalent in the source data + * warehouse). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + + /** + * The type of object that is being mapped. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.NameMappingKey.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of object that is being mapped. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.NameMappingKey.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Migration\V2\NameMappingKey\Type::class); + $this->type = $var; + + return $this; + } + + /** + * The database name (BigQuery project ID equivalent in the source data + * warehouse). + * + * Generated from protobuf field string database = 2; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * The database name (BigQuery project ID equivalent in the source data + * warehouse). + * + * Generated from protobuf field string database = 2; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * The schema name (BigQuery dataset equivalent in the source data warehouse). + * + * Generated from protobuf field string schema = 3; + * @return string + */ + public function getSchema() + { + return $this->schema; + } + + /** + * The schema name (BigQuery dataset equivalent in the source data warehouse). + * + * Generated from protobuf field string schema = 3; + * @param string $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkString($var, True); + $this->schema = $var; + + return $this; + } + + /** + * The relation name (BigQuery table or view equivalent in the source data + * warehouse). + * + * Generated from protobuf field string relation = 4; + * @return string + */ + public function getRelation() + { + return $this->relation; + } + + /** + * The relation name (BigQuery table or view equivalent in the source data + * warehouse). + * + * Generated from protobuf field string relation = 4; + * @param string $var + * @return $this + */ + public function setRelation($var) + { + GPBUtil::checkString($var, True); + $this->relation = $var; + + return $this; + } + + /** + * The attribute name (BigQuery column equivalent in the source data + * warehouse). + * + * Generated from protobuf field string attribute = 5; + * @return string + */ + public function getAttribute() + { + return $this->attribute; + } + + /** + * The attribute name (BigQuery column equivalent in the source data + * warehouse). + * + * Generated from protobuf field string attribute = 5; + * @param string $var + * @return $this + */ + public function setAttribute($var) + { + GPBUtil::checkString($var, True); + $this->attribute = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NameMappingKey/Type.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NameMappingKey/Type.php new file mode 100644 index 000000000000..dac0840dcc6e --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NameMappingKey/Type.php @@ -0,0 +1,103 @@ +google.cloud.bigquery.migration.v2.NameMappingKey.Type + */ +class Type +{ + /** + * Unspecified name mapping type. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * The object being mapped is a database. + * + * Generated from protobuf enum DATABASE = 1; + */ + const DATABASE = 1; + /** + * The object being mapped is a schema. + * + * Generated from protobuf enum SCHEMA = 2; + */ + const SCHEMA = 2; + /** + * The object being mapped is a relation. + * + * Generated from protobuf enum RELATION = 3; + */ + const RELATION = 3; + /** + * The object being mapped is an attribute. + * + * Generated from protobuf enum ATTRIBUTE = 4; + */ + const ATTRIBUTE = 4; + /** + * The object being mapped is a relation alias. + * + * Generated from protobuf enum RELATION_ALIAS = 5; + */ + const RELATION_ALIAS = 5; + /** + * The object being mapped is a an attribute alias. + * + * Generated from protobuf enum ATTRIBUTE_ALIAS = 6; + */ + const ATTRIBUTE_ALIAS = 6; + /** + * The object being mapped is a function. + * + * Generated from protobuf enum FUNCTION = 7; + */ + const PBFUNCTION = 7; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::DATABASE => 'DATABASE', + self::SCHEMA => 'SCHEMA', + self::RELATION => 'RELATION', + self::ATTRIBUTE => 'ATTRIBUTE', + self::RELATION_ALIAS => 'RELATION_ALIAS', + self::ATTRIBUTE_ALIAS => 'ATTRIBUTE_ALIAS', + self::PBFUNCTION => 'FUNCTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\BigQuery\Migration\V2\NameMappingKey_Type::class); + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NameMappingValue.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NameMappingValue.php new file mode 100644 index 000000000000..9720101da805 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NameMappingValue.php @@ -0,0 +1,182 @@ +google.cloud.bigquery.migration.v2.NameMappingValue + */ +class NameMappingValue extends \Google\Protobuf\Internal\Message +{ + /** + * The database name (BigQuery project ID equivalent in the target data + * warehouse). + * + * Generated from protobuf field string database = 1; + */ + protected $database = ''; + /** + * The schema name (BigQuery dataset equivalent in the target data warehouse). + * + * Generated from protobuf field string schema = 2; + */ + protected $schema = ''; + /** + * The relation name (BigQuery table or view equivalent in the target data + * warehouse). + * + * Generated from protobuf field string relation = 3; + */ + protected $relation = ''; + /** + * The attribute name (BigQuery column equivalent in the target data + * warehouse). + * + * Generated from protobuf field string attribute = 4; + */ + protected $attribute = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $database + * The database name (BigQuery project ID equivalent in the target data + * warehouse). + * @type string $schema + * The schema name (BigQuery dataset equivalent in the target data warehouse). + * @type string $relation + * The relation name (BigQuery table or view equivalent in the target data + * warehouse). + * @type string $attribute + * The attribute name (BigQuery column equivalent in the target data + * warehouse). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + + /** + * The database name (BigQuery project ID equivalent in the target data + * warehouse). + * + * Generated from protobuf field string database = 1; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * The database name (BigQuery project ID equivalent in the target data + * warehouse). + * + * Generated from protobuf field string database = 1; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * The schema name (BigQuery dataset equivalent in the target data warehouse). + * + * Generated from protobuf field string schema = 2; + * @return string + */ + public function getSchema() + { + return $this->schema; + } + + /** + * The schema name (BigQuery dataset equivalent in the target data warehouse). + * + * Generated from protobuf field string schema = 2; + * @param string $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkString($var, True); + $this->schema = $var; + + return $this; + } + + /** + * The relation name (BigQuery table or view equivalent in the target data + * warehouse). + * + * Generated from protobuf field string relation = 3; + * @return string + */ + public function getRelation() + { + return $this->relation; + } + + /** + * The relation name (BigQuery table or view equivalent in the target data + * warehouse). + * + * Generated from protobuf field string relation = 3; + * @param string $var + * @return $this + */ + public function setRelation($var) + { + GPBUtil::checkString($var, True); + $this->relation = $var; + + return $this; + } + + /** + * The attribute name (BigQuery column equivalent in the target data + * warehouse). + * + * Generated from protobuf field string attribute = 4; + * @return string + */ + public function getAttribute() + { + return $this->attribute; + } + + /** + * The attribute name (BigQuery column equivalent in the target data + * warehouse). + * + * Generated from protobuf field string attribute = 4; + * @param string $var + * @return $this + */ + public function setAttribute($var) + { + GPBUtil::checkString($var, True); + $this->attribute = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NetezzaDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NetezzaDialect.php new file mode 100644 index 000000000000..1a722f2364c1 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/NetezzaDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.NetezzaDialect + */ +class NetezzaDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ObjectNameMapping.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ObjectNameMapping.php new file mode 100644 index 000000000000..8f6205ed4689 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ObjectNameMapping.php @@ -0,0 +1,122 @@ +google.cloud.bigquery.migration.v2.ObjectNameMapping + */ +class ObjectNameMapping extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the object in source that is being mapped. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.NameMappingKey source = 1; + */ + protected $source = null; + /** + * The desired target name of the object that is being mapped. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.NameMappingValue target = 2; + */ + protected $target = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Migration\V2\NameMappingKey $source + * The name of the object in source that is being mapped. + * @type \Google\Cloud\BigQuery\Migration\V2\NameMappingValue $target + * The desired target name of the object that is being mapped. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + + /** + * The name of the object in source that is being mapped. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.NameMappingKey source = 1; + * @return \Google\Cloud\BigQuery\Migration\V2\NameMappingKey|null + */ + public function getSource() + { + return $this->source; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * The name of the object in source that is being mapped. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.NameMappingKey source = 1; + * @param \Google\Cloud\BigQuery\Migration\V2\NameMappingKey $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\NameMappingKey::class); + $this->source = $var; + + return $this; + } + + /** + * The desired target name of the object that is being mapped. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.NameMappingValue target = 2; + * @return \Google\Cloud\BigQuery\Migration\V2\NameMappingValue|null + */ + public function getTarget() + { + return $this->target; + } + + public function hasTarget() + { + return isset($this->target); + } + + public function clearTarget() + { + unset($this->target); + } + + /** + * The desired target name of the object that is being mapped. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.NameMappingValue target = 2; + * @param \Google\Cloud\BigQuery\Migration\V2\NameMappingValue $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\NameMappingValue::class); + $this->target = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ObjectNameMappingList.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ObjectNameMappingList.php new file mode 100644 index 000000000000..6dba3633d75d --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ObjectNameMappingList.php @@ -0,0 +1,68 @@ +google.cloud.bigquery.migration.v2.ObjectNameMappingList + */ +class ObjectNameMappingList extends \Google\Protobuf\Internal\Message +{ + /** + * The elements of the object name map. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ObjectNameMapping name_map = 1; + */ + private $name_map; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\Migration\V2\ObjectNameMapping>|\Google\Protobuf\Internal\RepeatedField $name_map + * The elements of the object name map. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + + /** + * The elements of the object name map. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ObjectNameMapping name_map = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNameMap() + { + return $this->name_map; + } + + /** + * The elements of the object name map. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ObjectNameMapping name_map = 1; + * @param array<\Google\Cloud\BigQuery\Migration\V2\ObjectNameMapping>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNameMap($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\ObjectNameMapping::class); + $this->name_map = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/OracleDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/OracleDialect.php new file mode 100644 index 000000000000..3d3708230e6d --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/OracleDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.OracleDialect + */ +class OracleDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/Point.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/Point.php new file mode 100644 index 000000000000..19294ba7a81d --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/Point.php @@ -0,0 +1,153 @@ +google.cloud.bigquery.migration.v2.Point + */ +class Point extends \Google\Protobuf\Internal\Message +{ + /** + * The time interval to which the data point applies. For `GAUGE` metrics, + * the start time does not need to be supplied, but if it is supplied, it must + * equal the end time. For `DELTA` metrics, the start and end time should + * specify a non-zero interval, with subsequent points specifying contiguous + * and non-overlapping intervals. For `CUMULATIVE` metrics, the start and end + * time should specify a non-zero interval, with subsequent points specifying + * the same start time and increasing end times, until an event resets the + * cumulative value to zero and sets a new start time for the following + * points. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TimeInterval interval = 1; + */ + protected $interval = null; + /** + * The value of the data point. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TypedValue value = 2; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Migration\V2\TimeInterval $interval + * The time interval to which the data point applies. For `GAUGE` metrics, + * the start time does not need to be supplied, but if it is supplied, it must + * equal the end time. For `DELTA` metrics, the start and end time should + * specify a non-zero interval, with subsequent points specifying contiguous + * and non-overlapping intervals. For `CUMULATIVE` metrics, the start and end + * time should specify a non-zero interval, with subsequent points specifying + * the same start time and increasing end times, until an event resets the + * cumulative value to zero and sets a new start time for the following + * points. + * @type \Google\Cloud\BigQuery\Migration\V2\TypedValue $value + * The value of the data point. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationMetrics::initOnce(); + parent::__construct($data); + } + + /** + * The time interval to which the data point applies. For `GAUGE` metrics, + * the start time does not need to be supplied, but if it is supplied, it must + * equal the end time. For `DELTA` metrics, the start and end time should + * specify a non-zero interval, with subsequent points specifying contiguous + * and non-overlapping intervals. For `CUMULATIVE` metrics, the start and end + * time should specify a non-zero interval, with subsequent points specifying + * the same start time and increasing end times, until an event resets the + * cumulative value to zero and sets a new start time for the following + * points. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TimeInterval interval = 1; + * @return \Google\Cloud\BigQuery\Migration\V2\TimeInterval|null + */ + public function getInterval() + { + return $this->interval; + } + + public function hasInterval() + { + return isset($this->interval); + } + + public function clearInterval() + { + unset($this->interval); + } + + /** + * The time interval to which the data point applies. For `GAUGE` metrics, + * the start time does not need to be supplied, but if it is supplied, it must + * equal the end time. For `DELTA` metrics, the start and end time should + * specify a non-zero interval, with subsequent points specifying contiguous + * and non-overlapping intervals. For `CUMULATIVE` metrics, the start and end + * time should specify a non-zero interval, with subsequent points specifying + * the same start time and increasing end times, until an event resets the + * cumulative value to zero and sets a new start time for the following + * points. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TimeInterval interval = 1; + * @param \Google\Cloud\BigQuery\Migration\V2\TimeInterval $var + * @return $this + */ + public function setInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\TimeInterval::class); + $this->interval = $var; + + return $this; + } + + /** + * The value of the data point. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TypedValue value = 2; + * @return \Google\Cloud\BigQuery\Migration\V2\TypedValue|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The value of the data point. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TypedValue value = 2; + * @param \Google\Cloud\BigQuery\Migration\V2\TypedValue $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\TypedValue::class); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/PostgresqlDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/PostgresqlDialect.php new file mode 100644 index 000000000000..9be7ec3ba359 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/PostgresqlDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.PostgresqlDialect + */ +class PostgresqlDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/PrestoDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/PrestoDialect.php new file mode 100644 index 000000000000..ede9e320ec01 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/PrestoDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.PrestoDialect + */ +class PrestoDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/RedshiftDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/RedshiftDialect.php new file mode 100644 index 000000000000..a2130a53a9af --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/RedshiftDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.RedshiftDialect + */ +class RedshiftDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ResourceErrorDetail.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ResourceErrorDetail.php new file mode 100644 index 000000000000..a28217d83d87 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/ResourceErrorDetail.php @@ -0,0 +1,153 @@ +google.cloud.bigquery.migration.v2.ResourceErrorDetail + */ +class ResourceErrorDetail extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Information about the resource where the error is located. + * + * Generated from protobuf field .google.rpc.ResourceInfo resource_info = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_info = null; + /** + * Required. The error details for the resource. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ErrorDetail error_details = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $error_details; + /** + * Required. How many errors there are in total for the resource. Truncation + * can be indicated by having an `error_count` that is higher than the size of + * `error_details`. + * + * Generated from protobuf field int32 error_count = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $error_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\ResourceInfo $resource_info + * Required. Information about the resource where the error is located. + * @type array<\Google\Cloud\BigQuery\Migration\V2\ErrorDetail>|\Google\Protobuf\Internal\RepeatedField $error_details + * Required. The error details for the resource. + * @type int $error_count + * Required. How many errors there are in total for the resource. Truncation + * can be indicated by having an `error_count` that is higher than the size of + * `error_details`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationErrorDetails::initOnce(); + parent::__construct($data); + } + + /** + * Required. Information about the resource where the error is located. + * + * Generated from protobuf field .google.rpc.ResourceInfo resource_info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Rpc\ResourceInfo|null + */ + public function getResourceInfo() + { + return $this->resource_info; + } + + public function hasResourceInfo() + { + return isset($this->resource_info); + } + + public function clearResourceInfo() + { + unset($this->resource_info); + } + + /** + * Required. Information about the resource where the error is located. + * + * Generated from protobuf field .google.rpc.ResourceInfo resource_info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Rpc\ResourceInfo $var + * @return $this + */ + public function setResourceInfo($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\ResourceInfo::class); + $this->resource_info = $var; + + return $this; + } + + /** + * Required. The error details for the resource. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ErrorDetail error_details = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrorDetails() + { + return $this->error_details; + } + + /** + * Required. The error details for the resource. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.ErrorDetail error_details = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\BigQuery\Migration\V2\ErrorDetail>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrorDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\ErrorDetail::class); + $this->error_details = $arr; + + return $this; + } + + /** + * Required. How many errors there are in total for the resource. Truncation + * can be indicated by having an `error_count` that is higher than the size of + * `error_details`. + * + * Generated from protobuf field int32 error_count = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getErrorCount() + { + return $this->error_count; + } + + /** + * Required. How many errors there are in total for the resource. Truncation + * can be indicated by having an `error_count` that is higher than the size of + * `error_details`. + * + * Generated from protobuf field int32 error_count = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setErrorCount($var) + { + GPBUtil::checkInt32($var); + $this->error_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SQLServerDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SQLServerDialect.php new file mode 100644 index 000000000000..f535d05ac4af --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SQLServerDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.SQLServerDialect + */ +class SQLServerDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SQLiteDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SQLiteDialect.php new file mode 100644 index 000000000000..49887f66be65 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SQLiteDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.SQLiteDialect + */ +class SQLiteDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SnowflakeDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SnowflakeDialect.php new file mode 100644 index 000000000000..b0edf5c26f67 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SnowflakeDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.SnowflakeDialect + */ +class SnowflakeDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceEnv.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceEnv.php new file mode 100644 index 000000000000..83549de530ab --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceEnv.php @@ -0,0 +1,163 @@ +google.cloud.bigquery.migration.v2.SourceEnv + */ +class SourceEnv extends \Google\Protobuf\Internal\Message +{ + /** + * The default database name to fully qualify SQL objects when their database + * name is missing. + * + * Generated from protobuf field string default_database = 1; + */ + protected $default_database = ''; + /** + * The schema search path. When SQL objects are missing schema name, + * translation engine will search through this list to find the value. + * + * Generated from protobuf field repeated string schema_search_path = 2; + */ + private $schema_search_path; + /** + * Optional. Expects a valid BigQuery dataset ID that exists, e.g., + * project-123.metadata_store_123. If specified, translation will search and + * read the required schema information from a metadata store in this dataset. + * If metadata store doesn't exist, translation will parse the metadata file + * and upload the schema info to a temp table in the dataset to speed up + * future translation jobs. + * + * Generated from protobuf field string metadata_store_dataset = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metadata_store_dataset = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $default_database + * The default database name to fully qualify SQL objects when their database + * name is missing. + * @type array|\Google\Protobuf\Internal\RepeatedField $schema_search_path + * The schema search path. When SQL objects are missing schema name, + * translation engine will search through this list to find the value. + * @type string $metadata_store_dataset + * Optional. Expects a valid BigQuery dataset ID that exists, e.g., + * project-123.metadata_store_123. If specified, translation will search and + * read the required schema information from a metadata store in this dataset. + * If metadata store doesn't exist, translation will parse the metadata file + * and upload the schema info to a temp table in the dataset to speed up + * future translation jobs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + + /** + * The default database name to fully qualify SQL objects when their database + * name is missing. + * + * Generated from protobuf field string default_database = 1; + * @return string + */ + public function getDefaultDatabase() + { + return $this->default_database; + } + + /** + * The default database name to fully qualify SQL objects when their database + * name is missing. + * + * Generated from protobuf field string default_database = 1; + * @param string $var + * @return $this + */ + public function setDefaultDatabase($var) + { + GPBUtil::checkString($var, True); + $this->default_database = $var; + + return $this; + } + + /** + * The schema search path. When SQL objects are missing schema name, + * translation engine will search through this list to find the value. + * + * Generated from protobuf field repeated string schema_search_path = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSchemaSearchPath() + { + return $this->schema_search_path; + } + + /** + * The schema search path. When SQL objects are missing schema name, + * translation engine will search through this list to find the value. + * + * Generated from protobuf field repeated string schema_search_path = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSchemaSearchPath($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->schema_search_path = $arr; + + return $this; + } + + /** + * Optional. Expects a valid BigQuery dataset ID that exists, e.g., + * project-123.metadata_store_123. If specified, translation will search and + * read the required schema information from a metadata store in this dataset. + * If metadata store doesn't exist, translation will parse the metadata file + * and upload the schema info to a temp table in the dataset to speed up + * future translation jobs. + * + * Generated from protobuf field string metadata_store_dataset = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMetadataStoreDataset() + { + return $this->metadata_store_dataset; + } + + /** + * Optional. Expects a valid BigQuery dataset ID that exists, e.g., + * project-123.metadata_store_123. If specified, translation will search and + * read the required schema information from a metadata store in this dataset. + * If metadata store doesn't exist, translation will parse the metadata file + * and upload the schema info to a temp table in the dataset to speed up + * future translation jobs. + * + * Generated from protobuf field string metadata_store_dataset = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMetadataStoreDataset($var) + { + GPBUtil::checkString($var, True); + $this->metadata_store_dataset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceEnvironment.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceEnvironment.php new file mode 100644 index 000000000000..95e9b3842155 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceEnvironment.php @@ -0,0 +1,163 @@ +google.cloud.bigquery.migration.v2.SourceEnvironment + */ +class SourceEnvironment extends \Google\Protobuf\Internal\Message +{ + /** + * The default database name to fully qualify SQL objects when their database + * name is missing. + * + * Generated from protobuf field string default_database = 1; + */ + protected $default_database = ''; + /** + * The schema search path. When SQL objects are missing schema name, + * translation engine will search through this list to find the value. + * + * Generated from protobuf field repeated string schema_search_path = 2; + */ + private $schema_search_path; + /** + * Optional. Expects a validQ BigQuery dataset ID that exists, e.g., + * project-123.metadata_store_123. If specified, translation will search and + * read the required schema information from a metadata store in this dataset. + * If metadata store doesn't exist, translation will parse the metadata file + * and upload the schema info to a temp table in the dataset to speed up + * future translation jobs. + * + * Generated from protobuf field string metadata_store_dataset = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metadata_store_dataset = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $default_database + * The default database name to fully qualify SQL objects when their database + * name is missing. + * @type array|\Google\Protobuf\Internal\RepeatedField $schema_search_path + * The schema search path. When SQL objects are missing schema name, + * translation engine will search through this list to find the value. + * @type string $metadata_store_dataset + * Optional. Expects a validQ BigQuery dataset ID that exists, e.g., + * project-123.metadata_store_123. If specified, translation will search and + * read the required schema information from a metadata store in this dataset. + * If metadata store doesn't exist, translation will parse the metadata file + * and upload the schema info to a temp table in the dataset to speed up + * future translation jobs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationDetails::initOnce(); + parent::__construct($data); + } + + /** + * The default database name to fully qualify SQL objects when their database + * name is missing. + * + * Generated from protobuf field string default_database = 1; + * @return string + */ + public function getDefaultDatabase() + { + return $this->default_database; + } + + /** + * The default database name to fully qualify SQL objects when their database + * name is missing. + * + * Generated from protobuf field string default_database = 1; + * @param string $var + * @return $this + */ + public function setDefaultDatabase($var) + { + GPBUtil::checkString($var, True); + $this->default_database = $var; + + return $this; + } + + /** + * The schema search path. When SQL objects are missing schema name, + * translation engine will search through this list to find the value. + * + * Generated from protobuf field repeated string schema_search_path = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSchemaSearchPath() + { + return $this->schema_search_path; + } + + /** + * The schema search path. When SQL objects are missing schema name, + * translation engine will search through this list to find the value. + * + * Generated from protobuf field repeated string schema_search_path = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSchemaSearchPath($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->schema_search_path = $arr; + + return $this; + } + + /** + * Optional. Expects a validQ BigQuery dataset ID that exists, e.g., + * project-123.metadata_store_123. If specified, translation will search and + * read the required schema information from a metadata store in this dataset. + * If metadata store doesn't exist, translation will parse the metadata file + * and upload the schema info to a temp table in the dataset to speed up + * future translation jobs. + * + * Generated from protobuf field string metadata_store_dataset = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMetadataStoreDataset() + { + return $this->metadata_store_dataset; + } + + /** + * Optional. Expects a validQ BigQuery dataset ID that exists, e.g., + * project-123.metadata_store_123. If specified, translation will search and + * read the required schema information from a metadata store in this dataset. + * If metadata store doesn't exist, translation will parse the metadata file + * and upload the schema info to a temp table in the dataset to speed up + * future translation jobs. + * + * Generated from protobuf field string metadata_store_dataset = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMetadataStoreDataset($var) + { + GPBUtil::checkString($var, True); + $this->metadata_store_dataset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceSpec.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceSpec.php new file mode 100644 index 000000000000..143506f1f801 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceSpec.php @@ -0,0 +1,142 @@ +google.cloud.bigquery.migration.v2.SourceSpec + */ +class SourceSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The optional field to specify the encoding of the sql bytes. + * + * Generated from protobuf field string encoding = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encoding = ''; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $base_uri + * The base URI for all files to be read in as sources for translation. + * @type \Google\Cloud\BigQuery\Migration\V2\Literal $literal + * Source literal. + * @type string $encoding + * Optional. The optional field to specify the encoding of the sql bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationDetails::initOnce(); + parent::__construct($data); + } + + /** + * The base URI for all files to be read in as sources for translation. + * + * Generated from protobuf field string base_uri = 1; + * @return string + */ + public function getBaseUri() + { + return $this->readOneof(1); + } + + public function hasBaseUri() + { + return $this->hasOneof(1); + } + + /** + * The base URI for all files to be read in as sources for translation. + * + * Generated from protobuf field string base_uri = 1; + * @param string $var + * @return $this + */ + public function setBaseUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Source literal. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.Literal literal = 2; + * @return \Google\Cloud\BigQuery\Migration\V2\Literal|null + */ + public function getLiteral() + { + return $this->readOneof(2); + } + + public function hasLiteral() + { + return $this->hasOneof(2); + } + + /** + * Source literal. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.Literal literal = 2; + * @param \Google\Cloud\BigQuery\Migration\V2\Literal $var + * @return $this + */ + public function setLiteral($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\Literal::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. The optional field to specify the encoding of the sql bytes. + * + * Generated from protobuf field string encoding = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEncoding() + { + return $this->encoding; + } + + /** + * Optional. The optional field to specify the encoding of the sql bytes. + * + * Generated from protobuf field string encoding = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEncoding($var) + { + GPBUtil::checkString($var, True); + $this->encoding = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceTargetMapping.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceTargetMapping.php new file mode 100644 index 000000000000..6748f2073f03 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SourceTargetMapping.php @@ -0,0 +1,121 @@ +google.cloud.bigquery.migration.v2.SourceTargetMapping + */ +class SourceTargetMapping extends \Google\Protobuf\Internal\Message +{ + /** + * The source SQL or the path to it. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SourceSpec source_spec = 1; + */ + protected $source_spec = null; + /** + * The target SQL or the path for it. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TargetSpec target_spec = 2; + */ + protected $target_spec = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Migration\V2\SourceSpec $source_spec + * The source SQL or the path to it. + * @type \Google\Cloud\BigQuery\Migration\V2\TargetSpec $target_spec + * The target SQL or the path for it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationDetails::initOnce(); + parent::__construct($data); + } + + /** + * The source SQL or the path to it. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SourceSpec source_spec = 1; + * @return \Google\Cloud\BigQuery\Migration\V2\SourceSpec|null + */ + public function getSourceSpec() + { + return $this->source_spec; + } + + public function hasSourceSpec() + { + return isset($this->source_spec); + } + + public function clearSourceSpec() + { + unset($this->source_spec); + } + + /** + * The source SQL or the path to it. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SourceSpec source_spec = 1; + * @param \Google\Cloud\BigQuery\Migration\V2\SourceSpec $var + * @return $this + */ + public function setSourceSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\SourceSpec::class); + $this->source_spec = $var; + + return $this; + } + + /** + * The target SQL or the path for it. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TargetSpec target_spec = 2; + * @return \Google\Cloud\BigQuery\Migration\V2\TargetSpec|null + */ + public function getTargetSpec() + { + return $this->target_spec; + } + + public function hasTargetSpec() + { + return isset($this->target_spec); + } + + public function clearTargetSpec() + { + unset($this->target_spec); + } + + /** + * The target SQL or the path for it. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TargetSpec target_spec = 2; + * @param \Google\Cloud\BigQuery\Migration\V2\TargetSpec $var + * @return $this + */ + public function setTargetSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\TargetSpec::class); + $this->target_spec = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SparkSQLDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SparkSQLDialect.php new file mode 100644 index 000000000000..a933fa68324d --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/SparkSQLDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.SparkSQLDialect + */ +class SparkSQLDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/StartMigrationWorkflowRequest.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/StartMigrationWorkflowRequest.php new file mode 100644 index 000000000000..28129d124acf --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/StartMigrationWorkflowRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.migration.v2.StartMigrationWorkflowRequest + */ +class StartMigrationWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * Please see {@see MigrationServiceClient::migrationWorkflowName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Migration\V2\StartMigrationWorkflowRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier for the migration workflow. + * Example: `projects/123/locations/us/workflows/1234` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TargetSpec.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TargetSpec.php new file mode 100644 index 000000000000..81a5fa9cf538 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TargetSpec.php @@ -0,0 +1,75 @@ +google.cloud.bigquery.migration.v2.TargetSpec + */ +class TargetSpec extends \Google\Protobuf\Internal\Message +{ + /** + * The relative path for the target data. Given source file + * `base_uri/input/sql`, the output would be + * `target_base_uri/sql/relative_path/input.sql`. + * + * Generated from protobuf field string relative_path = 1; + */ + protected $relative_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $relative_path + * The relative path for the target data. Given source file + * `base_uri/input/sql`, the output would be + * `target_base_uri/sql/relative_path/input.sql`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationDetails::initOnce(); + parent::__construct($data); + } + + /** + * The relative path for the target data. Given source file + * `base_uri/input/sql`, the output would be + * `target_base_uri/sql/relative_path/input.sql`. + * + * Generated from protobuf field string relative_path = 1; + * @return string + */ + public function getRelativePath() + { + return $this->relative_path; + } + + /** + * The relative path for the target data. Given source file + * `base_uri/input/sql`, the output would be + * `target_base_uri/sql/relative_path/input.sql`. + * + * Generated from protobuf field string relative_path = 1; + * @param string $var + * @return $this + */ + public function setRelativePath($var) + { + GPBUtil::checkString($var, True); + $this->relative_path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TeradataDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TeradataDialect.php new file mode 100644 index 000000000000..b50e261eeb92 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TeradataDialect.php @@ -0,0 +1,67 @@ +google.cloud.bigquery.migration.v2.TeradataDialect + */ +class TeradataDialect extends \Google\Protobuf\Internal\Message +{ + /** + * Which Teradata sub-dialect mode the user specifies. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TeradataDialect.Mode mode = 1; + */ + protected $mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Which Teradata sub-dialect mode the user specifies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + + /** + * Which Teradata sub-dialect mode the user specifies. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TeradataDialect.Mode mode = 1; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Which Teradata sub-dialect mode the user specifies. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TeradataDialect.Mode mode = 1; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Migration\V2\TeradataDialect\Mode::class); + $this->mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TeradataDialect/Mode.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TeradataDialect/Mode.php new file mode 100644 index 000000000000..8565d3737289 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TeradataDialect/Mode.php @@ -0,0 +1,64 @@ +google.cloud.bigquery.migration.v2.TeradataDialect.Mode + */ +class Mode +{ + /** + * Unspecified mode. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Teradata SQL mode. + * + * Generated from protobuf enum SQL = 1; + */ + const SQL = 1; + /** + * BTEQ mode (which includes SQL). + * + * Generated from protobuf enum BTEQ = 2; + */ + const BTEQ = 2; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::SQL => 'SQL', + self::BTEQ => 'BTEQ', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\BigQuery\Migration\V2\TeradataDialect_Mode::class); + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TimeInterval.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TimeInterval.php new file mode 100644 index 000000000000..ecb718c94a98 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TimeInterval.php @@ -0,0 +1,131 @@ +google.cloud.bigquery.migration.v2.TimeInterval + */ +class TimeInterval extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The beginning of the time interval. The default value + * for the start time is the end time. The start time must not be + * later than the end time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $start_time = null; + /** + * Required. The end of the time interval. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Optional. The beginning of the time interval. The default value + * for the start time is the end time. The start time must not be + * later than the end time. + * @type \Google\Protobuf\Timestamp $end_time + * Required. The end of the time interval. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationMetrics::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The beginning of the time interval. The default value + * for the start time is the end time. The start time must not be + * later than the end time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Optional. The beginning of the time interval. The default value + * for the start time is the end time. The start time must not be + * later than the end time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Required. The end of the time interval. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Required. The end of the time interval. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TimeSeries.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TimeSeries.php new file mode 100644 index 000000000000..2ea97494c4de --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TimeSeries.php @@ -0,0 +1,213 @@ +google.cloud.bigquery.migration.v2.TimeSeries + */ +class TimeSeries extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the metric. + * If the metric is not known by the service yet, it will be auto-created. + * + * Generated from protobuf field string metric = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $metric = ''; + /** + * Required. The value type of the time series. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $value_type = 0; + /** + * Optional. The metric kind of the time series. + * If present, it must be the same as the metric kind of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * this field specifies the metric kind of the new descriptor and must be + * either `GAUGE` (the default) or `CUMULATIVE`. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metric_kind = 0; + /** + * Required. The data points of this time series. When listing time series, + * points are returned in reverse time order. + * When creating a time series, this field must contain exactly one point and + * the point's type must be the same as the value type of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * the value type of the descriptor is determined by the point's type, which + * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.Point points = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $points; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $metric + * Required. The name of the metric. + * If the metric is not known by the service yet, it will be auto-created. + * @type int $value_type + * Required. The value type of the time series. + * @type int $metric_kind + * Optional. The metric kind of the time series. + * If present, it must be the same as the metric kind of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * this field specifies the metric kind of the new descriptor and must be + * either `GAUGE` (the default) or `CUMULATIVE`. + * @type array<\Google\Cloud\BigQuery\Migration\V2\Point>|\Google\Protobuf\Internal\RepeatedField $points + * Required. The data points of this time series. When listing time series, + * points are returned in reverse time order. + * When creating a time series, this field must contain exactly one point and + * the point's type must be the same as the value type of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * the value type of the descriptor is determined by the point's type, which + * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationMetrics::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the metric. + * If the metric is not known by the service yet, it will be auto-created. + * + * Generated from protobuf field string metric = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMetric() + { + return $this->metric; + } + + /** + * Required. The name of the metric. + * If the metric is not known by the service yet, it will be auto-created. + * + * Generated from protobuf field string metric = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkString($var, True); + $this->metric = $var; + + return $this; + } + + /** + * Required. The value type of the time series. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * Required. The value type of the time series. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\ValueType::class); + $this->value_type = $var; + + return $this; + } + + /** + * Optional. The metric kind of the time series. + * If present, it must be the same as the metric kind of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * this field specifies the metric kind of the new descriptor and must be + * either `GAUGE` (the default) or `CUMULATIVE`. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMetricKind() + { + return $this->metric_kind; + } + + /** + * Optional. The metric kind of the time series. + * If present, it must be the same as the metric kind of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * this field specifies the metric kind of the new descriptor and must be + * either `GAUGE` (the default) or `CUMULATIVE`. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMetricKind($var) + { + GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\MetricKind::class); + $this->metric_kind = $var; + + return $this; + } + + /** + * Required. The data points of this time series. When listing time series, + * points are returned in reverse time order. + * When creating a time series, this field must contain exactly one point and + * the point's type must be the same as the value type of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * the value type of the descriptor is determined by the point's type, which + * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.Point points = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPoints() + { + return $this->points; + } + + /** + * Required. The data points of this time series. When listing time series, + * points are returned in reverse time order. + * When creating a time series, this field must contain exactly one point and + * the point's type must be the same as the value type of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * the value type of the descriptor is determined by the point's type, which + * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.Point points = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\BigQuery\Migration\V2\Point>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\Point::class); + $this->points = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationConfigDetails.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationConfigDetails.php new file mode 100644 index 000000000000..73e902b8d2f1 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationConfigDetails.php @@ -0,0 +1,372 @@ +google.cloud.bigquery.migration.v2.TranslationConfigDetails + */ +class TranslationConfigDetails extends \Google\Protobuf\Internal\Message +{ + /** + * The dialect of the input files. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.Dialect source_dialect = 3; + */ + protected $source_dialect = null; + /** + * The target dialect for the engine to translate the input to. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.Dialect target_dialect = 4; + */ + protected $target_dialect = null; + /** + * The default source environment values for the translation. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SourceEnv source_env = 6; + */ + protected $source_env = null; + /** + * The indicator to show translation request initiator. + * + * Generated from protobuf field string request_source = 8; + */ + protected $request_source = ''; + /** + * The types of output to generate, e.g. sql, metadata etc. If not specified, + * a default set of targets will be generated. Some additional target types + * may be slower to generate. See the documentation for the set of available + * target types. + * + * Generated from protobuf field repeated string target_types = 9; + */ + private $target_types; + protected $source_location; + protected $target_location; + protected $output_name_mapping; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_source_path + * The Cloud Storage path for a directory of files to translate in a task. + * @type string $gcs_target_path + * The Cloud Storage path to write back the corresponding input files to. + * @type \Google\Cloud\BigQuery\Migration\V2\ObjectNameMappingList $name_mapping_list + * The mapping of objects to their desired output names in list form. + * @type \Google\Cloud\BigQuery\Migration\V2\Dialect $source_dialect + * The dialect of the input files. + * @type \Google\Cloud\BigQuery\Migration\V2\Dialect $target_dialect + * The target dialect for the engine to translate the input to. + * @type \Google\Cloud\BigQuery\Migration\V2\SourceEnv $source_env + * The default source environment values for the translation. + * @type string $request_source + * The indicator to show translation request initiator. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_types + * The types of output to generate, e.g. sql, metadata etc. If not specified, + * a default set of targets will be generated. Some additional target types + * may be slower to generate. See the documentation for the set of available + * target types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud Storage path for a directory of files to translate in a task. + * + * Generated from protobuf field string gcs_source_path = 1; + * @return string + */ + public function getGcsSourcePath() + { + return $this->readOneof(1); + } + + public function hasGcsSourcePath() + { + return $this->hasOneof(1); + } + + /** + * The Cloud Storage path for a directory of files to translate in a task. + * + * Generated from protobuf field string gcs_source_path = 1; + * @param string $var + * @return $this + */ + public function setGcsSourcePath($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The Cloud Storage path to write back the corresponding input files to. + * + * Generated from protobuf field string gcs_target_path = 2; + * @return string + */ + public function getGcsTargetPath() + { + return $this->readOneof(2); + } + + public function hasGcsTargetPath() + { + return $this->hasOneof(2); + } + + /** + * The Cloud Storage path to write back the corresponding input files to. + * + * Generated from protobuf field string gcs_target_path = 2; + * @param string $var + * @return $this + */ + public function setGcsTargetPath($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The mapping of objects to their desired output names in list form. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.ObjectNameMappingList name_mapping_list = 5; + * @return \Google\Cloud\BigQuery\Migration\V2\ObjectNameMappingList|null + */ + public function getNameMappingList() + { + return $this->readOneof(5); + } + + public function hasNameMappingList() + { + return $this->hasOneof(5); + } + + /** + * The mapping of objects to their desired output names in list form. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.ObjectNameMappingList name_mapping_list = 5; + * @param \Google\Cloud\BigQuery\Migration\V2\ObjectNameMappingList $var + * @return $this + */ + public function setNameMappingList($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\ObjectNameMappingList::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The dialect of the input files. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.Dialect source_dialect = 3; + * @return \Google\Cloud\BigQuery\Migration\V2\Dialect|null + */ + public function getSourceDialect() + { + return $this->source_dialect; + } + + public function hasSourceDialect() + { + return isset($this->source_dialect); + } + + public function clearSourceDialect() + { + unset($this->source_dialect); + } + + /** + * The dialect of the input files. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.Dialect source_dialect = 3; + * @param \Google\Cloud\BigQuery\Migration\V2\Dialect $var + * @return $this + */ + public function setSourceDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\Dialect::class); + $this->source_dialect = $var; + + return $this; + } + + /** + * The target dialect for the engine to translate the input to. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.Dialect target_dialect = 4; + * @return \Google\Cloud\BigQuery\Migration\V2\Dialect|null + */ + public function getTargetDialect() + { + return $this->target_dialect; + } + + public function hasTargetDialect() + { + return isset($this->target_dialect); + } + + public function clearTargetDialect() + { + unset($this->target_dialect); + } + + /** + * The target dialect for the engine to translate the input to. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.Dialect target_dialect = 4; + * @param \Google\Cloud\BigQuery\Migration\V2\Dialect $var + * @return $this + */ + public function setTargetDialect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\Dialect::class); + $this->target_dialect = $var; + + return $this; + } + + /** + * The default source environment values for the translation. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SourceEnv source_env = 6; + * @return \Google\Cloud\BigQuery\Migration\V2\SourceEnv|null + */ + public function getSourceEnv() + { + return $this->source_env; + } + + public function hasSourceEnv() + { + return isset($this->source_env); + } + + public function clearSourceEnv() + { + unset($this->source_env); + } + + /** + * The default source environment values for the translation. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SourceEnv source_env = 6; + * @param \Google\Cloud\BigQuery\Migration\V2\SourceEnv $var + * @return $this + */ + public function setSourceEnv($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\SourceEnv::class); + $this->source_env = $var; + + return $this; + } + + /** + * The indicator to show translation request initiator. + * + * Generated from protobuf field string request_source = 8; + * @return string + */ + public function getRequestSource() + { + return $this->request_source; + } + + /** + * The indicator to show translation request initiator. + * + * Generated from protobuf field string request_source = 8; + * @param string $var + * @return $this + */ + public function setRequestSource($var) + { + GPBUtil::checkString($var, True); + $this->request_source = $var; + + return $this; + } + + /** + * The types of output to generate, e.g. sql, metadata etc. If not specified, + * a default set of targets will be generated. Some additional target types + * may be slower to generate. See the documentation for the set of available + * target types. + * + * Generated from protobuf field repeated string target_types = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetTypes() + { + return $this->target_types; + } + + /** + * The types of output to generate, e.g. sql, metadata etc. If not specified, + * a default set of targets will be generated. Some additional target types + * may be slower to generate. See the documentation for the set of available + * target types. + * + * Generated from protobuf field repeated string target_types = 9; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_types = $arr; + + return $this; + } + + /** + * @return string + */ + public function getSourceLocation() + { + return $this->whichOneof("source_location"); + } + + /** + * @return string + */ + public function getTargetLocation() + { + return $this->whichOneof("target_location"); + } + + /** + * @return string + */ + public function getOutputNameMapping() + { + return $this->whichOneof("output_name_mapping"); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationDetails.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationDetails.php new file mode 100644 index 000000000000..3b03ce6d4ce4 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationDetails.php @@ -0,0 +1,234 @@ +google.cloud.bigquery.migration.v2.TranslationDetails + */ +class TranslationDetails extends \Google\Protobuf\Internal\Message +{ + /** + * The mapping from source to target SQL. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.SourceTargetMapping source_target_mapping = 1; + */ + private $source_target_mapping; + /** + * The base URI for all writes to persistent storage. + * + * Generated from protobuf field string target_base_uri = 2; + */ + protected $target_base_uri = ''; + /** + * The default source environment values for the translation. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SourceEnvironment source_environment = 3; + */ + protected $source_environment = null; + /** + * The list of literal targets that will be directly returned to the response. + * Each entry consists of the constructed path, EXCLUDING the base path. Not + * providing a target_base_uri will prevent writing to persistent storage. + * + * Generated from protobuf field repeated string target_return_literals = 4; + */ + private $target_return_literals; + /** + * The types of output to generate, e.g. sql, metadata, + * lineage_from_sql_scripts, etc. If not specified, a default set of + * targets will be generated. Some additional target types may be slower to + * generate. See the documentation for the set of available target types. + * + * Generated from protobuf field repeated string target_types = 5; + */ + private $target_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\Migration\V2\SourceTargetMapping>|\Google\Protobuf\Internal\RepeatedField $source_target_mapping + * The mapping from source to target SQL. + * @type string $target_base_uri + * The base URI for all writes to persistent storage. + * @type \Google\Cloud\BigQuery\Migration\V2\SourceEnvironment $source_environment + * The default source environment values for the translation. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_return_literals + * The list of literal targets that will be directly returned to the response. + * Each entry consists of the constructed path, EXCLUDING the base path. Not + * providing a target_base_uri will prevent writing to persistent storage. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_types + * The types of output to generate, e.g. sql, metadata, + * lineage_from_sql_scripts, etc. If not specified, a default set of + * targets will be generated. Some additional target types may be slower to + * generate. See the documentation for the set of available target types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationDetails::initOnce(); + parent::__construct($data); + } + + /** + * The mapping from source to target SQL. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.SourceTargetMapping source_target_mapping = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceTargetMapping() + { + return $this->source_target_mapping; + } + + /** + * The mapping from source to target SQL. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.SourceTargetMapping source_target_mapping = 1; + * @param array<\Google\Cloud\BigQuery\Migration\V2\SourceTargetMapping>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceTargetMapping($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\SourceTargetMapping::class); + $this->source_target_mapping = $arr; + + return $this; + } + + /** + * The base URI for all writes to persistent storage. + * + * Generated from protobuf field string target_base_uri = 2; + * @return string + */ + public function getTargetBaseUri() + { + return $this->target_base_uri; + } + + /** + * The base URI for all writes to persistent storage. + * + * Generated from protobuf field string target_base_uri = 2; + * @param string $var + * @return $this + */ + public function setTargetBaseUri($var) + { + GPBUtil::checkString($var, True); + $this->target_base_uri = $var; + + return $this; + } + + /** + * The default source environment values for the translation. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SourceEnvironment source_environment = 3; + * @return \Google\Cloud\BigQuery\Migration\V2\SourceEnvironment|null + */ + public function getSourceEnvironment() + { + return $this->source_environment; + } + + public function hasSourceEnvironment() + { + return isset($this->source_environment); + } + + public function clearSourceEnvironment() + { + unset($this->source_environment); + } + + /** + * The default source environment values for the translation. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.SourceEnvironment source_environment = 3; + * @param \Google\Cloud\BigQuery\Migration\V2\SourceEnvironment $var + * @return $this + */ + public function setSourceEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\SourceEnvironment::class); + $this->source_environment = $var; + + return $this; + } + + /** + * The list of literal targets that will be directly returned to the response. + * Each entry consists of the constructed path, EXCLUDING the base path. Not + * providing a target_base_uri will prevent writing to persistent storage. + * + * Generated from protobuf field repeated string target_return_literals = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetReturnLiterals() + { + return $this->target_return_literals; + } + + /** + * The list of literal targets that will be directly returned to the response. + * Each entry consists of the constructed path, EXCLUDING the base path. Not + * providing a target_base_uri will prevent writing to persistent storage. + * + * Generated from protobuf field repeated string target_return_literals = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetReturnLiterals($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_return_literals = $arr; + + return $this; + } + + /** + * The types of output to generate, e.g. sql, metadata, + * lineage_from_sql_scripts, etc. If not specified, a default set of + * targets will be generated. Some additional target types may be slower to + * generate. See the documentation for the set of available target types. + * + * Generated from protobuf field repeated string target_types = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetTypes() + { + return $this->target_types; + } + + /** + * The types of output to generate, e.g. sql, metadata, + * lineage_from_sql_scripts, etc. If not specified, a default set of + * targets will be generated. Some additional target types may be slower to + * generate. See the documentation for the set of available target types. + * + * Generated from protobuf field repeated string target_types = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationReportRecord.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationReportRecord.php new file mode 100644 index 000000000000..4f2bf754676d --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationReportRecord.php @@ -0,0 +1,211 @@ +google.cloud.bigquery.migration.v2.TranslationReportRecord + */ +class TranslationReportRecord extends \Google\Protobuf\Internal\Message +{ + /** + * Severity of the translation record. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TranslationReportRecord.Severity severity = 1; + */ + protected $severity = 0; + /** + * Specifies the row from the source text where the error occurred (0 based). + * Example: 2 + * + * Generated from protobuf field int32 script_line = 2; + */ + protected $script_line = 0; + /** + * Specifies the column from the source texts where the error occurred. (0 + * based) example: 6 + * + * Generated from protobuf field int32 script_column = 3; + */ + protected $script_column = 0; + /** + * Category of the error/warning. Example: SyntaxError + * + * Generated from protobuf field string category = 4; + */ + protected $category = ''; + /** + * Detailed message of the record. + * + * Generated from protobuf field string message = 5; + */ + protected $message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $severity + * Severity of the translation record. + * @type int $script_line + * Specifies the row from the source text where the error occurred (0 based). + * Example: 2 + * @type int $script_column + * Specifies the column from the source texts where the error occurred. (0 + * based) example: 6 + * @type string $category + * Category of the error/warning. Example: SyntaxError + * @type string $message + * Detailed message of the record. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationSuggestion::initOnce(); + parent::__construct($data); + } + + /** + * Severity of the translation record. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TranslationReportRecord.Severity severity = 1; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * Severity of the translation record. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TranslationReportRecord.Severity severity = 1; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Migration\V2\TranslationReportRecord\Severity::class); + $this->severity = $var; + + return $this; + } + + /** + * Specifies the row from the source text where the error occurred (0 based). + * Example: 2 + * + * Generated from protobuf field int32 script_line = 2; + * @return int + */ + public function getScriptLine() + { + return $this->script_line; + } + + /** + * Specifies the row from the source text where the error occurred (0 based). + * Example: 2 + * + * Generated from protobuf field int32 script_line = 2; + * @param int $var + * @return $this + */ + public function setScriptLine($var) + { + GPBUtil::checkInt32($var); + $this->script_line = $var; + + return $this; + } + + /** + * Specifies the column from the source texts where the error occurred. (0 + * based) example: 6 + * + * Generated from protobuf field int32 script_column = 3; + * @return int + */ + public function getScriptColumn() + { + return $this->script_column; + } + + /** + * Specifies the column from the source texts where the error occurred. (0 + * based) example: 6 + * + * Generated from protobuf field int32 script_column = 3; + * @param int $var + * @return $this + */ + public function setScriptColumn($var) + { + GPBUtil::checkInt32($var); + $this->script_column = $var; + + return $this; + } + + /** + * Category of the error/warning. Example: SyntaxError + * + * Generated from protobuf field string category = 4; + * @return string + */ + public function getCategory() + { + return $this->category; + } + + /** + * Category of the error/warning. Example: SyntaxError + * + * Generated from protobuf field string category = 4; + * @param string $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkString($var, True); + $this->category = $var; + + return $this; + } + + /** + * Detailed message of the record. + * + * Generated from protobuf field string message = 5; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Detailed message of the record. + * + * Generated from protobuf field string message = 5; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationReportRecord/Severity.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationReportRecord/Severity.php new file mode 100644 index 000000000000..52cf5ab95075 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationReportRecord/Severity.php @@ -0,0 +1,72 @@ +google.cloud.bigquery.migration.v2.TranslationReportRecord.Severity + */ +class Severity +{ + /** + * SeverityType not specified. + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * INFO type. + * + * Generated from protobuf enum INFO = 1; + */ + const INFO = 1; + /** + * WARNING type. The translated query may still provide useful information + * if all the report records are WARNING. + * + * Generated from protobuf enum WARNING = 2; + */ + const WARNING = 2; + /** + * ERROR type. Translation failed. + * + * Generated from protobuf enum ERROR = 3; + */ + const ERROR = 3; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::INFO => 'INFO', + self::WARNING => 'WARNING', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Severity::class, \Google\Cloud\BigQuery\Migration\V2\TranslationReportRecord_Severity::class); + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationTaskResult.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationTaskResult.php new file mode 100644 index 000000000000..7f35cd749ddc --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TranslationTaskResult.php @@ -0,0 +1,101 @@ +google.cloud.bigquery.migration.v2.TranslationTaskResult + */ +class TranslationTaskResult extends \Google\Protobuf\Internal\Message +{ + /** + * The list of the translated literals. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.Literal translated_literals = 1; + */ + private $translated_literals; + /** + * The records from the aggregate CSV report for a migration workflow. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.GcsReportLogMessage report_log_messages = 2; + */ + private $report_log_messages; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\Migration\V2\Literal>|\Google\Protobuf\Internal\RepeatedField $translated_literals + * The list of the translated literals. + * @type array<\Google\Cloud\BigQuery\Migration\V2\GcsReportLogMessage>|\Google\Protobuf\Internal\RepeatedField $report_log_messages + * The records from the aggregate CSV report for a migration workflow. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce(); + parent::__construct($data); + } + + /** + * The list of the translated literals. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.Literal translated_literals = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTranslatedLiterals() + { + return $this->translated_literals; + } + + /** + * The list of the translated literals. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.Literal translated_literals = 1; + * @param array<\Google\Cloud\BigQuery\Migration\V2\Literal>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTranslatedLiterals($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\Literal::class); + $this->translated_literals = $arr; + + return $this; + } + + /** + * The records from the aggregate CSV report for a migration workflow. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.GcsReportLogMessage report_log_messages = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReportLogMessages() + { + return $this->report_log_messages; + } + + /** + * The records from the aggregate CSV report for a migration workflow. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.GcsReportLogMessage report_log_messages = 2; + * @param array<\Google\Cloud\BigQuery\Migration\V2\GcsReportLogMessage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReportLogMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\GcsReportLogMessage::class); + $this->report_log_messages = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TypedValue.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TypedValue.php new file mode 100644 index 000000000000..f1f140446f87 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/TypedValue.php @@ -0,0 +1,213 @@ +google.cloud.bigquery.migration.v2.TypedValue + */ +class TypedValue extends \Google\Protobuf\Internal\Message +{ + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $bool_value + * A Boolean value: `true` or `false`. + * @type int|string $int64_value + * A 64-bit integer. Its range is approximately `+/-9.2x10^18`. + * @type float $double_value + * A 64-bit double-precision floating-point number. Its magnitude + * is approximately `+/-10^(+/-300)` and it has 16 significant digits of + * precision. + * @type string $string_value + * A variable-length string value. + * @type \Google\Api\Distribution $distribution_value + * A distribution value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationMetrics::initOnce(); + parent::__construct($data); + } + + /** + * A Boolean value: `true` or `false`. + * + * Generated from protobuf field bool bool_value = 1; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(1); + } + + public function hasBoolValue() + { + return $this->hasOneof(1); + } + + /** + * A Boolean value: `true` or `false`. + * + * Generated from protobuf field bool bool_value = 1; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A 64-bit integer. Its range is approximately `+/-9.2x10^18`. + * + * Generated from protobuf field int64 int64_value = 2; + * @return int|string + */ + public function getInt64Value() + { + return $this->readOneof(2); + } + + public function hasInt64Value() + { + return $this->hasOneof(2); + } + + /** + * A 64-bit integer. Its range is approximately `+/-9.2x10^18`. + * + * Generated from protobuf field int64 int64_value = 2; + * @param int|string $var + * @return $this + */ + public function setInt64Value($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A 64-bit double-precision floating-point number. Its magnitude + * is approximately `+/-10^(+/-300)` and it has 16 significant digits of + * precision. + * + * Generated from protobuf field double double_value = 3; + * @return float + */ + public function getDoubleValue() + { + return $this->readOneof(3); + } + + public function hasDoubleValue() + { + return $this->hasOneof(3); + } + + /** + * A 64-bit double-precision floating-point number. Its magnitude + * is approximately `+/-10^(+/-300)` and it has 16 significant digits of + * precision. + * + * Generated from protobuf field double double_value = 3; + * @param float $var + * @return $this + */ + public function setDoubleValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A variable-length string value. + * + * Generated from protobuf field string string_value = 4; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(4); + } + + public function hasStringValue() + { + return $this->hasOneof(4); + } + + /** + * A variable-length string value. + * + * Generated from protobuf field string string_value = 4; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A distribution value. + * + * Generated from protobuf field .google.api.Distribution distribution_value = 5; + * @return \Google\Api\Distribution|null + */ + public function getDistributionValue() + { + return $this->readOneof(5); + } + + public function hasDistributionValue() + { + return $this->hasOneof(5); + } + + /** + * A distribution value. + * + * Generated from protobuf field .google.api.Distribution distribution_value = 5; + * @param \Google\Api\Distribution $var + * @return $this + */ + public function setDistributionValue($var) + { + GPBUtil::checkMessage($var, \Google\Api\Distribution::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/VerticaDialect.php b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/VerticaDialect.php new file mode 100644 index 000000000000..c00c7444c8b1 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/proto/src/Google/Cloud/BigQuery/Migration/V2/VerticaDialect.php @@ -0,0 +1,33 @@ +google.cloud.bigquery.migration.v2.VerticaDialect + */ +class VerticaDialect extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\TranslationConfig::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/create_migration_workflow.php b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/create_migration_workflow.php new file mode 100644 index 000000000000..7ac5039b3269 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/create_migration_workflow.php @@ -0,0 +1,74 @@ +setParent($formattedParent) + ->setMigrationWorkflow($migrationWorkflow); + + // Call the API and handle any network failures. + try { + /** @var MigrationWorkflow $response */ + $response = $migrationServiceClient->createMigrationWorkflow($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = MigrationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + create_migration_workflow_sample($formattedParent); +} +// [END bigquerymigration_v2_generated_MigrationService_CreateMigrationWorkflow_sync] diff --git a/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/delete_migration_workflow.php b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/delete_migration_workflow.php new file mode 100644 index 000000000000..4e68d8af9c8f --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/delete_migration_workflow.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $migrationServiceClient->deleteMigrationWorkflow($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MigrationServiceClient::migrationWorkflowName( + '[PROJECT]', + '[LOCATION]', + '[WORKFLOW]' + ); + + delete_migration_workflow_sample($formattedName); +} +// [END bigquerymigration_v2_generated_MigrationService_DeleteMigrationWorkflow_sync] diff --git a/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/get_migration_subtask.php b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/get_migration_subtask.php new file mode 100644 index 000000000000..7deb48d19f70 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/get_migration_subtask.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var MigrationSubtask $response */ + $response = $migrationServiceClient->getMigrationSubtask($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MigrationServiceClient::migrationSubtaskName( + '[PROJECT]', + '[LOCATION]', + '[WORKFLOW]', + '[SUBTASK]' + ); + + get_migration_subtask_sample($formattedName); +} +// [END bigquerymigration_v2_generated_MigrationService_GetMigrationSubtask_sync] diff --git a/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/get_migration_workflow.php b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/get_migration_workflow.php new file mode 100644 index 000000000000..15b66eb6713e --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/get_migration_workflow.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var MigrationWorkflow $response */ + $response = $migrationServiceClient->getMigrationWorkflow($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MigrationServiceClient::migrationWorkflowName( + '[PROJECT]', + '[LOCATION]', + '[WORKFLOW]' + ); + + get_migration_workflow_sample($formattedName); +} +// [END bigquerymigration_v2_generated_MigrationService_GetMigrationWorkflow_sync] diff --git a/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/list_migration_subtasks.php b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/list_migration_subtasks.php new file mode 100644 index 000000000000..b7ccdc34948f --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/list_migration_subtasks.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $migrationServiceClient->listMigrationSubtasks($request); + + /** @var MigrationSubtask $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = MigrationServiceClient::migrationWorkflowName( + '[PROJECT]', + '[LOCATION]', + '[WORKFLOW]' + ); + + list_migration_subtasks_sample($formattedParent); +} +// [END bigquerymigration_v2_generated_MigrationService_ListMigrationSubtasks_sync] diff --git a/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/list_migration_workflows.php b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/list_migration_workflows.php new file mode 100644 index 000000000000..8c4720d6cb52 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/list_migration_workflows.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $migrationServiceClient->listMigrationWorkflows($request); + + /** @var MigrationWorkflow $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = MigrationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_migration_workflows_sample($formattedParent); +} +// [END bigquerymigration_v2_generated_MigrationService_ListMigrationWorkflows_sync] diff --git a/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/start_migration_workflow.php b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/start_migration_workflow.php new file mode 100644 index 000000000000..fe557b31bd70 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/samples/V2/MigrationServiceClient/start_migration_workflow.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $migrationServiceClient->startMigrationWorkflow($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MigrationServiceClient::migrationWorkflowName( + '[PROJECT]', + '[LOCATION]', + '[WORKFLOW]' + ); + + start_migration_workflow_sample($formattedName); +} +// [END bigquerymigration_v2_generated_MigrationService_StartMigrationWorkflow_sync] diff --git a/owl-bot-staging/BigQueryMigration/v2/src/V2/Client/MigrationServiceClient.php b/owl-bot-staging/BigQueryMigration/v2/src/V2/Client/MigrationServiceClient.php new file mode 100644 index 000000000000..bc1988d87d0d --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/src/V2/Client/MigrationServiceClient.php @@ -0,0 +1,458 @@ + createMigrationWorkflowAsync(CreateMigrationWorkflowRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteMigrationWorkflowAsync(DeleteMigrationWorkflowRequest $request, array $optionalArgs = []) + * @method PromiseInterface getMigrationSubtaskAsync(GetMigrationSubtaskRequest $request, array $optionalArgs = []) + * @method PromiseInterface getMigrationWorkflowAsync(GetMigrationWorkflowRequest $request, array $optionalArgs = []) + * @method PromiseInterface listMigrationSubtasksAsync(ListMigrationSubtasksRequest $request, array $optionalArgs = []) + * @method PromiseInterface listMigrationWorkflowsAsync(ListMigrationWorkflowsRequest $request, array $optionalArgs = []) + * @method PromiseInterface startMigrationWorkflowAsync(StartMigrationWorkflowRequest $request, array $optionalArgs = []) + */ +final class MigrationServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.bigquery.migration.v2.MigrationService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'bigquerymigration.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'bigquerymigration.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/migration_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/migration_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/migration_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/migration_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * migration_subtask resource. + * + * @param string $project + * @param string $location + * @param string $workflow + * @param string $subtask + * + * @return string The formatted migration_subtask resource. + */ + public static function migrationSubtaskName(string $project, string $location, string $workflow, string $subtask): string + { + return self::getPathTemplate('migrationSubtask')->render([ + 'project' => $project, + 'location' => $location, + 'workflow' => $workflow, + 'subtask' => $subtask, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * migration_workflow resource. + * + * @param string $project + * @param string $location + * @param string $workflow + * + * @return string The formatted migration_workflow resource. + */ + public static function migrationWorkflowName(string $project, string $location, string $workflow): string + { + return self::getPathTemplate('migrationWorkflow')->render([ + 'project' => $project, + 'location' => $location, + 'workflow' => $workflow, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: projects/{project}/locations/{location} + * - migrationSubtask: projects/{project}/locations/{location}/workflows/{workflow}/subtasks/{subtask} + * - migrationWorkflow: projects/{project}/locations/{location}/workflows/{workflow} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'bigquerymigration.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a migration workflow. + * + * The async variant is + * {@see MigrationServiceClient::createMigrationWorkflowAsync()} . + * + * @example samples/V2/MigrationServiceClient/create_migration_workflow.php + * + * @param CreateMigrationWorkflowRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MigrationWorkflow + * + * @throws ApiException Thrown if the API call fails. + */ + public function createMigrationWorkflow(CreateMigrationWorkflowRequest $request, array $callOptions = []): MigrationWorkflow + { + return $this->startApiCall('CreateMigrationWorkflow', $request, $callOptions)->wait(); + } + + /** + * Deletes a migration workflow by name. + * + * The async variant is + * {@see MigrationServiceClient::deleteMigrationWorkflowAsync()} . + * + * @example samples/V2/MigrationServiceClient/delete_migration_workflow.php + * + * @param DeleteMigrationWorkflowRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteMigrationWorkflow(DeleteMigrationWorkflowRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteMigrationWorkflow', $request, $callOptions)->wait(); + } + + /** + * Gets a previously created migration subtask. + * + * The async variant is {@see MigrationServiceClient::getMigrationSubtaskAsync()} . + * + * @example samples/V2/MigrationServiceClient/get_migration_subtask.php + * + * @param GetMigrationSubtaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MigrationSubtask + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMigrationSubtask(GetMigrationSubtaskRequest $request, array $callOptions = []): MigrationSubtask + { + return $this->startApiCall('GetMigrationSubtask', $request, $callOptions)->wait(); + } + + /** + * Gets a previously created migration workflow. + * + * The async variant is {@see MigrationServiceClient::getMigrationWorkflowAsync()} + * . + * + * @example samples/V2/MigrationServiceClient/get_migration_workflow.php + * + * @param GetMigrationWorkflowRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MigrationWorkflow + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMigrationWorkflow(GetMigrationWorkflowRequest $request, array $callOptions = []): MigrationWorkflow + { + return $this->startApiCall('GetMigrationWorkflow', $request, $callOptions)->wait(); + } + + /** + * Lists previously created migration subtasks. + * + * The async variant is {@see MigrationServiceClient::listMigrationSubtasksAsync()} + * . + * + * @example samples/V2/MigrationServiceClient/list_migration_subtasks.php + * + * @param ListMigrationSubtasksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listMigrationSubtasks(ListMigrationSubtasksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMigrationSubtasks', $request, $callOptions); + } + + /** + * Lists previously created migration workflow. + * + * The async variant is + * {@see MigrationServiceClient::listMigrationWorkflowsAsync()} . + * + * @example samples/V2/MigrationServiceClient/list_migration_workflows.php + * + * @param ListMigrationWorkflowsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listMigrationWorkflows(ListMigrationWorkflowsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMigrationWorkflows', $request, $callOptions); + } + + /** + * Starts a previously created migration workflow. I.e., the state transitions + * from DRAFT to RUNNING. This is a no-op if the state is already RUNNING. + * An error will be signaled if the state is anything other than DRAFT or + * RUNNING. + * + * The async variant is + * {@see MigrationServiceClient::startMigrationWorkflowAsync()} . + * + * @example samples/V2/MigrationServiceClient/start_migration_workflow.php + * + * @param StartMigrationWorkflowRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function startMigrationWorkflow(StartMigrationWorkflowRequest $request, array $callOptions = []): void + { + $this->startApiCall('StartMigrationWorkflow', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BigQueryMigration/v2/src/V2/gapic_metadata.json b/owl-bot-staging/BigQueryMigration/v2/src/V2/gapic_metadata.json new file mode 100644 index 000000000000..f29fa4dd179b --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/src/V2/gapic_metadata.json @@ -0,0 +1,53 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.bigquery.migration.v2", + "libraryPackage": "Google\\Cloud\\BigQuery\\Migration\\V2", + "services": { + "MigrationService": { + "clients": { + "grpc": { + "libraryClient": "MigrationServiceGapicClient", + "rpcs": { + "CreateMigrationWorkflow": { + "methods": [ + "createMigrationWorkflow" + ] + }, + "DeleteMigrationWorkflow": { + "methods": [ + "deleteMigrationWorkflow" + ] + }, + "GetMigrationSubtask": { + "methods": [ + "getMigrationSubtask" + ] + }, + "GetMigrationWorkflow": { + "methods": [ + "getMigrationWorkflow" + ] + }, + "ListMigrationSubtasks": { + "methods": [ + "listMigrationSubtasks" + ] + }, + "ListMigrationWorkflows": { + "methods": [ + "listMigrationWorkflows" + ] + }, + "StartMigrationWorkflow": { + "methods": [ + "startMigrationWorkflow" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BigQueryMigration/v2/src/V2/resources/migration_service_client_config.json b/owl-bot-staging/BigQueryMigration/v2/src/V2/resources/migration_service_client_config.json new file mode 100644 index 000000000000..177fac8a03f3 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/src/V2/resources/migration_service_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.bigquery.migration.v2.MigrationService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateMigrationWorkflow": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteMigrationWorkflow": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetMigrationSubtask": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetMigrationWorkflow": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListMigrationSubtasks": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListMigrationWorkflows": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "StartMigrationWorkflow": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/BigQueryMigration/v2/src/V2/resources/migration_service_descriptor_config.php b/owl-bot-staging/BigQueryMigration/v2/src/V2/resources/migration_service_descriptor_config.php new file mode 100644 index 000000000000..4b8ec9bd0660 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/src/V2/resources/migration_service_descriptor_config.php @@ -0,0 +1,133 @@ + [ + 'google.cloud.bigquery.migration.v2.MigrationService' => [ + 'CreateMigrationWorkflow' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteMigrationWorkflow' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetMigrationSubtask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Migration\V2\MigrationSubtask', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetMigrationWorkflow' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListMigrationSubtasks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMigrationSubtasks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Migration\V2\ListMigrationSubtasksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListMigrationWorkflows' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMigrationWorkflows', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Migration\V2\ListMigrationWorkflowsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'StartMigrationWorkflow' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'location' => 'projects/{project}/locations/{location}', + 'migrationSubtask' => 'projects/{project}/locations/{location}/workflows/{workflow}/subtasks/{subtask}', + 'migrationWorkflow' => 'projects/{project}/locations/{location}/workflows/{workflow}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryMigration/v2/src/V2/resources/migration_service_rest_client_config.php b/owl-bot-staging/BigQueryMigration/v2/src/V2/resources/migration_service_rest_client_config.php new file mode 100644 index 000000000000..efc080cd9643 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/src/V2/resources/migration_service_rest_client_config.php @@ -0,0 +1,107 @@ + [ + 'google.cloud.bigquery.migration.v2.MigrationService' => [ + 'CreateMigrationWorkflow' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/workflows', + 'body' => 'migration_workflow', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteMigrationWorkflow' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/workflows/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetMigrationSubtask' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/workflows/*/subtasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetMigrationWorkflow' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/workflows/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListMigrationSubtasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/workflows/*}/subtasks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListMigrationWorkflows' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/workflows', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'StartMigrationWorkflow' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/workflows/*}:start', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryMigration/v2/tests/Unit/V2/Client/MigrationServiceClientTest.php b/owl-bot-staging/BigQueryMigration/v2/tests/Unit/V2/Client/MigrationServiceClientTest.php new file mode 100644 index 000000000000..684815e9be91 --- /dev/null +++ b/owl-bot-staging/BigQueryMigration/v2/tests/Unit/V2/Client/MigrationServiceClientTest.php @@ -0,0 +1,581 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return MigrationServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new MigrationServiceClient($options); + } + + /** @test */ + public function createMigrationWorkflowTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new MigrationWorkflow(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $migrationWorkflow = new MigrationWorkflow(); + $request = (new CreateMigrationWorkflowRequest()) + ->setParent($formattedParent) + ->setMigrationWorkflow($migrationWorkflow); + $response = $gapicClient->createMigrationWorkflow($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.migration.v2.MigrationService/CreateMigrationWorkflow', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getMigrationWorkflow(); + $this->assertProtobufEquals($migrationWorkflow, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createMigrationWorkflowExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $migrationWorkflow = new MigrationWorkflow(); + $request = (new CreateMigrationWorkflowRequest()) + ->setParent($formattedParent) + ->setMigrationWorkflow($migrationWorkflow); + try { + $gapicClient->createMigrationWorkflow($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteMigrationWorkflowTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->migrationWorkflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new DeleteMigrationWorkflowRequest()) + ->setName($formattedName); + $gapicClient->deleteMigrationWorkflow($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.migration.v2.MigrationService/DeleteMigrationWorkflow', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteMigrationWorkflowExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->migrationWorkflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new DeleteMigrationWorkflowRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteMigrationWorkflow($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMigrationSubtaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $taskId = 'taskId-1537240555'; + $type = 'type3575610'; + $resourceErrorCount = 929997465; + $expectedResponse = new MigrationSubtask(); + $expectedResponse->setName($name2); + $expectedResponse->setTaskId($taskId); + $expectedResponse->setType($type); + $expectedResponse->setResourceErrorCount($resourceErrorCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->migrationSubtaskName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[SUBTASK]'); + $request = (new GetMigrationSubtaskRequest()) + ->setName($formattedName); + $response = $gapicClient->getMigrationSubtask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.migration.v2.MigrationService/GetMigrationSubtask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMigrationSubtaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->migrationSubtaskName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[SUBTASK]'); + $request = (new GetMigrationSubtaskRequest()) + ->setName($formattedName); + try { + $gapicClient->getMigrationSubtask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMigrationWorkflowTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new MigrationWorkflow(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->migrationWorkflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new GetMigrationWorkflowRequest()) + ->setName($formattedName); + $response = $gapicClient->getMigrationWorkflow($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.migration.v2.MigrationService/GetMigrationWorkflow', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMigrationWorkflowExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->migrationWorkflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new GetMigrationWorkflowRequest()) + ->setName($formattedName); + try { + $gapicClient->getMigrationWorkflow($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMigrationSubtasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $migrationSubtasksElement = new MigrationSubtask(); + $migrationSubtasks = [ + $migrationSubtasksElement, + ]; + $expectedResponse = new ListMigrationSubtasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMigrationSubtasks($migrationSubtasks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->migrationWorkflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new ListMigrationSubtasksRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listMigrationSubtasks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMigrationSubtasks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.migration.v2.MigrationService/ListMigrationSubtasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMigrationSubtasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->migrationWorkflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new ListMigrationSubtasksRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listMigrationSubtasks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMigrationWorkflowsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $migrationWorkflowsElement = new MigrationWorkflow(); + $migrationWorkflows = [ + $migrationWorkflowsElement, + ]; + $expectedResponse = new ListMigrationWorkflowsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMigrationWorkflows($migrationWorkflows); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListMigrationWorkflowsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listMigrationWorkflows($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMigrationWorkflows()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.migration.v2.MigrationService/ListMigrationWorkflows', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMigrationWorkflowsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListMigrationWorkflowsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listMigrationWorkflows($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function startMigrationWorkflowTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->migrationWorkflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new StartMigrationWorkflowRequest()) + ->setName($formattedName); + $gapicClient->startMigrationWorkflow($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.migration.v2.MigrationService/StartMigrationWorkflow', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function startMigrationWorkflowExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->migrationWorkflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new StartMigrationWorkflowRequest()) + ->setName($formattedName); + try { + $gapicClient->startMigrationWorkflow($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createMigrationWorkflowAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new MigrationWorkflow(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $migrationWorkflow = new MigrationWorkflow(); + $request = (new CreateMigrationWorkflowRequest()) + ->setParent($formattedParent) + ->setMigrationWorkflow($migrationWorkflow); + $response = $gapicClient->createMigrationWorkflowAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.migration.v2.MigrationService/CreateMigrationWorkflow', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getMigrationWorkflow(); + $this->assertProtobufEquals($migrationWorkflow, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Reservation/V1/Reservation.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Reservation/V1/Reservation.php new file mode 100644 index 000000000000..da3d227a9f02 Binary files /dev/null and b/owl-bot-staging/BigQueryReservation/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Reservation/V1/Reservation.php differ diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Assignment.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Assignment.php new file mode 100644 index 000000000000..041fc0363a57 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Assignment.php @@ -0,0 +1,186 @@ +google.cloud.bigquery.reservation.v1.Assignment + */ +class Assignment extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the resource. E.g.: + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. + * The assignment_id must only contain lower case alphanumeric characters or + * dashes and the max length is 64 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * The resource which will use the reservation. E.g. + * `projects/myproject`, `folders/123`, or `organizations/456`. + * + * Generated from protobuf field string assignee = 4; + */ + protected $assignee = ''; + /** + * Which type of jobs will use the reservation. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + */ + protected $job_type = 0; + /** + * Output only. State of the assignment. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Name of the resource. E.g.: + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. + * The assignment_id must only contain lower case alphanumeric characters or + * dashes and the max length is 64 characters. + * @type string $assignee + * The resource which will use the reservation. E.g. + * `projects/myproject`, `folders/123`, or `organizations/456`. + * @type int $job_type + * Which type of jobs will use the reservation. + * @type int $state + * Output only. State of the assignment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the resource. E.g.: + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. + * The assignment_id must only contain lower case alphanumeric characters or + * dashes and the max length is 64 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Name of the resource. E.g.: + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. + * The assignment_id must only contain lower case alphanumeric characters or + * dashes and the max length is 64 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The resource which will use the reservation. E.g. + * `projects/myproject`, `folders/123`, or `organizations/456`. + * + * Generated from protobuf field string assignee = 4; + * @return string + */ + public function getAssignee() + { + return $this->assignee; + } + + /** + * The resource which will use the reservation. E.g. + * `projects/myproject`, `folders/123`, or `organizations/456`. + * + * Generated from protobuf field string assignee = 4; + * @param string $var + * @return $this + */ + public function setAssignee($var) + { + GPBUtil::checkString($var, True); + $this->assignee = $var; + + return $this; + } + + /** + * Which type of jobs will use the reservation. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + * @return int + */ + public function getJobType() + { + return $this->job_type; + } + + /** + * Which type of jobs will use the reservation. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + * @param int $var + * @return $this + */ + public function setJobType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Reservation\V1\Assignment\JobType::class); + $this->job_type = $var; + + return $this; + } + + /** + * Output only. State of the assignment. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the assignment. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Reservation\V1\Assignment\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Assignment/JobType.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Assignment/JobType.php new file mode 100644 index 000000000000..27d2d076d829 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Assignment/JobType.php @@ -0,0 +1,80 @@ +google.cloud.bigquery.reservation.v1.Assignment.JobType + */ +class JobType +{ + /** + * Invalid type. Requests with this value will be rejected with + * error code `google.rpc.Code.INVALID_ARGUMENT`. + * + * Generated from protobuf enum JOB_TYPE_UNSPECIFIED = 0; + */ + const JOB_TYPE_UNSPECIFIED = 0; + /** + * Pipeline (load/export) jobs from the project will use the reservation. + * + * Generated from protobuf enum PIPELINE = 1; + */ + const PIPELINE = 1; + /** + * Query jobs from the project will use the reservation. + * + * Generated from protobuf enum QUERY = 2; + */ + const QUERY = 2; + /** + * BigQuery ML jobs that use services external to BigQuery for model + * training. These jobs will not utilize idle slots from other reservations. + * + * Generated from protobuf enum ML_EXTERNAL = 3; + */ + const ML_EXTERNAL = 3; + /** + * Background jobs that BigQuery runs for the customers in the background. + * + * Generated from protobuf enum BACKGROUND = 4; + */ + const BACKGROUND = 4; + + private static $valueToName = [ + self::JOB_TYPE_UNSPECIFIED => 'JOB_TYPE_UNSPECIFIED', + self::PIPELINE => 'PIPELINE', + self::QUERY => 'QUERY', + self::ML_EXTERNAL => 'ML_EXTERNAL', + self::BACKGROUND => 'BACKGROUND', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(JobType::class, \Google\Cloud\BigQuery\Reservation\V1\Assignment_JobType::class); + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Assignment/State.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Assignment/State.php new file mode 100644 index 000000000000..434bfa37de78 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Assignment/State.php @@ -0,0 +1,67 @@ +google.cloud.bigquery.reservation.v1.Assignment.State + */ +class State +{ + /** + * Invalid state value. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Queries from assignee will be executed as on-demand, if related + * assignment is pending. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * Assignment is ready. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::ACTIVE => 'ACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BigQuery\Reservation\V1\Assignment_State::class); + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/BiReservation.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/BiReservation.php new file mode 100644 index 000000000000..65b19149239a --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/BiReservation.php @@ -0,0 +1,187 @@ +google.cloud.bigquery.reservation.v1.BiReservation + */ +class BiReservation extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the singleton BI reservation. + * Reservation names have the form + * `projects/{project_id}/locations/{location_id}/biReservation`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The last update timestamp of a reservation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Size of a reservation, in bytes. + * + * Generated from protobuf field int64 size = 4; + */ + protected $size = 0; + /** + * Preferred tables to use BI capacity for. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.TableReference preferred_tables = 5; + */ + private $preferred_tables; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the singleton BI reservation. + * Reservation names have the form + * `projects/{project_id}/locations/{location_id}/biReservation`. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last update timestamp of a reservation. + * @type int|string $size + * Size of a reservation, in bytes. + * @type array<\Google\Cloud\BigQuery\Reservation\V1\TableReference>|\Google\Protobuf\Internal\RepeatedField $preferred_tables + * Preferred tables to use BI capacity for. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the singleton BI reservation. + * Reservation names have the form + * `projects/{project_id}/locations/{location_id}/biReservation`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the singleton BI reservation. + * Reservation names have the form + * `projects/{project_id}/locations/{location_id}/biReservation`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The last update timestamp of a reservation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last update timestamp of a reservation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Size of a reservation, in bytes. + * + * Generated from protobuf field int64 size = 4; + * @return int|string + */ + public function getSize() + { + return $this->size; + } + + /** + * Size of a reservation, in bytes. + * + * Generated from protobuf field int64 size = 4; + * @param int|string $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkInt64($var); + $this->size = $var; + + return $this; + } + + /** + * Preferred tables to use BI capacity for. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.TableReference preferred_tables = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPreferredTables() + { + return $this->preferred_tables; + } + + /** + * Preferred tables to use BI capacity for. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.TableReference preferred_tables = 5; + * @param array<\Google\Cloud\BigQuery\Reservation\V1\TableReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPreferredTables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Reservation\V1\TableReference::class); + $this->preferred_tables = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CapacityCommitment.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CapacityCommitment.php new file mode 100644 index 000000000000..2272af235134 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CapacityCommitment.php @@ -0,0 +1,524 @@ +google.cloud.bigquery.reservation.v1.CapacityCommitment + */ +class CapacityCommitment extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the capacity commitment, e.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * The commitment_id must only contain lower case alphanumeric characters or + * dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Number of slots in this commitment. + * + * Generated from protobuf field int64 slot_count = 2; + */ + protected $slot_count = 0; + /** + * Capacity commitment commitment plan. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + */ + protected $plan = 0; + /** + * Output only. State of the commitment. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The start of the current commitment period. It is applicable + * only for ACTIVE capacity commitments. Note after the commitment is renewed, + * commitment_start_time won't be changed. It refers to the start time of the + * original commitment. + * + * Generated from protobuf field .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $commitment_start_time = null; + /** + * Output only. The end of the current commitment period. It is applicable + * only for ACTIVE capacity commitments. Note after renewal, + * commitment_end_time is the time the renewed commitment expires. So it would + * be at a time after commitment_start_time + committed period, because we + * don't change commitment_start_time , + * + * Generated from protobuf field .google.protobuf.Timestamp commitment_end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $commitment_end_time = null; + /** + * Output only. For FAILED commitment plan, provides the reason of failure. + * + * Generated from protobuf field .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $failure_status = null; + /** + * The plan this capacity commitment is converted to after commitment_end_time + * passes. Once the plan is changed, committed period is extended according to + * commitment plan. Only applicable for ANNUAL and TRIAL commitments. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + */ + protected $renewal_plan = 0; + /** + * Applicable only for commitments located within one of the BigQuery + * multi-regions (US or EU). + * If set to true, this commitment is placed in the organization's + * secondary region which is designated for disaster recovery purposes. + * If false, this commitment is placed in the organization's default region. + * NOTE: this is a preview feature. Project must be allow-listed in order to + * set this field. + * + * Generated from protobuf field bool multi_region_auxiliary = 10; + */ + protected $multi_region_auxiliary = false; + /** + * Edition of the capacity commitment. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Edition edition = 12; + */ + protected $edition = 0; + /** + * Output only. If true, the commitment is a flat-rate commitment, otherwise, + * it's an edition commitment. + * + * Generated from protobuf field bool is_flat_rate = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $is_flat_rate = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the capacity commitment, e.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * The commitment_id must only contain lower case alphanumeric characters or + * dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. + * @type int|string $slot_count + * Number of slots in this commitment. + * @type int $plan + * Capacity commitment commitment plan. + * @type int $state + * Output only. State of the commitment. + * @type \Google\Protobuf\Timestamp $commitment_start_time + * Output only. The start of the current commitment period. It is applicable + * only for ACTIVE capacity commitments. Note after the commitment is renewed, + * commitment_start_time won't be changed. It refers to the start time of the + * original commitment. + * @type \Google\Protobuf\Timestamp $commitment_end_time + * Output only. The end of the current commitment period. It is applicable + * only for ACTIVE capacity commitments. Note after renewal, + * commitment_end_time is the time the renewed commitment expires. So it would + * be at a time after commitment_start_time + committed period, because we + * don't change commitment_start_time , + * @type \Google\Rpc\Status $failure_status + * Output only. For FAILED commitment plan, provides the reason of failure. + * @type int $renewal_plan + * The plan this capacity commitment is converted to after commitment_end_time + * passes. Once the plan is changed, committed period is extended according to + * commitment plan. Only applicable for ANNUAL and TRIAL commitments. + * @type bool $multi_region_auxiliary + * Applicable only for commitments located within one of the BigQuery + * multi-regions (US or EU). + * If set to true, this commitment is placed in the organization's + * secondary region which is designated for disaster recovery purposes. + * If false, this commitment is placed in the organization's default region. + * NOTE: this is a preview feature. Project must be allow-listed in order to + * set this field. + * @type int $edition + * Edition of the capacity commitment. + * @type bool $is_flat_rate + * Output only. If true, the commitment is a flat-rate commitment, otherwise, + * it's an edition commitment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the capacity commitment, e.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * The commitment_id must only contain lower case alphanumeric characters or + * dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the capacity commitment, e.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * The commitment_id must only contain lower case alphanumeric characters or + * dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Number of slots in this commitment. + * + * Generated from protobuf field int64 slot_count = 2; + * @return int|string + */ + public function getSlotCount() + { + return $this->slot_count; + } + + /** + * Number of slots in this commitment. + * + * Generated from protobuf field int64 slot_count = 2; + * @param int|string $var + * @return $this + */ + public function setSlotCount($var) + { + GPBUtil::checkInt64($var); + $this->slot_count = $var; + + return $this; + } + + /** + * Capacity commitment commitment plan. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + * @return int + */ + public function getPlan() + { + return $this->plan; + } + + /** + * Capacity commitment commitment plan. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + * @param int $var + * @return $this + */ + public function setPlan($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment\CommitmentPlan::class); + $this->plan = $var; + + return $this; + } + + /** + * Output only. State of the commitment. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the commitment. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The start of the current commitment period. It is applicable + * only for ACTIVE capacity commitments. Note after the commitment is renewed, + * commitment_start_time won't be changed. It refers to the start time of the + * original commitment. + * + * Generated from protobuf field .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCommitmentStartTime() + { + return $this->commitment_start_time; + } + + public function hasCommitmentStartTime() + { + return isset($this->commitment_start_time); + } + + public function clearCommitmentStartTime() + { + unset($this->commitment_start_time); + } + + /** + * Output only. The start of the current commitment period. It is applicable + * only for ACTIVE capacity commitments. Note after the commitment is renewed, + * commitment_start_time won't be changed. It refers to the start time of the + * original commitment. + * + * Generated from protobuf field .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCommitmentStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->commitment_start_time = $var; + + return $this; + } + + /** + * Output only. The end of the current commitment period. It is applicable + * only for ACTIVE capacity commitments. Note after renewal, + * commitment_end_time is the time the renewed commitment expires. So it would + * be at a time after commitment_start_time + committed period, because we + * don't change commitment_start_time , + * + * Generated from protobuf field .google.protobuf.Timestamp commitment_end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCommitmentEndTime() + { + return $this->commitment_end_time; + } + + public function hasCommitmentEndTime() + { + return isset($this->commitment_end_time); + } + + public function clearCommitmentEndTime() + { + unset($this->commitment_end_time); + } + + /** + * Output only. The end of the current commitment period. It is applicable + * only for ACTIVE capacity commitments. Note after renewal, + * commitment_end_time is the time the renewed commitment expires. So it would + * be at a time after commitment_start_time + committed period, because we + * don't change commitment_start_time , + * + * Generated from protobuf field .google.protobuf.Timestamp commitment_end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCommitmentEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->commitment_end_time = $var; + + return $this; + } + + /** + * Output only. For FAILED commitment plan, provides the reason of failure. + * + * Generated from protobuf field .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getFailureStatus() + { + return $this->failure_status; + } + + public function hasFailureStatus() + { + return isset($this->failure_status); + } + + public function clearFailureStatus() + { + unset($this->failure_status); + } + + /** + * Output only. For FAILED commitment plan, provides the reason of failure. + * + * Generated from protobuf field .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setFailureStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->failure_status = $var; + + return $this; + } + + /** + * The plan this capacity commitment is converted to after commitment_end_time + * passes. Once the plan is changed, committed period is extended according to + * commitment plan. Only applicable for ANNUAL and TRIAL commitments. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + * @return int + */ + public function getRenewalPlan() + { + return $this->renewal_plan; + } + + /** + * The plan this capacity commitment is converted to after commitment_end_time + * passes. Once the plan is changed, committed period is extended according to + * commitment plan. Only applicable for ANNUAL and TRIAL commitments. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + * @param int $var + * @return $this + */ + public function setRenewalPlan($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment\CommitmentPlan::class); + $this->renewal_plan = $var; + + return $this; + } + + /** + * Applicable only for commitments located within one of the BigQuery + * multi-regions (US or EU). + * If set to true, this commitment is placed in the organization's + * secondary region which is designated for disaster recovery purposes. + * If false, this commitment is placed in the organization's default region. + * NOTE: this is a preview feature. Project must be allow-listed in order to + * set this field. + * + * Generated from protobuf field bool multi_region_auxiliary = 10; + * @return bool + */ + public function getMultiRegionAuxiliary() + { + return $this->multi_region_auxiliary; + } + + /** + * Applicable only for commitments located within one of the BigQuery + * multi-regions (US or EU). + * If set to true, this commitment is placed in the organization's + * secondary region which is designated for disaster recovery purposes. + * If false, this commitment is placed in the organization's default region. + * NOTE: this is a preview feature. Project must be allow-listed in order to + * set this field. + * + * Generated from protobuf field bool multi_region_auxiliary = 10; + * @param bool $var + * @return $this + */ + public function setMultiRegionAuxiliary($var) + { + GPBUtil::checkBool($var); + $this->multi_region_auxiliary = $var; + + return $this; + } + + /** + * Edition of the capacity commitment. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Edition edition = 12; + * @return int + */ + public function getEdition() + { + return $this->edition; + } + + /** + * Edition of the capacity commitment. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Edition edition = 12; + * @param int $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Reservation\V1\Edition::class); + $this->edition = $var; + + return $this; + } + + /** + * Output only. If true, the commitment is a flat-rate commitment, otherwise, + * it's an edition commitment. + * + * Generated from protobuf field bool is_flat_rate = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getIsFlatRate() + { + return $this->is_flat_rate; + } + + /** + * Output only. If true, the commitment is a flat-rate commitment, otherwise, + * it's an edition commitment. + * + * Generated from protobuf field bool is_flat_rate = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setIsFlatRate($var) + { + GPBUtil::checkBool($var); + $this->is_flat_rate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CapacityCommitment/CommitmentPlan.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CapacityCommitment/CommitmentPlan.php new file mode 100644 index 000000000000..ca06b22c35ac --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CapacityCommitment/CommitmentPlan.php @@ -0,0 +1,134 @@ +google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan + */ +class CommitmentPlan +{ + /** + * Invalid plan value. Requests with this value will be rejected with + * error code `google.rpc.Code.INVALID_ARGUMENT`. + * + * Generated from protobuf enum COMMITMENT_PLAN_UNSPECIFIED = 0; + */ + const COMMITMENT_PLAN_UNSPECIFIED = 0; + /** + * Flex commitments have committed period of 1 minute after becoming ACTIVE. + * After that, they are not in a committed period anymore and can be removed + * any time. + * + * Generated from protobuf enum FLEX = 3; + */ + const FLEX = 3; + /** + * Same as FLEX, should only be used if flat-rate commitments are still + * available. + * + * Generated from protobuf enum FLEX_FLAT_RATE = 7 [deprecated = true]; + */ + const FLEX_FLAT_RATE = 7; + /** + * Trial commitments have a committed period of 182 days after becoming + * ACTIVE. After that, they are converted to a new commitment based on the + * `renewal_plan`. Default `renewal_plan` for Trial commitment is Flex so + * that it can be deleted right after committed period ends. + * + * Generated from protobuf enum TRIAL = 5 [deprecated = true]; + */ + const TRIAL = 5; + /** + * Monthly commitments have a committed period of 30 days after becoming + * ACTIVE. After that, they are not in a committed period anymore and can be + * removed any time. + * + * Generated from protobuf enum MONTHLY = 2; + */ + const MONTHLY = 2; + /** + * Same as MONTHLY, should only be used if flat-rate commitments are still + * available. + * + * Generated from protobuf enum MONTHLY_FLAT_RATE = 8 [deprecated = true]; + */ + const MONTHLY_FLAT_RATE = 8; + /** + * Annual commitments have a committed period of 365 days after becoming + * ACTIVE. After that they are converted to a new commitment based on the + * renewal_plan. + * + * Generated from protobuf enum ANNUAL = 4; + */ + const ANNUAL = 4; + /** + * Same as ANNUAL, should only be used if flat-rate commitments are still + * available. + * + * Generated from protobuf enum ANNUAL_FLAT_RATE = 9 [deprecated = true]; + */ + const ANNUAL_FLAT_RATE = 9; + /** + * 3-year commitments have a committed period of 1095(3 * 365) days after + * becoming ACTIVE. After that they are converted to a new commitment based + * on the renewal_plan. + * + * Generated from protobuf enum THREE_YEAR = 10; + */ + const THREE_YEAR = 10; + /** + * Should only be used for `renewal_plan` and is only meaningful if + * edition is specified to values other than EDITION_UNSPECIFIED. Otherwise + * CreateCapacityCommitmentRequest or UpdateCapacityCommitmentRequest will + * be rejected with error code `google.rpc.Code.INVALID_ARGUMENT`. If the + * renewal_plan is NONE, capacity commitment will be removed at the end of + * its commitment period. + * + * Generated from protobuf enum NONE = 6; + */ + const NONE = 6; + + private static $valueToName = [ + self::COMMITMENT_PLAN_UNSPECIFIED => 'COMMITMENT_PLAN_UNSPECIFIED', + self::FLEX => 'FLEX', + self::FLEX_FLAT_RATE => 'FLEX_FLAT_RATE', + self::TRIAL => 'TRIAL', + self::MONTHLY => 'MONTHLY', + self::MONTHLY_FLAT_RATE => 'MONTHLY_FLAT_RATE', + self::ANNUAL => 'ANNUAL', + self::ANNUAL_FLAT_RATE => 'ANNUAL_FLAT_RATE', + self::THREE_YEAR => 'THREE_YEAR', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CommitmentPlan::class, \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment_CommitmentPlan::class); + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CapacityCommitment/State.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CapacityCommitment/State.php new file mode 100644 index 000000000000..7ca01cf2c1b3 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CapacityCommitment/State.php @@ -0,0 +1,74 @@ +google.cloud.bigquery.reservation.v1.CapacityCommitment.State + */ +class State +{ + /** + * Invalid state value. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Capacity commitment is pending provisioning. Pending capacity commitment + * does not contribute to the project's slot_capacity. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * Once slots are provisioned, capacity commitment becomes active. + * slot_count is added to the project's slot_capacity. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * Capacity commitment is failed to be activated by the backend. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::ACTIVE => 'ACTIVE', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment_State::class); + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CreateAssignmentRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CreateAssignmentRequest.php new file mode 100644 index 000000000000..3dbab04fdca5 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CreateAssignmentRequest.php @@ -0,0 +1,181 @@ +google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + */ +class CreateAssignmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource name of the assignment + * E.g. `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Assignment resource to create. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + */ + protected $assignment = null; + /** + * The optional assignment ID. Assignment name will be generated automatically + * if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * Max length is 64 characters. + * + * Generated from protobuf field string assignment_id = 4; + */ + protected $assignment_id = ''; + + /** + * @param string $parent Required. The parent resource name of the assignment + * E.g. `projects/myproject/locations/US/reservations/team1-prod` + * Please see {@see ReservationServiceClient::reservationName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\Reservation\V1\Assignment $assignment Assignment resource to create. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\CreateAssignmentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\Reservation\V1\Assignment $assignment): self + { + return (new self()) + ->setParent($parent) + ->setAssignment($assignment); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource name of the assignment + * E.g. `projects/myproject/locations/US/reservations/team1-prod` + * @type \Google\Cloud\BigQuery\Reservation\V1\Assignment $assignment + * Assignment resource to create. + * @type string $assignment_id + * The optional assignment ID. Assignment name will be generated automatically + * if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * Max length is 64 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource name of the assignment + * E.g. `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource name of the assignment + * E.g. `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Assignment resource to create. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + * @return \Google\Cloud\BigQuery\Reservation\V1\Assignment|null + */ + public function getAssignment() + { + return $this->assignment; + } + + public function hasAssignment() + { + return isset($this->assignment); + } + + public function clearAssignment() + { + unset($this->assignment); + } + + /** + * Assignment resource to create. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + * @param \Google\Cloud\BigQuery\Reservation\V1\Assignment $var + * @return $this + */ + public function setAssignment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Reservation\V1\Assignment::class); + $this->assignment = $var; + + return $this; + } + + /** + * The optional assignment ID. Assignment name will be generated automatically + * if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * Max length is 64 characters. + * + * Generated from protobuf field string assignment_id = 4; + * @return string + */ + public function getAssignmentId() + { + return $this->assignment_id; + } + + /** + * The optional assignment ID. Assignment name will be generated automatically + * if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * Max length is 64 characters. + * + * Generated from protobuf field string assignment_id = 4; + * @param string $var + * @return $this + */ + public function setAssignmentId($var) + { + GPBUtil::checkString($var, True); + $this->assignment_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CreateCapacityCommitmentRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CreateCapacityCommitmentRequest.php new file mode 100644 index 000000000000..9329e35d14d5 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CreateCapacityCommitmentRequest.php @@ -0,0 +1,221 @@ +google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + */ +class CreateCapacityCommitmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Content of the capacity commitment to create. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 2; + */ + protected $capacity_commitment = null; + /** + * If true, fail the request if another project in the organization has a + * capacity commitment. + * + * Generated from protobuf field bool enforce_single_admin_project_per_org = 4; + */ + protected $enforce_single_admin_project_per_org = false; + /** + * The optional capacity commitment ID. Capacity commitment name will be + * generated automatically if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * The first and last character cannot be a dash. Max length is 64 characters. + * NOTE: this ID won't be kept if the capacity commitment is split or merged. + * + * Generated from protobuf field string capacity_commitment_id = 5; + */ + protected $capacity_commitment_id = ''; + + /** + * @param string $parent Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * Please see {@see ReservationServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $capacityCommitment Content of the capacity commitment to create. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\CreateCapacityCommitmentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $capacityCommitment): self + { + return (new self()) + ->setParent($parent) + ->setCapacityCommitment($capacityCommitment); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @type \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $capacity_commitment + * Content of the capacity commitment to create. + * @type bool $enforce_single_admin_project_per_org + * If true, fail the request if another project in the organization has a + * capacity commitment. + * @type string $capacity_commitment_id + * The optional capacity commitment ID. Capacity commitment name will be + * generated automatically if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * The first and last character cannot be a dash. Max length is 64 characters. + * NOTE: this ID won't be kept if the capacity commitment is split or merged. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Content of the capacity commitment to create. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 2; + * @return \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment|null + */ + public function getCapacityCommitment() + { + return $this->capacity_commitment; + } + + public function hasCapacityCommitment() + { + return isset($this->capacity_commitment); + } + + public function clearCapacityCommitment() + { + unset($this->capacity_commitment); + } + + /** + * Content of the capacity commitment to create. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 2; + * @param \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $var + * @return $this + */ + public function setCapacityCommitment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment::class); + $this->capacity_commitment = $var; + + return $this; + } + + /** + * If true, fail the request if another project in the organization has a + * capacity commitment. + * + * Generated from protobuf field bool enforce_single_admin_project_per_org = 4; + * @return bool + */ + public function getEnforceSingleAdminProjectPerOrg() + { + return $this->enforce_single_admin_project_per_org; + } + + /** + * If true, fail the request if another project in the organization has a + * capacity commitment. + * + * Generated from protobuf field bool enforce_single_admin_project_per_org = 4; + * @param bool $var + * @return $this + */ + public function setEnforceSingleAdminProjectPerOrg($var) + { + GPBUtil::checkBool($var); + $this->enforce_single_admin_project_per_org = $var; + + return $this; + } + + /** + * The optional capacity commitment ID. Capacity commitment name will be + * generated automatically if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * The first and last character cannot be a dash. Max length is 64 characters. + * NOTE: this ID won't be kept if the capacity commitment is split or merged. + * + * Generated from protobuf field string capacity_commitment_id = 5; + * @return string + */ + public function getCapacityCommitmentId() + { + return $this->capacity_commitment_id; + } + + /** + * The optional capacity commitment ID. Capacity commitment name will be + * generated automatically if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * The first and last character cannot be a dash. Max length is 64 characters. + * NOTE: this ID won't be kept if the capacity commitment is split or merged. + * + * Generated from protobuf field string capacity_commitment_id = 5; + * @param string $var + * @return $this + */ + public function setCapacityCommitmentId($var) + { + GPBUtil::checkString($var, True); + $this->capacity_commitment_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CreateReservationRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CreateReservationRequest.php new file mode 100644 index 000000000000..ade4f1d52ee1 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/CreateReservationRequest.php @@ -0,0 +1,179 @@ +google.cloud.bigquery.reservation.v1.CreateReservationRequest + */ +class CreateReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Project, location. E.g., + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The reservation ID. It must only contain lower case alphanumeric + * characters or dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. + * + * Generated from protobuf field string reservation_id = 2; + */ + protected $reservation_id = ''; + /** + * Definition of the new reservation to create. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + */ + protected $reservation = null; + + /** + * @param string $parent Required. Project, location. E.g., + * `projects/myproject/locations/US` + * Please see {@see ReservationServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\Reservation\V1\Reservation $reservation Definition of the new reservation to create. + * @param string $reservationId The reservation ID. It must only contain lower case alphanumeric + * characters or dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\CreateReservationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\Reservation\V1\Reservation $reservation, string $reservationId): self + { + return (new self()) + ->setParent($parent) + ->setReservation($reservation) + ->setReservationId($reservationId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Project, location. E.g., + * `projects/myproject/locations/US` + * @type string $reservation_id + * The reservation ID. It must only contain lower case alphanumeric + * characters or dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. + * @type \Google\Cloud\BigQuery\Reservation\V1\Reservation $reservation + * Definition of the new reservation to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Project, location. E.g., + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Project, location. E.g., + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The reservation ID. It must only contain lower case alphanumeric + * characters or dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. + * + * Generated from protobuf field string reservation_id = 2; + * @return string + */ + public function getReservationId() + { + return $this->reservation_id; + } + + /** + * The reservation ID. It must only contain lower case alphanumeric + * characters or dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. + * + * Generated from protobuf field string reservation_id = 2; + * @param string $var + * @return $this + */ + public function setReservationId($var) + { + GPBUtil::checkString($var, True); + $this->reservation_id = $var; + + return $this; + } + + /** + * Definition of the new reservation to create. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + * @return \Google\Cloud\BigQuery\Reservation\V1\Reservation|null + */ + public function getReservation() + { + return $this->reservation; + } + + public function hasReservation() + { + return isset($this->reservation); + } + + public function clearReservation() + { + unset($this->reservation); + } + + /** + * Definition of the new reservation to create. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + * @param \Google\Cloud\BigQuery\Reservation\V1\Reservation $var + * @return $this + */ + public function setReservation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Reservation\V1\Reservation::class); + $this->reservation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/DeleteAssignmentRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/DeleteAssignmentRequest.php new file mode 100644 index 000000000000..3f39a0587e8e --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/DeleteAssignmentRequest.php @@ -0,0 +1,89 @@ +google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + */ +class DeleteAssignmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource, e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource, e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * Please see {@see ReservationServiceClient::assignmentName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\DeleteAssignmentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource, e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource, e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource, e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/DeleteCapacityCommitmentRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/DeleteCapacityCommitmentRequest.php new file mode 100644 index 000000000000..dc012790ec91 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/DeleteCapacityCommitmentRequest.php @@ -0,0 +1,129 @@ +google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + */ +class DeleteCapacityCommitmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the capacity commitment to delete. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Can be used to force delete commitments even if assignments exist. Deleting + * commitments with assignments may cause queries to fail if they no longer + * have access to slots. + * + * Generated from protobuf field bool force = 3; + */ + protected $force = false; + + /** + * @param string $name Required. Resource name of the capacity commitment to delete. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * Please see {@see ReservationServiceClient::capacityCommitmentName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\DeleteCapacityCommitmentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the capacity commitment to delete. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * @type bool $force + * Can be used to force delete commitments even if assignments exist. Deleting + * commitments with assignments may cause queries to fail if they no longer + * have access to slots. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the capacity commitment to delete. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the capacity commitment to delete. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Can be used to force delete commitments even if assignments exist. Deleting + * commitments with assignments may cause queries to fail if they no longer + * have access to slots. + * + * Generated from protobuf field bool force = 3; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Can be used to force delete commitments even if assignments exist. Deleting + * commitments with assignments may cause queries to fail if they no longer + * have access to slots. + * + * Generated from protobuf field bool force = 3; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/DeleteReservationRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/DeleteReservationRequest.php new file mode 100644 index 000000000000..745b2051ee75 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/DeleteReservationRequest.php @@ -0,0 +1,87 @@ +google.cloud.bigquery.reservation.v1.DeleteReservationRequest + */ +class DeleteReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * Please see {@see ReservationServiceClient::reservationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\DeleteReservationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Edition.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Edition.php new file mode 100644 index 000000000000..aeb6f5a1d84e --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Edition.php @@ -0,0 +1,70 @@ +google.cloud.bigquery.reservation.v1.Edition + */ +class Edition +{ + /** + * Default value, which will be treated as ENTERPRISE. + * + * Generated from protobuf enum EDITION_UNSPECIFIED = 0; + */ + const EDITION_UNSPECIFIED = 0; + /** + * Standard edition. + * + * Generated from protobuf enum STANDARD = 1; + */ + const STANDARD = 1; + /** + * Enterprise edition. + * + * Generated from protobuf enum ENTERPRISE = 2; + */ + const ENTERPRISE = 2; + /** + * Enterprise Plus edition. + * + * Generated from protobuf enum ENTERPRISE_PLUS = 3; + */ + const ENTERPRISE_PLUS = 3; + + private static $valueToName = [ + self::EDITION_UNSPECIFIED => 'EDITION_UNSPECIFIED', + self::STANDARD => 'STANDARD', + self::ENTERPRISE => 'ENTERPRISE', + self::ENTERPRISE_PLUS => 'ENTERPRISE_PLUS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/FailoverReservationRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/FailoverReservationRequest.php new file mode 100644 index 000000000000..e3e4d9d68cb5 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/FailoverReservationRequest.php @@ -0,0 +1,71 @@ +google.cloud.bigquery.reservation.v1.FailoverReservationRequest + */ +class FailoverReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the reservation to failover. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the reservation to failover. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the reservation to failover. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the reservation to failover. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/GetBiReservationRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/GetBiReservationRequest.php new file mode 100644 index 000000000000..2c7408d233fc --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/GetBiReservationRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.reservation.v1.GetBiReservationRequest + */ +class GetBiReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the requested reservation, for example: + * `projects/{project_id}/locations/{location_id}/biReservation` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the requested reservation, for example: + * `projects/{project_id}/locations/{location_id}/biReservation` + * Please see {@see ReservationServiceClient::biReservationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\GetBiReservationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the requested reservation, for example: + * `projects/{project_id}/locations/{location_id}/biReservation` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the requested reservation, for example: + * `projects/{project_id}/locations/{location_id}/biReservation` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the requested reservation, for example: + * `projects/{project_id}/locations/{location_id}/biReservation` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/GetCapacityCommitmentRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/GetCapacityCommitmentRequest.php new file mode 100644 index 000000000000..785336d7ba0b --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/GetCapacityCommitmentRequest.php @@ -0,0 +1,87 @@ +google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + */ +class GetCapacityCommitmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the capacity commitment to retrieve. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the capacity commitment to retrieve. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * Please see {@see ReservationServiceClient::capacityCommitmentName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\GetCapacityCommitmentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the capacity commitment to retrieve. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the capacity commitment to retrieve. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the capacity commitment to retrieve. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/GetReservationRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/GetReservationRequest.php new file mode 100644 index 000000000000..0b048b21d39d --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/GetReservationRequest.php @@ -0,0 +1,87 @@ +google.cloud.bigquery.reservation.v1.GetReservationRequest + */ +class GetReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * Please see {@see ReservationServiceClient::reservationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\GetReservationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListAssignmentsRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListAssignmentsRequest.php new file mode 100644 index 000000000000..821a46e9140e --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListAssignmentsRequest.php @@ -0,0 +1,168 @@ +google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + */ +class ListAssignmentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource name e.g.: + * `projects/myproject/locations/US/reservations/team1-prod` + * Or: + * `projects/myproject/locations/US/reservations/-` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent resource name e.g.: + * + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Or: + * + * `projects/myproject/locations/US/reservations/-` + * Please see {@see ReservationServiceClient::reservationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\ListAssignmentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource name e.g.: + * `projects/myproject/locations/US/reservations/team1-prod` + * Or: + * `projects/myproject/locations/US/reservations/-` + * @type int $page_size + * The maximum number of items to return per page. + * @type string $page_token + * The next_page_token value returned from a previous List request, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource name e.g.: + * `projects/myproject/locations/US/reservations/team1-prod` + * Or: + * `projects/myproject/locations/US/reservations/-` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource name e.g.: + * `projects/myproject/locations/US/reservations/team1-prod` + * Or: + * `projects/myproject/locations/US/reservations/-` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListAssignmentsResponse.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListAssignmentsResponse.php new file mode 100644 index 000000000000..86846c01f893 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListAssignmentsResponse.php @@ -0,0 +1,106 @@ +google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + */ +class ListAssignmentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of assignments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + private $assignments; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\Reservation\V1\Assignment>|\Google\Protobuf\Internal\RepeatedField $assignments + * List of assignments visible to the user. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * List of assignments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssignments() + { + return $this->assignments; + } + + /** + * List of assignments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + * @param array<\Google\Cloud\BigQuery\Reservation\V1\Assignment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssignments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Reservation\V1\Assignment::class); + $this->assignments = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListCapacityCommitmentsRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListCapacityCommitmentsRequest.php new file mode 100644 index 000000000000..74d24a845b98 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListCapacityCommitmentsRequest.php @@ -0,0 +1,155 @@ +google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + */ +class ListCapacityCommitmentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * Please see {@see ReservationServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\ListCapacityCommitmentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @type int $page_size + * The maximum number of items to return. + * @type string $page_token + * The next_page_token value returned from a previous List request, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListCapacityCommitmentsResponse.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListCapacityCommitmentsResponse.php new file mode 100644 index 000000000000..3775a9f7af41 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListCapacityCommitmentsResponse.php @@ -0,0 +1,106 @@ +google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + */ +class ListCapacityCommitmentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of capacity commitments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + */ + private $capacity_commitments; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment>|\Google\Protobuf\Internal\RepeatedField $capacity_commitments + * List of capacity commitments visible to the user. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * List of capacity commitments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCapacityCommitments() + { + return $this->capacity_commitments; + } + + /** + * List of capacity commitments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * @param array<\Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCapacityCommitments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment::class); + $this->capacity_commitments = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListReservationsRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListReservationsRequest.php new file mode 100644 index 000000000000..a7badf9061a2 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListReservationsRequest.php @@ -0,0 +1,155 @@ +google.cloud.bigquery.reservation.v1.ListReservationsRequest + */ +class ListReservationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + * Please see {@see ReservationServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\ListReservationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + * @type int $page_size + * The maximum number of items to return per page. + * @type string $page_token + * The next_page_token value returned from a previous List request, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListReservationsResponse.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListReservationsResponse.php new file mode 100644 index 000000000000..01a522f87675 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/ListReservationsResponse.php @@ -0,0 +1,106 @@ +google.cloud.bigquery.reservation.v1.ListReservationsResponse + */ +class ListReservationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of reservations visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + private $reservations; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\Reservation\V1\Reservation>|\Google\Protobuf\Internal\RepeatedField $reservations + * List of reservations visible to the user. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * List of reservations visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReservations() + { + return $this->reservations; + } + + /** + * List of reservations visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + * @param array<\Google\Cloud\BigQuery\Reservation\V1\Reservation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReservations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Reservation\V1\Reservation::class); + $this->reservations = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/MergeCapacityCommitmentsRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/MergeCapacityCommitmentsRequest.php new file mode 100644 index 000000000000..4cba4685918d --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/MergeCapacityCommitmentsRequest.php @@ -0,0 +1,142 @@ +google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + */ +class MergeCapacityCommitmentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Parent resource that identifies admin project and location e.g., + * `projects/myproject/locations/us` + * + * Generated from protobuf field string parent = 1 [(.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Ids of capacity commitments to merge. + * These capacity commitments must exist under admin project and location + * specified in the parent. + * ID is the last portion of capacity commitment name e.g., 'abc' for + * projects/myproject/locations/US/capacityCommitments/abc + * + * Generated from protobuf field repeated string capacity_commitment_ids = 2; + */ + private $capacity_commitment_ids; + + /** + * @param string $parent Parent resource that identifies admin project and location e.g., + * `projects/myproject/locations/us` + * @param string[] $capacityCommitmentIds Ids of capacity commitments to merge. + * These capacity commitments must exist under admin project and location + * specified in the parent. + * ID is the last portion of capacity commitment name e.g., 'abc' for + * projects/myproject/locations/US/capacityCommitments/abc + * + * @return \Google\Cloud\BigQuery\Reservation\V1\MergeCapacityCommitmentsRequest + * + * @experimental + */ + public static function build(string $parent, array $capacityCommitmentIds): self + { + return (new self()) + ->setParent($parent) + ->setCapacityCommitmentIds($capacityCommitmentIds); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Parent resource that identifies admin project and location e.g., + * `projects/myproject/locations/us` + * @type array|\Google\Protobuf\Internal\RepeatedField $capacity_commitment_ids + * Ids of capacity commitments to merge. + * These capacity commitments must exist under admin project and location + * specified in the parent. + * ID is the last portion of capacity commitment name e.g., 'abc' for + * projects/myproject/locations/US/capacityCommitments/abc + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Parent resource that identifies admin project and location e.g., + * `projects/myproject/locations/us` + * + * Generated from protobuf field string parent = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Parent resource that identifies admin project and location e.g., + * `projects/myproject/locations/us` + * + * Generated from protobuf field string parent = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Ids of capacity commitments to merge. + * These capacity commitments must exist under admin project and location + * specified in the parent. + * ID is the last portion of capacity commitment name e.g., 'abc' for + * projects/myproject/locations/US/capacityCommitments/abc + * + * Generated from protobuf field repeated string capacity_commitment_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCapacityCommitmentIds() + { + return $this->capacity_commitment_ids; + } + + /** + * Ids of capacity commitments to merge. + * These capacity commitments must exist under admin project and location + * specified in the parent. + * ID is the last portion of capacity commitment name e.g., 'abc' for + * projects/myproject/locations/US/capacityCommitments/abc + * + * Generated from protobuf field repeated string capacity_commitment_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCapacityCommitmentIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->capacity_commitment_ids = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/MoveAssignmentRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/MoveAssignmentRequest.php new file mode 100644 index 000000000000..9c82141891e1 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/MoveAssignmentRequest.php @@ -0,0 +1,184 @@ +google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + */ +class MoveAssignmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the assignment, + * e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The new reservation ID, e.g.: + * `projects/myotherproject/locations/US/reservations/team2-prod` + * + * Generated from protobuf field string destination_id = 3 [(.google.api.resource_reference) = { + */ + protected $destination_id = ''; + /** + * The optional assignment ID. A new assignment name is generated if this + * field is empty. + * This field can contain only lowercase alphanumeric characters or dashes. + * Max length is 64 characters. + * + * Generated from protobuf field string assignment_id = 5; + */ + protected $assignment_id = ''; + + /** + * @param string $name Required. The resource name of the assignment, + * e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * Please see {@see ReservationServiceClient::assignmentName()} for help formatting this field. + * @param string $destinationId The new reservation ID, e.g.: + * `projects/myotherproject/locations/US/reservations/team2-prod` + * + * @return \Google\Cloud\BigQuery\Reservation\V1\MoveAssignmentRequest + * + * @experimental + */ + public static function build(string $name, string $destinationId): self + { + return (new self()) + ->setName($name) + ->setDestinationId($destinationId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the assignment, + * e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * @type string $destination_id + * The new reservation ID, e.g.: + * `projects/myotherproject/locations/US/reservations/team2-prod` + * @type string $assignment_id + * The optional assignment ID. A new assignment name is generated if this + * field is empty. + * This field can contain only lowercase alphanumeric characters or dashes. + * Max length is 64 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the assignment, + * e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the assignment, + * e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The new reservation ID, e.g.: + * `projects/myotherproject/locations/US/reservations/team2-prod` + * + * Generated from protobuf field string destination_id = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getDestinationId() + { + return $this->destination_id; + } + + /** + * The new reservation ID, e.g.: + * `projects/myotherproject/locations/US/reservations/team2-prod` + * + * Generated from protobuf field string destination_id = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDestinationId($var) + { + GPBUtil::checkString($var, True); + $this->destination_id = $var; + + return $this; + } + + /** + * The optional assignment ID. A new assignment name is generated if this + * field is empty. + * This field can contain only lowercase alphanumeric characters or dashes. + * Max length is 64 characters. + * + * Generated from protobuf field string assignment_id = 5; + * @return string + */ + public function getAssignmentId() + { + return $this->assignment_id; + } + + /** + * The optional assignment ID. A new assignment name is generated if this + * field is empty. + * This field can contain only lowercase alphanumeric characters or dashes. + * Max length is 64 characters. + * + * Generated from protobuf field string assignment_id = 5; + * @param string $var + * @return $this + */ + public function setAssignmentId($var) + { + GPBUtil::checkString($var, True); + $this->assignment_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Reservation.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Reservation.php new file mode 100644 index 000000000000..6612b0474cea --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Reservation.php @@ -0,0 +1,647 @@ +google.cloud.bigquery.reservation.v1.Reservation + */ +class Reservation extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the reservation, e.g., + * `projects/*/locations/*/reservations/team1-prod`. + * The reservation_id must only contain lower case alphanumeric characters or + * dashes. It must start with a letter and must not end with a dash. Its + * maximum length is 64 characters. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Baseline slots available to this reservation. A slot is a unit of + * computational power in BigQuery, and serves as the unit of parallelism. + * Queries using this reservation might use more slots during runtime if + * ignore_idle_slots is set to false, or autoscaling is enabled. + * If edition is EDITION_UNSPECIFIED and total slot_capacity of the + * reservation and its siblings exceeds the total slot_count of all capacity + * commitments, the request will fail with + * `google.rpc.Code.RESOURCE_EXHAUSTED`. + * If edition is any value but EDITION_UNSPECIFIED, then the above requirement + * is not needed. The total slot_capacity of the reservation and its siblings + * may exceed the total slot_count of capacity commitments. In that case, the + * exceeding slots will be charged with the autoscale SKU. You can increase + * the number of baseline slots in a reservation every few minutes. If you + * want to decrease your baseline slots, you are limited to once an hour if + * you have recently changed your baseline slot capacity and your baseline + * slots exceed your committed slots. Otherwise, you can decrease your + * baseline slots every few minutes. + * + * Generated from protobuf field int64 slot_capacity = 2; + */ + protected $slot_capacity = 0; + /** + * If false, any query or pipeline job using this reservation will use idle + * slots from other reservations within the same admin project. If true, a + * query or pipeline job using this reservation will execute with the slot + * capacity specified in the slot_capacity field at most. + * + * Generated from protobuf field bool ignore_idle_slots = 4; + */ + protected $ignore_idle_slots = false; + /** + * The configuration parameters for the auto scaling feature. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Reservation.Autoscale autoscale = 7; + */ + protected $autoscale = null; + /** + * Job concurrency target which sets a soft upper bound on the number of jobs + * that can run concurrently in this reservation. This is a soft target due to + * asynchronous nature of the system and various optimizations for small + * queries. + * Default value is 0 which means that concurrency target will be + * automatically computed by the system. + * NOTE: this field is exposed as target job concurrency in the Information + * Schema, DDL and BigQuery CLI. + * + * Generated from protobuf field int64 concurrency = 16; + */ + protected $concurrency = 0; + /** + * Output only. Creation time of the reservation. + * + * Generated from protobuf field .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $creation_time = null; + /** + * Output only. Last update time of the reservation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Applicable only for reservations located within one of the BigQuery + * multi-regions (US or EU). + * If set to true, this reservation is placed in the organization's + * secondary region which is designated for disaster recovery purposes. + * If false, this reservation is placed in the organization's default region. + * NOTE: this is a preview feature. Project must be allow-listed in order to + * set this field. + * + * Generated from protobuf field bool multi_region_auxiliary = 14; + */ + protected $multi_region_auxiliary = false; + /** + * Edition of the reservation. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Edition edition = 17; + */ + protected $edition = 0; + /** + * Optional. The current location of the reservation's primary replica. This + * field is only set for reservations using the managed disaster recovery + * feature. + * + * Generated from protobuf field string primary_location = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $primary_location = ''; + /** + * Optional. The current location of the reservation's secondary replica. This + * field is only set for reservations using the managed disaster recovery + * feature. Users can set this in create reservation calls + * to create a failover reservation or in update reservation calls to convert + * a non-failover reservation to a failover reservation(or vice versa). + * + * Generated from protobuf field string secondary_location = 19 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $secondary_location = ''; + /** + * Optional. The location where the reservation was originally created. This + * is set only during the failover reservation's creation. All billing charges + * for the failover reservation will be applied to this location. + * + * Generated from protobuf field string original_primary_location = 20 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $original_primary_location = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the reservation, e.g., + * `projects/*/locations/*/reservations/team1-prod`. + * The reservation_id must only contain lower case alphanumeric characters or + * dashes. It must start with a letter and must not end with a dash. Its + * maximum length is 64 characters. + * @type int|string $slot_capacity + * Baseline slots available to this reservation. A slot is a unit of + * computational power in BigQuery, and serves as the unit of parallelism. + * Queries using this reservation might use more slots during runtime if + * ignore_idle_slots is set to false, or autoscaling is enabled. + * If edition is EDITION_UNSPECIFIED and total slot_capacity of the + * reservation and its siblings exceeds the total slot_count of all capacity + * commitments, the request will fail with + * `google.rpc.Code.RESOURCE_EXHAUSTED`. + * If edition is any value but EDITION_UNSPECIFIED, then the above requirement + * is not needed. The total slot_capacity of the reservation and its siblings + * may exceed the total slot_count of capacity commitments. In that case, the + * exceeding slots will be charged with the autoscale SKU. You can increase + * the number of baseline slots in a reservation every few minutes. If you + * want to decrease your baseline slots, you are limited to once an hour if + * you have recently changed your baseline slot capacity and your baseline + * slots exceed your committed slots. Otherwise, you can decrease your + * baseline slots every few minutes. + * @type bool $ignore_idle_slots + * If false, any query or pipeline job using this reservation will use idle + * slots from other reservations within the same admin project. If true, a + * query or pipeline job using this reservation will execute with the slot + * capacity specified in the slot_capacity field at most. + * @type \Google\Cloud\BigQuery\Reservation\V1\Reservation\Autoscale $autoscale + * The configuration parameters for the auto scaling feature. + * @type int|string $concurrency + * Job concurrency target which sets a soft upper bound on the number of jobs + * that can run concurrently in this reservation. This is a soft target due to + * asynchronous nature of the system and various optimizations for small + * queries. + * Default value is 0 which means that concurrency target will be + * automatically computed by the system. + * NOTE: this field is exposed as target job concurrency in the Information + * Schema, DDL and BigQuery CLI. + * @type \Google\Protobuf\Timestamp $creation_time + * Output only. Creation time of the reservation. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Last update time of the reservation. + * @type bool $multi_region_auxiliary + * Applicable only for reservations located within one of the BigQuery + * multi-regions (US or EU). + * If set to true, this reservation is placed in the organization's + * secondary region which is designated for disaster recovery purposes. + * If false, this reservation is placed in the organization's default region. + * NOTE: this is a preview feature. Project must be allow-listed in order to + * set this field. + * @type int $edition + * Edition of the reservation. + * @type string $primary_location + * Optional. The current location of the reservation's primary replica. This + * field is only set for reservations using the managed disaster recovery + * feature. + * @type string $secondary_location + * Optional. The current location of the reservation's secondary replica. This + * field is only set for reservations using the managed disaster recovery + * feature. Users can set this in create reservation calls + * to create a failover reservation or in update reservation calls to convert + * a non-failover reservation to a failover reservation(or vice versa). + * @type string $original_primary_location + * Optional. The location where the reservation was originally created. This + * is set only during the failover reservation's creation. All billing charges + * for the failover reservation will be applied to this location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the reservation, e.g., + * `projects/*/locations/*/reservations/team1-prod`. + * The reservation_id must only contain lower case alphanumeric characters or + * dashes. It must start with a letter and must not end with a dash. Its + * maximum length is 64 characters. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the reservation, e.g., + * `projects/*/locations/*/reservations/team1-prod`. + * The reservation_id must only contain lower case alphanumeric characters or + * dashes. It must start with a letter and must not end with a dash. Its + * maximum length is 64 characters. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Baseline slots available to this reservation. A slot is a unit of + * computational power in BigQuery, and serves as the unit of parallelism. + * Queries using this reservation might use more slots during runtime if + * ignore_idle_slots is set to false, or autoscaling is enabled. + * If edition is EDITION_UNSPECIFIED and total slot_capacity of the + * reservation and its siblings exceeds the total slot_count of all capacity + * commitments, the request will fail with + * `google.rpc.Code.RESOURCE_EXHAUSTED`. + * If edition is any value but EDITION_UNSPECIFIED, then the above requirement + * is not needed. The total slot_capacity of the reservation and its siblings + * may exceed the total slot_count of capacity commitments. In that case, the + * exceeding slots will be charged with the autoscale SKU. You can increase + * the number of baseline slots in a reservation every few minutes. If you + * want to decrease your baseline slots, you are limited to once an hour if + * you have recently changed your baseline slot capacity and your baseline + * slots exceed your committed slots. Otherwise, you can decrease your + * baseline slots every few minutes. + * + * Generated from protobuf field int64 slot_capacity = 2; + * @return int|string + */ + public function getSlotCapacity() + { + return $this->slot_capacity; + } + + /** + * Baseline slots available to this reservation. A slot is a unit of + * computational power in BigQuery, and serves as the unit of parallelism. + * Queries using this reservation might use more slots during runtime if + * ignore_idle_slots is set to false, or autoscaling is enabled. + * If edition is EDITION_UNSPECIFIED and total slot_capacity of the + * reservation and its siblings exceeds the total slot_count of all capacity + * commitments, the request will fail with + * `google.rpc.Code.RESOURCE_EXHAUSTED`. + * If edition is any value but EDITION_UNSPECIFIED, then the above requirement + * is not needed. The total slot_capacity of the reservation and its siblings + * may exceed the total slot_count of capacity commitments. In that case, the + * exceeding slots will be charged with the autoscale SKU. You can increase + * the number of baseline slots in a reservation every few minutes. If you + * want to decrease your baseline slots, you are limited to once an hour if + * you have recently changed your baseline slot capacity and your baseline + * slots exceed your committed slots. Otherwise, you can decrease your + * baseline slots every few minutes. + * + * Generated from protobuf field int64 slot_capacity = 2; + * @param int|string $var + * @return $this + */ + public function setSlotCapacity($var) + { + GPBUtil::checkInt64($var); + $this->slot_capacity = $var; + + return $this; + } + + /** + * If false, any query or pipeline job using this reservation will use idle + * slots from other reservations within the same admin project. If true, a + * query or pipeline job using this reservation will execute with the slot + * capacity specified in the slot_capacity field at most. + * + * Generated from protobuf field bool ignore_idle_slots = 4; + * @return bool + */ + public function getIgnoreIdleSlots() + { + return $this->ignore_idle_slots; + } + + /** + * If false, any query or pipeline job using this reservation will use idle + * slots from other reservations within the same admin project. If true, a + * query or pipeline job using this reservation will execute with the slot + * capacity specified in the slot_capacity field at most. + * + * Generated from protobuf field bool ignore_idle_slots = 4; + * @param bool $var + * @return $this + */ + public function setIgnoreIdleSlots($var) + { + GPBUtil::checkBool($var); + $this->ignore_idle_slots = $var; + + return $this; + } + + /** + * The configuration parameters for the auto scaling feature. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Reservation.Autoscale autoscale = 7; + * @return \Google\Cloud\BigQuery\Reservation\V1\Reservation\Autoscale|null + */ + public function getAutoscale() + { + return $this->autoscale; + } + + public function hasAutoscale() + { + return isset($this->autoscale); + } + + public function clearAutoscale() + { + unset($this->autoscale); + } + + /** + * The configuration parameters for the auto scaling feature. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Reservation.Autoscale autoscale = 7; + * @param \Google\Cloud\BigQuery\Reservation\V1\Reservation\Autoscale $var + * @return $this + */ + public function setAutoscale($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Reservation\V1\Reservation\Autoscale::class); + $this->autoscale = $var; + + return $this; + } + + /** + * Job concurrency target which sets a soft upper bound on the number of jobs + * that can run concurrently in this reservation. This is a soft target due to + * asynchronous nature of the system and various optimizations for small + * queries. + * Default value is 0 which means that concurrency target will be + * automatically computed by the system. + * NOTE: this field is exposed as target job concurrency in the Information + * Schema, DDL and BigQuery CLI. + * + * Generated from protobuf field int64 concurrency = 16; + * @return int|string + */ + public function getConcurrency() + { + return $this->concurrency; + } + + /** + * Job concurrency target which sets a soft upper bound on the number of jobs + * that can run concurrently in this reservation. This is a soft target due to + * asynchronous nature of the system and various optimizations for small + * queries. + * Default value is 0 which means that concurrency target will be + * automatically computed by the system. + * NOTE: this field is exposed as target job concurrency in the Information + * Schema, DDL and BigQuery CLI. + * + * Generated from protobuf field int64 concurrency = 16; + * @param int|string $var + * @return $this + */ + public function setConcurrency($var) + { + GPBUtil::checkInt64($var); + $this->concurrency = $var; + + return $this; + } + + /** + * Output only. Creation time of the reservation. + * + * Generated from protobuf field .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreationTime() + { + return $this->creation_time; + } + + public function hasCreationTime() + { + return isset($this->creation_time); + } + + public function clearCreationTime() + { + unset($this->creation_time); + } + + /** + * Output only. Creation time of the reservation. + * + * Generated from protobuf field .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->creation_time = $var; + + return $this; + } + + /** + * Output only. Last update time of the reservation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Last update time of the reservation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Applicable only for reservations located within one of the BigQuery + * multi-regions (US or EU). + * If set to true, this reservation is placed in the organization's + * secondary region which is designated for disaster recovery purposes. + * If false, this reservation is placed in the organization's default region. + * NOTE: this is a preview feature. Project must be allow-listed in order to + * set this field. + * + * Generated from protobuf field bool multi_region_auxiliary = 14; + * @return bool + */ + public function getMultiRegionAuxiliary() + { + return $this->multi_region_auxiliary; + } + + /** + * Applicable only for reservations located within one of the BigQuery + * multi-regions (US or EU). + * If set to true, this reservation is placed in the organization's + * secondary region which is designated for disaster recovery purposes. + * If false, this reservation is placed in the organization's default region. + * NOTE: this is a preview feature. Project must be allow-listed in order to + * set this field. + * + * Generated from protobuf field bool multi_region_auxiliary = 14; + * @param bool $var + * @return $this + */ + public function setMultiRegionAuxiliary($var) + { + GPBUtil::checkBool($var); + $this->multi_region_auxiliary = $var; + + return $this; + } + + /** + * Edition of the reservation. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Edition edition = 17; + * @return int + */ + public function getEdition() + { + return $this->edition; + } + + /** + * Edition of the reservation. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Edition edition = 17; + * @param int $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Reservation\V1\Edition::class); + $this->edition = $var; + + return $this; + } + + /** + * Optional. The current location of the reservation's primary replica. This + * field is only set for reservations using the managed disaster recovery + * feature. + * + * Generated from protobuf field string primary_location = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getPrimaryLocation() + { + return $this->primary_location; + } + + /** + * Optional. The current location of the reservation's primary replica. This + * field is only set for reservations using the managed disaster recovery + * feature. + * + * Generated from protobuf field string primary_location = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setPrimaryLocation($var) + { + GPBUtil::checkString($var, True); + $this->primary_location = $var; + + return $this; + } + + /** + * Optional. The current location of the reservation's secondary replica. This + * field is only set for reservations using the managed disaster recovery + * feature. Users can set this in create reservation calls + * to create a failover reservation or in update reservation calls to convert + * a non-failover reservation to a failover reservation(or vice versa). + * + * Generated from protobuf field string secondary_location = 19 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getSecondaryLocation() + { + return $this->secondary_location; + } + + /** + * Optional. The current location of the reservation's secondary replica. This + * field is only set for reservations using the managed disaster recovery + * feature. Users can set this in create reservation calls + * to create a failover reservation or in update reservation calls to convert + * a non-failover reservation to a failover reservation(or vice versa). + * + * Generated from protobuf field string secondary_location = 19 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSecondaryLocation($var) + { + GPBUtil::checkString($var, True); + $this->secondary_location = $var; + + return $this; + } + + /** + * Optional. The location where the reservation was originally created. This + * is set only during the failover reservation's creation. All billing charges + * for the failover reservation will be applied to this location. + * + * Generated from protobuf field string original_primary_location = 20 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getOriginalPrimaryLocation() + { + return $this->original_primary_location; + } + + /** + * Optional. The location where the reservation was originally created. This + * is set only during the failover reservation's creation. All billing charges + * for the failover reservation will be applied to this location. + * + * Generated from protobuf field string original_primary_location = 20 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setOriginalPrimaryLocation($var) + { + GPBUtil::checkString($var, True); + $this->original_primary_location = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Reservation/Autoscale.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Reservation/Autoscale.php new file mode 100644 index 000000000000..4c9db2992ca8 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/Reservation/Autoscale.php @@ -0,0 +1,120 @@ +google.cloud.bigquery.reservation.v1.Reservation.Autoscale + */ +class Autoscale extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The slot capacity added to this reservation when autoscale + * happens. Will be between [0, max_slots]. Note: after users reduce + * max_slots, it may take a while before it can be propagated, so + * current_slots may stay in the original value and could be larger than + * max_slots for that brief period (less than one minute) + * + * Generated from protobuf field int64 current_slots = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $current_slots = 0; + /** + * Number of slots to be scaled when needed. + * + * Generated from protobuf field int64 max_slots = 2; + */ + protected $max_slots = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $current_slots + * Output only. The slot capacity added to this reservation when autoscale + * happens. Will be between [0, max_slots]. Note: after users reduce + * max_slots, it may take a while before it can be propagated, so + * current_slots may stay in the original value and could be larger than + * max_slots for that brief period (less than one minute) + * @type int|string $max_slots + * Number of slots to be scaled when needed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The slot capacity added to this reservation when autoscale + * happens. Will be between [0, max_slots]. Note: after users reduce + * max_slots, it may take a while before it can be propagated, so + * current_slots may stay in the original value and could be larger than + * max_slots for that brief period (less than one minute) + * + * Generated from protobuf field int64 current_slots = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getCurrentSlots() + { + return $this->current_slots; + } + + /** + * Output only. The slot capacity added to this reservation when autoscale + * happens. Will be between [0, max_slots]. Note: after users reduce + * max_slots, it may take a while before it can be propagated, so + * current_slots may stay in the original value and could be larger than + * max_slots for that brief period (less than one minute) + * + * Generated from protobuf field int64 current_slots = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setCurrentSlots($var) + { + GPBUtil::checkInt64($var); + $this->current_slots = $var; + + return $this; + } + + /** + * Number of slots to be scaled when needed. + * + * Generated from protobuf field int64 max_slots = 2; + * @return int|string + */ + public function getMaxSlots() + { + return $this->max_slots; + } + + /** + * Number of slots to be scaled when needed. + * + * Generated from protobuf field int64 max_slots = 2; + * @param int|string $var + * @return $this + */ + public function setMaxSlots($var) + { + GPBUtil::checkInt64($var); + $this->max_slots = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Autoscale::class, \Google\Cloud\BigQuery\Reservation\V1\Reservation_Autoscale::class); + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAllAssignmentsRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAllAssignmentsRequest.php new file mode 100644 index 000000000000..c21a1dea6c94 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAllAssignmentsRequest.php @@ -0,0 +1,220 @@ +google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + */ +class SearchAllAssignmentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name with location (project name could be the + * wildcard '-'), e.g.: + * `projects/-/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * + * Generated from protobuf field string query = 2; + */ + protected $query = ''; + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The resource name with location (project name could be the + * wildcard '-'), e.g.: + * `projects/-/locations/US`. Please see + * {@see ReservationServiceClient::locationName()} for help formatting this field. + * @param string $query Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * + * @return \Google\Cloud\BigQuery\Reservation\V1\SearchAllAssignmentsRequest + * + * @experimental + */ + public static function build(string $parent, string $query): self + { + return (new self()) + ->setParent($parent) + ->setQuery($query); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name with location (project name could be the + * wildcard '-'), e.g.: + * `projects/-/locations/US`. + * @type string $query + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @type int $page_size + * The maximum number of items to return per page. + * @type string $page_token + * The next_page_token value returned from a previous List request, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name with location (project name could be the + * wildcard '-'), e.g.: + * `projects/-/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name with location (project name could be the + * wildcard '-'), e.g.: + * `projects/-/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * + * Generated from protobuf field string query = 2; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * + * Generated from protobuf field string query = 2; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAllAssignmentsResponse.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAllAssignmentsResponse.php new file mode 100644 index 000000000000..1864b05872c0 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAllAssignmentsResponse.php @@ -0,0 +1,106 @@ +google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + */ +class SearchAllAssignmentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of assignments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + private $assignments; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\Reservation\V1\Assignment>|\Google\Protobuf\Internal\RepeatedField $assignments + * List of assignments visible to the user. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * List of assignments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssignments() + { + return $this->assignments; + } + + /** + * List of assignments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + * @param array<\Google\Cloud\BigQuery\Reservation\V1\Assignment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssignments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Reservation\V1\Assignment::class); + $this->assignments = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAssignmentsRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAssignmentsRequest.php new file mode 100644 index 000000000000..2965aef34365 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAssignmentsRequest.php @@ -0,0 +1,220 @@ +google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + */ +class SearchAssignmentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the admin project(containing project and + * location), e.g.: + * `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * + * Generated from protobuf field string query = 2; + */ + protected $query = ''; + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The resource name of the admin project(containing project and + * location), e.g.: + * `projects/myproject/locations/US`. Please see + * {@see ReservationServiceClient::locationName()} for help formatting this field. + * @param string $query Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * + * @return \Google\Cloud\BigQuery\Reservation\V1\SearchAssignmentsRequest + * + * @experimental + */ + public static function build(string $parent, string $query): self + { + return (new self()) + ->setParent($parent) + ->setQuery($query); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the admin project(containing project and + * location), e.g.: + * `projects/myproject/locations/US`. + * @type string $query + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @type int $page_size + * The maximum number of items to return per page. + * @type string $page_token + * The next_page_token value returned from a previous List request, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the admin project(containing project and + * location), e.g.: + * `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the admin project(containing project and + * location), e.g.: + * `projects/myproject/locations/US`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * + * Generated from protobuf field string query = 2; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * + * Generated from protobuf field string query = 2; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return per page. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAssignmentsResponse.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAssignmentsResponse.php new file mode 100644 index 000000000000..f7f802f7c0c8 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SearchAssignmentsResponse.php @@ -0,0 +1,106 @@ +google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + */ +class SearchAssignmentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of assignments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + private $assignments; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\Reservation\V1\Assignment>|\Google\Protobuf\Internal\RepeatedField $assignments + * List of assignments visible to the user. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * List of assignments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssignments() + { + return $this->assignments; + } + + /** + * List of assignments visible to the user. + * + * Generated from protobuf field repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + * @param array<\Google\Cloud\BigQuery\Reservation\V1\Assignment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssignments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Reservation\V1\Assignment::class); + $this->assignments = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SplitCapacityCommitmentRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SplitCapacityCommitmentRequest.php new file mode 100644 index 000000000000..ef7d9a88c90e --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SplitCapacityCommitmentRequest.php @@ -0,0 +1,123 @@ +google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + */ +class SplitCapacityCommitmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name e.g.,: + * `projects/myproject/locations/US/capacityCommitments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Number of slots in the capacity commitment after the split. + * + * Generated from protobuf field int64 slot_count = 2; + */ + protected $slot_count = 0; + + /** + * @param string $name Required. The resource name e.g.,: + * `projects/myproject/locations/US/capacityCommitments/123` + * Please see {@see ReservationServiceClient::capacityCommitmentName()} for help formatting this field. + * @param int $slotCount Number of slots in the capacity commitment after the split. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\SplitCapacityCommitmentRequest + * + * @experimental + */ + public static function build(string $name, int $slotCount): self + { + return (new self()) + ->setName($name) + ->setSlotCount($slotCount); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name e.g.,: + * `projects/myproject/locations/US/capacityCommitments/123` + * @type int|string $slot_count + * Number of slots in the capacity commitment after the split. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name e.g.,: + * `projects/myproject/locations/US/capacityCommitments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name e.g.,: + * `projects/myproject/locations/US/capacityCommitments/123` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Number of slots in the capacity commitment after the split. + * + * Generated from protobuf field int64 slot_count = 2; + * @return int|string + */ + public function getSlotCount() + { + return $this->slot_count; + } + + /** + * Number of slots in the capacity commitment after the split. + * + * Generated from protobuf field int64 slot_count = 2; + * @param int|string $var + * @return $this + */ + public function setSlotCount($var) + { + GPBUtil::checkInt64($var); + $this->slot_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SplitCapacityCommitmentResponse.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SplitCapacityCommitmentResponse.php new file mode 100644 index 000000000000..dfe6cb372ee1 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/SplitCapacityCommitmentResponse.php @@ -0,0 +1,122 @@ +google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + */ +class SplitCapacityCommitmentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * First capacity commitment, result of a split. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + */ + protected $first = null; + /** + * Second capacity commitment, result of a split. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + */ + protected $second = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $first + * First capacity commitment, result of a split. + * @type \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $second + * Second capacity commitment, result of a split. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * First capacity commitment, result of a split. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + * @return \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment|null + */ + public function getFirst() + { + return $this->first; + } + + public function hasFirst() + { + return isset($this->first); + } + + public function clearFirst() + { + unset($this->first); + } + + /** + * First capacity commitment, result of a split. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + * @param \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $var + * @return $this + */ + public function setFirst($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment::class); + $this->first = $var; + + return $this; + } + + /** + * Second capacity commitment, result of a split. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + * @return \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment|null + */ + public function getSecond() + { + return $this->second; + } + + public function hasSecond() + { + return isset($this->second); + } + + public function clearSecond() + { + unset($this->second); + } + + /** + * Second capacity commitment, result of a split. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + * @param \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $var + * @return $this + */ + public function setSecond($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment::class); + $this->second = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/TableReference.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/TableReference.php new file mode 100644 index 000000000000..a90214c8e1bb --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/TableReference.php @@ -0,0 +1,136 @@ +google.cloud.bigquery.reservation.v1.TableReference + */ +class TableReference extends \Google\Protobuf\Internal\Message +{ + /** + * The assigned project ID of the project. + * + * Generated from protobuf field string project_id = 1; + */ + protected $project_id = ''; + /** + * The ID of the dataset in the above project. + * + * Generated from protobuf field string dataset_id = 2; + */ + protected $dataset_id = ''; + /** + * The ID of the table in the above dataset. + * + * Generated from protobuf field string table_id = 3; + */ + protected $table_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * The assigned project ID of the project. + * @type string $dataset_id + * The ID of the dataset in the above project. + * @type string $table_id + * The ID of the table in the above dataset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * The assigned project ID of the project. + * + * Generated from protobuf field string project_id = 1; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * The assigned project ID of the project. + * + * Generated from protobuf field string project_id = 1; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The ID of the dataset in the above project. + * + * Generated from protobuf field string dataset_id = 2; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * The ID of the dataset in the above project. + * + * Generated from protobuf field string dataset_id = 2; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * The ID of the table in the above dataset. + * + * Generated from protobuf field string table_id = 3; + * @return string + */ + public function getTableId() + { + return $this->table_id; + } + + /** + * The ID of the table in the above dataset. + * + * Generated from protobuf field string table_id = 3; + * @param string $var + * @return $this + */ + public function setTableId($var) + { + GPBUtil::checkString($var, True); + $this->table_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateAssignmentRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateAssignmentRequest.php new file mode 100644 index 000000000000..9cf9c1ac0556 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateAssignmentRequest.php @@ -0,0 +1,137 @@ +google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + */ +class UpdateAssignmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Content of the assignment to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment assignment = 1; + */ + protected $assignment = null; + /** + * Standard field mask for the set of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\BigQuery\Reservation\V1\Assignment $assignment Content of the assignment to update. + * @param \Google\Protobuf\FieldMask $updateMask Standard field mask for the set of fields to be updated. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\UpdateAssignmentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BigQuery\Reservation\V1\Assignment $assignment, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAssignment($assignment) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Reservation\V1\Assignment $assignment + * Content of the assignment to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Standard field mask for the set of fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Content of the assignment to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment assignment = 1; + * @return \Google\Cloud\BigQuery\Reservation\V1\Assignment|null + */ + public function getAssignment() + { + return $this->assignment; + } + + public function hasAssignment() + { + return isset($this->assignment); + } + + public function clearAssignment() + { + unset($this->assignment); + } + + /** + * Content of the assignment to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Assignment assignment = 1; + * @param \Google\Cloud\BigQuery\Reservation\V1\Assignment $var + * @return $this + */ + public function setAssignment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Reservation\V1\Assignment::class); + $this->assignment = $var; + + return $this; + } + + /** + * Standard field mask for the set of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Standard field mask for the set of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateBiReservationRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateBiReservationRequest.php new file mode 100644 index 000000000000..f38c800ad548 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateBiReservationRequest.php @@ -0,0 +1,136 @@ +google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + */ +class UpdateBiReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * A reservation to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + */ + protected $bi_reservation = null; + /** + * A list of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\BigQuery\Reservation\V1\BiReservation $biReservation A reservation to update. + * @param \Google\Protobuf\FieldMask $updateMask A list of fields to be updated in this request. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\UpdateBiReservationRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BigQuery\Reservation\V1\BiReservation $biReservation, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setBiReservation($biReservation) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Reservation\V1\BiReservation $bi_reservation + * A reservation to update. + * @type \Google\Protobuf\FieldMask $update_mask + * A list of fields to be updated in this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * A reservation to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + * @return \Google\Cloud\BigQuery\Reservation\V1\BiReservation|null + */ + public function getBiReservation() + { + return $this->bi_reservation; + } + + public function hasBiReservation() + { + return isset($this->bi_reservation); + } + + public function clearBiReservation() + { + unset($this->bi_reservation); + } + + /** + * A reservation to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + * @param \Google\Cloud\BigQuery\Reservation\V1\BiReservation $var + * @return $this + */ + public function setBiReservation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Reservation\V1\BiReservation::class); + $this->bi_reservation = $var; + + return $this; + } + + /** + * A list of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * A list of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateCapacityCommitmentRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateCapacityCommitmentRequest.php new file mode 100644 index 000000000000..b60c38af791f --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateCapacityCommitmentRequest.php @@ -0,0 +1,137 @@ +google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + */ +class UpdateCapacityCommitmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Content of the capacity commitment to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + */ + protected $capacity_commitment = null; + /** + * Standard field mask for the set of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $capacityCommitment Content of the capacity commitment to update. + * @param \Google\Protobuf\FieldMask $updateMask Standard field mask for the set of fields to be updated. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\UpdateCapacityCommitmentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $capacityCommitment, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCapacityCommitment($capacityCommitment) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $capacity_commitment + * Content of the capacity commitment to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Standard field mask for the set of fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Content of the capacity commitment to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * @return \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment|null + */ + public function getCapacityCommitment() + { + return $this->capacity_commitment; + } + + public function hasCapacityCommitment() + { + return isset($this->capacity_commitment); + } + + public function clearCapacityCommitment() + { + unset($this->capacity_commitment); + } + + /** + * Content of the capacity commitment to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * @param \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $var + * @return $this + */ + public function setCapacityCommitment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment::class); + $this->capacity_commitment = $var; + + return $this; + } + + /** + * Standard field mask for the set of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Standard field mask for the set of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateReservationRequest.php b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateReservationRequest.php new file mode 100644 index 000000000000..001b97e55e2a --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/proto/src/Google/Cloud/BigQuery/Reservation/V1/UpdateReservationRequest.php @@ -0,0 +1,137 @@ +google.cloud.bigquery.reservation.v1.UpdateReservationRequest + */ +class UpdateReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Content of the reservation to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + */ + protected $reservation = null; + /** + * Standard field mask for the set of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\BigQuery\Reservation\V1\Reservation $reservation Content of the reservation to update. + * @param \Google\Protobuf\FieldMask $updateMask Standard field mask for the set of fields to be updated. + * + * @return \Google\Cloud\BigQuery\Reservation\V1\UpdateReservationRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BigQuery\Reservation\V1\Reservation $reservation, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setReservation($reservation) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Reservation\V1\Reservation $reservation + * Content of the reservation to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Standard field mask for the set of fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce(); + parent::__construct($data); + } + + /** + * Content of the reservation to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + * @return \Google\Cloud\BigQuery\Reservation\V1\Reservation|null + */ + public function getReservation() + { + return $this->reservation; + } + + public function hasReservation() + { + return isset($this->reservation); + } + + public function clearReservation() + { + unset($this->reservation); + } + + /** + * Content of the reservation to update. + * + * Generated from protobuf field .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + * @param \Google\Cloud\BigQuery\Reservation\V1\Reservation $var + * @return $this + */ + public function setReservation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Reservation\V1\Reservation::class); + $this->reservation = $var; + + return $this; + } + + /** + * Standard field mask for the set of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Standard field mask for the set of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/create_assignment.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/create_assignment.php new file mode 100644 index 000000000000..d5baf3ac5d8d --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/create_assignment.php @@ -0,0 +1,110 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var Assignment $response */ + $response = $reservationServiceClient->createAssignment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ReservationServiceClient::reservationName( + '[PROJECT]', + '[LOCATION]', + '[RESERVATION]' + ); + + create_assignment_sample($formattedParent); +} +// [END bigqueryreservation_v1_generated_ReservationService_CreateAssignment_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/create_capacity_commitment.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/create_capacity_commitment.php new file mode 100644 index 000000000000..7285b583f0e5 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/create_capacity_commitment.php @@ -0,0 +1,72 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var CapacityCommitment $response */ + $response = $reservationServiceClient->createCapacityCommitment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + create_capacity_commitment_sample($formattedParent); +} +// [END bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/create_reservation.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/create_reservation.php new file mode 100644 index 000000000000..c12c794dba85 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/create_reservation.php @@ -0,0 +1,72 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var Reservation $response */ + $response = $reservationServiceClient->createReservation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + create_reservation_sample($formattedParent); +} +// [END bigqueryreservation_v1_generated_ReservationService_CreateReservation_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/delete_assignment.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/delete_assignment.php new file mode 100644 index 000000000000..1aacfc39838a --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/delete_assignment.php @@ -0,0 +1,89 @@ +` + * and `` + * + * In this example, deletion of the `` assignment won't + * affect the other assignment ``. After said deletion, + * queries from `project1` will still use `res1` while queries from + * `project2` will switch to use on-demand mode. + * + * @param string $formattedName Name of the resource, e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * Please see {@see ReservationServiceClient::assignmentName()} for help formatting this field. + */ +function delete_assignment_sample(string $formattedName): void +{ + // Create a client. + $reservationServiceClient = new ReservationServiceClient(); + + // Prepare the request message. + $request = (new DeleteAssignmentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $reservationServiceClient->deleteAssignment($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ReservationServiceClient::assignmentName( + '[PROJECT]', + '[LOCATION]', + '[RESERVATION]', + '[ASSIGNMENT]' + ); + + delete_assignment_sample($formattedName); +} +// [END bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/delete_capacity_commitment.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/delete_capacity_commitment.php new file mode 100644 index 000000000000..517fdcbacd57 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/delete_capacity_commitment.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $reservationServiceClient->deleteCapacityCommitment($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ReservationServiceClient::capacityCommitmentName( + '[PROJECT]', + '[LOCATION]', + '[CAPACITY_COMMITMENT]' + ); + + delete_capacity_commitment_sample($formattedName); +} +// [END bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/delete_reservation.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/delete_reservation.php new file mode 100644 index 000000000000..71dcc51c2648 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/delete_reservation.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $reservationServiceClient->deleteReservation($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ReservationServiceClient::reservationName( + '[PROJECT]', + '[LOCATION]', + '[RESERVATION]' + ); + + delete_reservation_sample($formattedName); +} +// [END bigqueryreservation_v1_generated_ReservationService_DeleteReservation_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/failover_reservation.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/failover_reservation.php new file mode 100644 index 000000000000..99a8624329bf --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/failover_reservation.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Reservation $response */ + $response = $reservationServiceClient->failoverReservation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ReservationServiceClient::reservationName( + '[PROJECT]', + '[LOCATION]', + '[RESERVATION]' + ); + + failover_reservation_sample($formattedName); +} +// [END bigqueryreservation_v1_generated_ReservationService_FailoverReservation_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/get_bi_reservation.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/get_bi_reservation.php new file mode 100644 index 000000000000..5dd1e2e6a678 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/get_bi_reservation.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var BiReservation $response */ + $response = $reservationServiceClient->getBiReservation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ReservationServiceClient::biReservationName('[PROJECT]', '[LOCATION]'); + + get_bi_reservation_sample($formattedName); +} +// [END bigqueryreservation_v1_generated_ReservationService_GetBiReservation_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/get_capacity_commitment.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/get_capacity_commitment.php new file mode 100644 index 000000000000..da0a087521bd --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/get_capacity_commitment.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CapacityCommitment $response */ + $response = $reservationServiceClient->getCapacityCommitment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ReservationServiceClient::capacityCommitmentName( + '[PROJECT]', + '[LOCATION]', + '[CAPACITY_COMMITMENT]' + ); + + get_capacity_commitment_sample($formattedName); +} +// [END bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/get_reservation.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/get_reservation.php new file mode 100644 index 000000000000..9b3ec448caee --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/get_reservation.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Reservation $response */ + $response = $reservationServiceClient->getReservation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ReservationServiceClient::reservationName( + '[PROJECT]', + '[LOCATION]', + '[RESERVATION]' + ); + + get_reservation_sample($formattedName); +} +// [END bigqueryreservation_v1_generated_ReservationService_GetReservation_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/list_assignments.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/list_assignments.php new file mode 100644 index 000000000000..5aa935e5c914 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/list_assignments.php @@ -0,0 +1,106 @@ +` + * and `` + * + * In this example, ListAssignments will just return the above two assignments + * for reservation `res1`, and no expansion/merge will happen. + * + * The wildcard "-" can be used for + * reservations in the request. In that case all assignments belongs to the + * specified project and location will be listed. + * + * **Note** "-" cannot be used for projects nor locations. + * + * @param string $formattedParent The parent resource name e.g.: + * + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Or: + * + * `projects/myproject/locations/US/reservations/-` + * Please see {@see ReservationServiceClient::reservationName()} for help formatting this field. + */ +function list_assignments_sample(string $formattedParent): void +{ + // Create a client. + $reservationServiceClient = new ReservationServiceClient(); + + // Prepare the request message. + $request = (new ListAssignmentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $reservationServiceClient->listAssignments($request); + + /** @var Assignment $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ReservationServiceClient::reservationName( + '[PROJECT]', + '[LOCATION]', + '[RESERVATION]' + ); + + list_assignments_sample($formattedParent); +} +// [END bigqueryreservation_v1_generated_ReservationService_ListAssignments_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/list_capacity_commitments.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/list_capacity_commitments.php new file mode 100644 index 000000000000..0f2b30e94d34 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/list_capacity_commitments.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $reservationServiceClient->listCapacityCommitments($request); + + /** @var CapacityCommitment $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_capacity_commitments_sample($formattedParent); +} +// [END bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/list_reservations.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/list_reservations.php new file mode 100644 index 000000000000..6a7f0288ac41 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/list_reservations.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $reservationServiceClient->listReservations($request); + + /** @var Reservation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_reservations_sample($formattedParent); +} +// [END bigqueryreservation_v1_generated_ReservationService_ListReservations_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/merge_capacity_commitments.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/merge_capacity_commitments.php new file mode 100644 index 000000000000..a894deeac331 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/merge_capacity_commitments.php @@ -0,0 +1,63 @@ +mergeCapacityCommitments($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/move_assignment.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/move_assignment.php new file mode 100644 index 000000000000..e2ac5b2d9b86 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/move_assignment.php @@ -0,0 +1,82 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Assignment $response */ + $response = $reservationServiceClient->moveAssignment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ReservationServiceClient::assignmentName( + '[PROJECT]', + '[LOCATION]', + '[RESERVATION]', + '[ASSIGNMENT]' + ); + + move_assignment_sample($formattedName); +} +// [END bigqueryreservation_v1_generated_ReservationService_MoveAssignment_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/search_all_assignments.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/search_all_assignments.php new file mode 100644 index 000000000000..6be032006ec9 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/search_all_assignments.php @@ -0,0 +1,97 @@ +folder->organization) happens in this API. + * 3. Parent here is `projects/*/locations/*`, instead of + * `projects/*/locations/*reservations/*`. + * + * @param string $formattedParent The resource name with location (project name could be the + * wildcard '-'), e.g.: + * `projects/-/locations/US`. Please see + * {@see ReservationServiceClient::locationName()} for help formatting this field. + */ +function search_all_assignments_sample(string $formattedParent): void +{ + // Create a client. + $reservationServiceClient = new ReservationServiceClient(); + + // Prepare the request message. + $request = (new SearchAllAssignmentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $reservationServiceClient->searchAllAssignments($request); + + /** @var Assignment $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + search_all_assignments_sample($formattedParent); +} +// [END bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/search_assignments.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/search_assignments.php new file mode 100644 index 000000000000..492d7ee69f37 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/search_assignments.php @@ -0,0 +1,100 @@ +folder->organization) happens in this API. + * 3. Parent here is `projects/*/locations/*`, instead of + * `projects/*/locations/*reservations/*`. + * + * **Note** "-" cannot be used for projects + * nor locations. + * + * @param string $formattedParent The resource name of the admin project(containing project and + * location), e.g.: + * `projects/myproject/locations/US`. Please see + * {@see ReservationServiceClient::locationName()} for help formatting this field. + */ +function search_assignments_sample(string $formattedParent): void +{ + // Create a client. + $reservationServiceClient = new ReservationServiceClient(); + + // Prepare the request message. + $request = (new SearchAssignmentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $reservationServiceClient->searchAssignments($request); + + /** @var Assignment $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + search_assignments_sample($formattedParent); +} +// [END bigqueryreservation_v1_generated_ReservationService_SearchAssignments_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/split_capacity_commitment.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/split_capacity_commitment.php new file mode 100644 index 000000000000..8b64bf3ad918 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/split_capacity_commitment.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SplitCapacityCommitmentResponse $response */ + $response = $reservationServiceClient->splitCapacityCommitment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ReservationServiceClient::capacityCommitmentName( + '[PROJECT]', + '[LOCATION]', + '[CAPACITY_COMMITMENT]' + ); + + split_capacity_commitment_sample($formattedName); +} +// [END bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_assignment.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_assignment.php new file mode 100644 index 000000000000..165918ebdc33 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_assignment.php @@ -0,0 +1,59 @@ +updateAssignment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_bi_reservation.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_bi_reservation.php new file mode 100644 index 000000000000..0b9afd0d6f84 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_bi_reservation.php @@ -0,0 +1,64 @@ +updateBiReservation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_capacity_commitment.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_capacity_commitment.php new file mode 100644 index 000000000000..f874b135046f --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_capacity_commitment.php @@ -0,0 +1,63 @@ +updateCapacityCommitment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_reservation.php b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_reservation.php new file mode 100644 index 000000000000..0c1ab7f41205 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/samples/V1/ReservationServiceClient/update_reservation.php @@ -0,0 +1,57 @@ +updateReservation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigqueryreservation_v1_generated_ReservationService_UpdateReservation_sync] diff --git a/owl-bot-staging/BigQueryReservation/v1/src/V1/Client/ReservationServiceClient.php b/owl-bot-staging/BigQueryReservation/v1/src/V1/Client/ReservationServiceClient.php new file mode 100644 index 000000000000..97d17baa527e --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/src/V1/Client/ReservationServiceClient.php @@ -0,0 +1,1084 @@ + createAssignmentAsync(CreateAssignmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface createCapacityCommitmentAsync(CreateCapacityCommitmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface createReservationAsync(CreateReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAssignmentAsync(DeleteAssignmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteCapacityCommitmentAsync(DeleteCapacityCommitmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteReservationAsync(DeleteReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface failoverReservationAsync(FailoverReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getBiReservationAsync(GetBiReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getCapacityCommitmentAsync(GetCapacityCommitmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getReservationAsync(GetReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAssignmentsAsync(ListAssignmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listCapacityCommitmentsAsync(ListCapacityCommitmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listReservationsAsync(ListReservationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface mergeCapacityCommitmentsAsync(MergeCapacityCommitmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface moveAssignmentAsync(MoveAssignmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchAllAssignmentsAsync(SearchAllAssignmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchAssignmentsAsync(SearchAssignmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface splitCapacityCommitmentAsync(SplitCapacityCommitmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAssignmentAsync(UpdateAssignmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateBiReservationAsync(UpdateBiReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateCapacityCommitmentAsync(UpdateCapacityCommitmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateReservationAsync(UpdateReservationRequest $request, array $optionalArgs = []) + */ +final class ReservationServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.bigquery.reservation.v1.ReservationService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'bigqueryreservation.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'bigqueryreservation.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/reservation_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/reservation_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/reservation_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/reservation_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a assignment + * resource. + * + * @param string $project + * @param string $location + * @param string $reservation + * @param string $assignment + * + * @return string The formatted assignment resource. + */ + public static function assignmentName(string $project, string $location, string $reservation, string $assignment): string + { + return self::getPathTemplate('assignment')->render([ + 'project' => $project, + 'location' => $location, + 'reservation' => $reservation, + 'assignment' => $assignment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * bi_reservation resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted bi_reservation resource. + */ + public static function biReservationName(string $project, string $location): string + { + return self::getPathTemplate('biReservation')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * capacity_commitment resource. + * + * @param string $project + * @param string $location + * @param string $capacityCommitment + * + * @return string The formatted capacity_commitment resource. + */ + public static function capacityCommitmentName(string $project, string $location, string $capacityCommitment): string + { + return self::getPathTemplate('capacityCommitment')->render([ + 'project' => $project, + 'location' => $location, + 'capacity_commitment' => $capacityCommitment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a reservation + * resource. + * + * @param string $project + * @param string $location + * @param string $reservation + * + * @return string The formatted reservation resource. + */ + public static function reservationName(string $project, string $location, string $reservation): string + { + return self::getPathTemplate('reservation')->render([ + 'project' => $project, + 'location' => $location, + 'reservation' => $reservation, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - assignment: projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment} + * - biReservation: projects/{project}/locations/{location}/biReservation + * - capacityCommitment: projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment} + * - location: projects/{project}/locations/{location} + * - reservation: projects/{project}/locations/{location}/reservations/{reservation} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'bigqueryreservation.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates an assignment object which allows the given project to submit jobs + * of a certain type using slots from the specified reservation. + * + * Currently a + * resource (project, folder, organization) can only have one assignment per + * each (job_type, location) combination, and that reservation will be used + * for all jobs of the matching type. + * + * Different assignments can be created on different levels of the + * projects, folders or organization hierarchy. During query execution, + * the assignment is looked up at the project, folder and organization levels + * in that order. The first assignment found is applied to the query. + * + * When creating assignments, it does not matter if other assignments exist at + * higher levels. + * + * Example: + * + * * The organization `organizationA` contains two projects, `project1` + * and `project2`. + * * Assignments for all three entities (`organizationA`, `project1`, and + * `project2`) could all be created and mapped to the same or different + * reservations. + * + * "None" assignments represent an absence of the assignment. Projects + * assigned to None use on-demand pricing. To create a "None" assignment, use + * "none" as a reservation_id in the parent. Example parent: + * `projects/myproject/locations/US/reservations/none`. + * + * Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have + * 'bigquery.admin' permissions on the project using the reservation + * and the project that owns this reservation. + * + * Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment + * does not match location of the reservation. + * + * The async variant is {@see ReservationServiceClient::createAssignmentAsync()} . + * + * @example samples/V1/ReservationServiceClient/create_assignment.php + * + * @param CreateAssignmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Assignment + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAssignment(CreateAssignmentRequest $request, array $callOptions = []): Assignment + { + return $this->startApiCall('CreateAssignment', $request, $callOptions)->wait(); + } + + /** + * Creates a new capacity commitment resource. + * + * The async variant is + * {@see ReservationServiceClient::createCapacityCommitmentAsync()} . + * + * @example samples/V1/ReservationServiceClient/create_capacity_commitment.php + * + * @param CreateCapacityCommitmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CapacityCommitment + * + * @throws ApiException Thrown if the API call fails. + */ + public function createCapacityCommitment(CreateCapacityCommitmentRequest $request, array $callOptions = []): CapacityCommitment + { + return $this->startApiCall('CreateCapacityCommitment', $request, $callOptions)->wait(); + } + + /** + * Creates a new reservation resource. + * + * The async variant is {@see ReservationServiceClient::createReservationAsync()} . + * + * @example samples/V1/ReservationServiceClient/create_reservation.php + * + * @param CreateReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Reservation + * + * @throws ApiException Thrown if the API call fails. + */ + public function createReservation(CreateReservationRequest $request, array $callOptions = []): Reservation + { + return $this->startApiCall('CreateReservation', $request, $callOptions)->wait(); + } + + /** + * Deletes a assignment. No expansion will happen. + * + * Example: + * + * * Organization `organizationA` contains two projects, `project1` and + * `project2`. + * * Reservation `res1` exists and was created previously. + * * CreateAssignment was used previously to define the following + * associations between entities and reservations: `` + * and `` + * + * In this example, deletion of the `` assignment won't + * affect the other assignment ``. After said deletion, + * queries from `project1` will still use `res1` while queries from + * `project2` will switch to use on-demand mode. + * + * The async variant is {@see ReservationServiceClient::deleteAssignmentAsync()} . + * + * @example samples/V1/ReservationServiceClient/delete_assignment.php + * + * @param DeleteAssignmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAssignment(DeleteAssignmentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAssignment', $request, $callOptions)->wait(); + } + + /** + * Deletes a capacity commitment. Attempting to delete capacity commitment + * before its commitment_end_time will fail with the error code + * `google.rpc.Code.FAILED_PRECONDITION`. + * + * The async variant is + * {@see ReservationServiceClient::deleteCapacityCommitmentAsync()} . + * + * @example samples/V1/ReservationServiceClient/delete_capacity_commitment.php + * + * @param DeleteCapacityCommitmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteCapacityCommitment(DeleteCapacityCommitmentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteCapacityCommitment', $request, $callOptions)->wait(); + } + + /** + * Deletes a reservation. + * Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + * assignments. + * + * The async variant is {@see ReservationServiceClient::deleteReservationAsync()} . + * + * @example samples/V1/ReservationServiceClient/delete_reservation.php + * + * @param DeleteReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteReservation(DeleteReservationRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteReservation', $request, $callOptions)->wait(); + } + + /** + * Fail over a reservation to the secondary location. The operation should be + * done in the current secondary location, which will be promoted to the + * new primary location for the reservation. + * Attempting to failover a reservation in the current primary location will + * fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + * The async variant is {@see ReservationServiceClient::failoverReservationAsync()} + * . + * + * @example samples/V1/ReservationServiceClient/failover_reservation.php + * + * @param FailoverReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Reservation + * + * @throws ApiException Thrown if the API call fails. + */ + public function failoverReservation(FailoverReservationRequest $request, array $callOptions = []): Reservation + { + return $this->startApiCall('FailoverReservation', $request, $callOptions)->wait(); + } + + /** + * Retrieves a BI reservation. + * + * The async variant is {@see ReservationServiceClient::getBiReservationAsync()} . + * + * @example samples/V1/ReservationServiceClient/get_bi_reservation.php + * + * @param GetBiReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BiReservation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBiReservation(GetBiReservationRequest $request, array $callOptions = []): BiReservation + { + return $this->startApiCall('GetBiReservation', $request, $callOptions)->wait(); + } + + /** + * Returns information about the capacity commitment. + * + * The async variant is + * {@see ReservationServiceClient::getCapacityCommitmentAsync()} . + * + * @example samples/V1/ReservationServiceClient/get_capacity_commitment.php + * + * @param GetCapacityCommitmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CapacityCommitment + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCapacityCommitment(GetCapacityCommitmentRequest $request, array $callOptions = []): CapacityCommitment + { + return $this->startApiCall('GetCapacityCommitment', $request, $callOptions)->wait(); + } + + /** + * Returns information about the reservation. + * + * The async variant is {@see ReservationServiceClient::getReservationAsync()} . + * + * @example samples/V1/ReservationServiceClient/get_reservation.php + * + * @param GetReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Reservation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getReservation(GetReservationRequest $request, array $callOptions = []): Reservation + { + return $this->startApiCall('GetReservation', $request, $callOptions)->wait(); + } + + /** + * Lists assignments. + * + * Only explicitly created assignments will be returned. + * + * Example: + * + * * Organization `organizationA` contains two projects, `project1` and + * `project2`. + * * Reservation `res1` exists and was created previously. + * * CreateAssignment was used previously to define the following + * associations between entities and reservations: `` + * and `` + * + * In this example, ListAssignments will just return the above two assignments + * for reservation `res1`, and no expansion/merge will happen. + * + * The wildcard "-" can be used for + * reservations in the request. In that case all assignments belongs to the + * specified project and location will be listed. + * + * **Note** "-" cannot be used for projects nor locations. + * + * The async variant is {@see ReservationServiceClient::listAssignmentsAsync()} . + * + * @example samples/V1/ReservationServiceClient/list_assignments.php + * + * @param ListAssignmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAssignments(ListAssignmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAssignments', $request, $callOptions); + } + + /** + * Lists all the capacity commitments for the admin project. + * + * The async variant is + * {@see ReservationServiceClient::listCapacityCommitmentsAsync()} . + * + * @example samples/V1/ReservationServiceClient/list_capacity_commitments.php + * + * @param ListCapacityCommitmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listCapacityCommitments(ListCapacityCommitmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListCapacityCommitments', $request, $callOptions); + } + + /** + * Lists all the reservations for the project in the specified location. + * + * The async variant is {@see ReservationServiceClient::listReservationsAsync()} . + * + * @example samples/V1/ReservationServiceClient/list_reservations.php + * + * @param ListReservationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listReservations(ListReservationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListReservations', $request, $callOptions); + } + + /** + * Merges capacity commitments of the same plan into a single commitment. + * + * The resulting capacity commitment has the greater commitment_end_time + * out of the to-be-merged capacity commitments. + * + * Attempting to merge capacity commitments of different plan will fail + * with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + * The async variant is + * {@see ReservationServiceClient::mergeCapacityCommitmentsAsync()} . + * + * @example samples/V1/ReservationServiceClient/merge_capacity_commitments.php + * + * @param MergeCapacityCommitmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CapacityCommitment + * + * @throws ApiException Thrown if the API call fails. + */ + public function mergeCapacityCommitments(MergeCapacityCommitmentsRequest $request, array $callOptions = []): CapacityCommitment + { + return $this->startApiCall('MergeCapacityCommitments', $request, $callOptions)->wait(); + } + + /** + * Moves an assignment under a new reservation. + * + * This differs from removing an existing assignment and recreating a new one + * by providing a transactional change that ensures an assignee always has an + * associated reservation. + * + * The async variant is {@see ReservationServiceClient::moveAssignmentAsync()} . + * + * @example samples/V1/ReservationServiceClient/move_assignment.php + * + * @param MoveAssignmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Assignment + * + * @throws ApiException Thrown if the API call fails. + */ + public function moveAssignment(MoveAssignmentRequest $request, array $callOptions = []): Assignment + { + return $this->startApiCall('MoveAssignment', $request, $callOptions)->wait(); + } + + /** + * Looks up assignments for a specified resource for a particular region. + * If the request is about a project: + * + * 1. Assignments created on the project will be returned if they exist. + * 2. Otherwise assignments created on the closest ancestor will be + * returned. + * 3. Assignments for different JobTypes will all be returned. + * + * The same logic applies if the request is about a folder. + * + * If the request is about an organization, then assignments created on the + * organization will be returned (organization doesn't have ancestors). + * + * Comparing to ListAssignments, there are some behavior + * differences: + * + * 1. permission on the assignee will be verified in this API. + * 2. Hierarchy lookup (project->folder->organization) happens in this API. + * 3. Parent here is `projects/*/locations/*`, instead of + * `projects/*/locations/*reservations/*`. + * + * The async variant is + * {@see ReservationServiceClient::searchAllAssignmentsAsync()} . + * + * @example samples/V1/ReservationServiceClient/search_all_assignments.php + * + * @param SearchAllAssignmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchAllAssignments(SearchAllAssignmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchAllAssignments', $request, $callOptions); + } + + /** + * Deprecated: Looks up assignments for a specified resource for a particular + * region. If the request is about a project: + * + * 1. Assignments created on the project will be returned if they exist. + * 2. Otherwise assignments created on the closest ancestor will be + * returned. + * 3. Assignments for different JobTypes will all be returned. + * + * The same logic applies if the request is about a folder. + * + * If the request is about an organization, then assignments created on the + * organization will be returned (organization doesn't have ancestors). + * + * Comparing to ListAssignments, there are some behavior + * differences: + * + * 1. permission on the assignee will be verified in this API. + * 2. Hierarchy lookup (project->folder->organization) happens in this API. + * 3. Parent here is `projects/*/locations/*`, instead of + * `projects/*/locations/*reservations/*`. + * + * **Note** "-" cannot be used for projects + * nor locations. + * + * The async variant is {@see ReservationServiceClient::searchAssignmentsAsync()} . + * + * @example samples/V1/ReservationServiceClient/search_assignments.php + * + * @param SearchAssignmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @deprecated This method will be removed in the next major version update. + */ + public function searchAssignments(SearchAssignmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchAssignments', $request, $callOptions); + } + + /** + * Splits capacity commitment to two commitments of the same plan and + * `commitment_end_time`. + * + * A common use case is to enable downgrading commitments. + * + * For example, in order to downgrade from 10000 slots to 8000, you might + * split a 10000 capacity commitment into commitments of 2000 and 8000. Then, + * you delete the first one after the commitment end time passes. + * + * The async variant is + * {@see ReservationServiceClient::splitCapacityCommitmentAsync()} . + * + * @example samples/V1/ReservationServiceClient/split_capacity_commitment.php + * + * @param SplitCapacityCommitmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SplitCapacityCommitmentResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function splitCapacityCommitment(SplitCapacityCommitmentRequest $request, array $callOptions = []): SplitCapacityCommitmentResponse + { + return $this->startApiCall('SplitCapacityCommitment', $request, $callOptions)->wait(); + } + + /** + * Updates an existing assignment. + * + * Only the `priority` field can be updated. + * + * The async variant is {@see ReservationServiceClient::updateAssignmentAsync()} . + * + * @example samples/V1/ReservationServiceClient/update_assignment.php + * + * @param UpdateAssignmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Assignment + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAssignment(UpdateAssignmentRequest $request, array $callOptions = []): Assignment + { + return $this->startApiCall('UpdateAssignment', $request, $callOptions)->wait(); + } + + /** + * Updates a BI reservation. + * + * Only fields specified in the `field_mask` are updated. + * + * A singleton BI reservation always exists with default size 0. + * In order to reserve BI capacity it needs to be updated to an amount + * greater than 0. In order to release BI capacity reservation size + * must be set to 0. + * + * The async variant is {@see ReservationServiceClient::updateBiReservationAsync()} + * . + * + * @example samples/V1/ReservationServiceClient/update_bi_reservation.php + * + * @param UpdateBiReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BiReservation + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateBiReservation(UpdateBiReservationRequest $request, array $callOptions = []): BiReservation + { + return $this->startApiCall('UpdateBiReservation', $request, $callOptions)->wait(); + } + + /** + * Updates an existing capacity commitment. + * + * Only `plan` and `renewal_plan` fields can be updated. + * + * Plan can only be changed to a plan of a longer commitment period. + * Attempting to change to a plan with shorter commitment period will fail + * with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + * The async variant is + * {@see ReservationServiceClient::updateCapacityCommitmentAsync()} . + * + * @example samples/V1/ReservationServiceClient/update_capacity_commitment.php + * + * @param UpdateCapacityCommitmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CapacityCommitment + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCapacityCommitment(UpdateCapacityCommitmentRequest $request, array $callOptions = []): CapacityCommitment + { + return $this->startApiCall('UpdateCapacityCommitment', $request, $callOptions)->wait(); + } + + /** + * Updates an existing reservation resource. + * + * The async variant is {@see ReservationServiceClient::updateReservationAsync()} . + * + * @example samples/V1/ReservationServiceClient/update_reservation.php + * + * @param UpdateReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Reservation + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateReservation(UpdateReservationRequest $request, array $callOptions = []): Reservation + { + return $this->startApiCall('UpdateReservation', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BigQueryReservation/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BigQueryReservation/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..9938872c5177 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/src/V1/gapic_metadata.json @@ -0,0 +1,128 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.bigquery.reservation.v1", + "libraryPackage": "Google\\Cloud\\BigQuery\\Reservation\\V1", + "services": { + "ReservationService": { + "clients": { + "grpc": { + "libraryClient": "ReservationServiceGapicClient", + "rpcs": { + "CreateAssignment": { + "methods": [ + "createAssignment" + ] + }, + "CreateCapacityCommitment": { + "methods": [ + "createCapacityCommitment" + ] + }, + "CreateReservation": { + "methods": [ + "createReservation" + ] + }, + "DeleteAssignment": { + "methods": [ + "deleteAssignment" + ] + }, + "DeleteCapacityCommitment": { + "methods": [ + "deleteCapacityCommitment" + ] + }, + "DeleteReservation": { + "methods": [ + "deleteReservation" + ] + }, + "FailoverReservation": { + "methods": [ + "failoverReservation" + ] + }, + "GetBiReservation": { + "methods": [ + "getBiReservation" + ] + }, + "GetCapacityCommitment": { + "methods": [ + "getCapacityCommitment" + ] + }, + "GetReservation": { + "methods": [ + "getReservation" + ] + }, + "ListAssignments": { + "methods": [ + "listAssignments" + ] + }, + "ListCapacityCommitments": { + "methods": [ + "listCapacityCommitments" + ] + }, + "ListReservations": { + "methods": [ + "listReservations" + ] + }, + "MergeCapacityCommitments": { + "methods": [ + "mergeCapacityCommitments" + ] + }, + "MoveAssignment": { + "methods": [ + "moveAssignment" + ] + }, + "SearchAllAssignments": { + "methods": [ + "searchAllAssignments" + ] + }, + "SearchAssignments": { + "methods": [ + "searchAssignments" + ] + }, + "SplitCapacityCommitment": { + "methods": [ + "splitCapacityCommitment" + ] + }, + "UpdateAssignment": { + "methods": [ + "updateAssignment" + ] + }, + "UpdateBiReservation": { + "methods": [ + "updateBiReservation" + ] + }, + "UpdateCapacityCommitment": { + "methods": [ + "updateCapacityCommitment" + ] + }, + "UpdateReservation": { + "methods": [ + "updateReservation" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BigQueryReservation/v1/src/V1/resources/reservation_service_client_config.json b/owl-bot-staging/BigQueryReservation/v1/src/V1/resources/reservation_service_client_config.json new file mode 100644 index 000000000000..7720c6fca4fd --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/src/V1/resources/reservation_service_client_config.json @@ -0,0 +1,155 @@ +{ + "interfaces": { + "google.cloud.bigquery.reservation.v1.ReservationService": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + } + }, + "methods": { + "CreateAssignment": { + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateCapacityCommitment": { + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateReservation": { + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteAssignment": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteCapacityCommitment": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteReservation": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "FailoverReservation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetBiReservation": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetCapacityCommitment": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetReservation": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListAssignments": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListCapacityCommitments": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListReservations": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "MergeCapacityCommitments": { + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "MoveAssignment": { + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SearchAllAssignments": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SearchAssignments": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SplitCapacityCommitment": { + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateBiReservation": { + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateCapacityCommitment": { + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateReservation": { + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/BigQueryReservation/v1/src/V1/resources/reservation_service_descriptor_config.php b/owl-bot-staging/BigQueryReservation/v1/src/V1/resources/reservation_service_descriptor_config.php new file mode 100644 index 000000000000..3580af45030a --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/src/V1/resources/reservation_service_descriptor_config.php @@ -0,0 +1,343 @@ + [ + 'google.cloud.bigquery.reservation.v1.ReservationService' => [ + 'CreateAssignment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\Assignment', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateCapacityCommitment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateReservation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\Reservation', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAssignment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteCapacityCommitment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteReservation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'FailoverReservation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\Reservation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBiReservation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\BiReservation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetCapacityCommitment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetReservation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\Reservation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAssignments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAssignments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\ListAssignmentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListCapacityCommitments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCapacityCommitments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\ListCapacityCommitmentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListReservations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getReservations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\ListReservationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'MergeCapacityCommitments' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'MoveAssignment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\Assignment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SearchAllAssignments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAssignments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\SearchAllAssignmentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SearchAssignments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAssignments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\SearchAssignmentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SplitCapacityCommitment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\SplitCapacityCommitmentResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateAssignment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\Assignment', + 'headerParams' => [ + [ + 'keyName' => 'assignment.name', + 'fieldAccessors' => [ + 'getAssignment', + 'getName', + ], + ], + ], + ], + 'UpdateBiReservation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\BiReservation', + 'headerParams' => [ + [ + 'keyName' => 'bi_reservation.name', + 'fieldAccessors' => [ + 'getBiReservation', + 'getName', + ], + ], + ], + ], + 'UpdateCapacityCommitment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment', + 'headerParams' => [ + [ + 'keyName' => 'capacity_commitment.name', + 'fieldAccessors' => [ + 'getCapacityCommitment', + 'getName', + ], + ], + ], + ], + 'UpdateReservation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Reservation\V1\Reservation', + 'headerParams' => [ + [ + 'keyName' => 'reservation.name', + 'fieldAccessors' => [ + 'getReservation', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'assignment' => 'projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}', + 'biReservation' => 'projects/{project}/locations/{location}/biReservation', + 'capacityCommitment' => 'projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}', + 'location' => 'projects/{project}/locations/{location}', + 'reservation' => 'projects/{project}/locations/{location}/reservations/{reservation}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryReservation/v1/src/V1/resources/reservation_service_rest_client_config.php b/owl-bot-staging/BigQueryReservation/v1/src/V1/resources/reservation_service_rest_client_config.php new file mode 100644 index 000000000000..95e3f8e9b8e5 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/src/V1/resources/reservation_service_rest_client_config.php @@ -0,0 +1,286 @@ + [ + 'google.cloud.bigquery.reservation.v1.ReservationService' => [ + 'CreateAssignment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/reservations/*}/assignments', + 'body' => 'assignment', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateCapacityCommitment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/capacityCommitments', + 'body' => 'capacity_commitment', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateReservation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/reservations', + 'body' => 'reservation', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAssignment' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/reservations/*/assignments/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteCapacityCommitment' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/capacityCommitments/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteReservation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/reservations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'FailoverReservation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/reservations/*}:failoverReservation', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBiReservation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/biReservation}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCapacityCommitment' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/capacityCommitments/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetReservation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/reservations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListAssignments' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/reservations/*}/assignments', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListCapacityCommitments' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/capacityCommitments', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListReservations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/reservations', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'MergeCapacityCommitments' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/capacityCommitments:merge', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'MoveAssignment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SearchAllAssignments' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:searchAllAssignments', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SearchAssignments' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:searchAssignments', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SplitCapacityCommitment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/capacityCommitments/*}:split', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateAssignment' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}', + 'body' => 'assignment', + 'placeholders' => [ + 'assignment.name' => [ + 'getters' => [ + 'getAssignment', + 'getName', + ], + ], + ], + ], + 'UpdateBiReservation' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{bi_reservation.name=projects/*/locations/*/biReservation}', + 'body' => 'bi_reservation', + 'placeholders' => [ + 'bi_reservation.name' => [ + 'getters' => [ + 'getBiReservation', + 'getName', + ], + ], + ], + ], + 'UpdateCapacityCommitment' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{capacity_commitment.name=projects/*/locations/*/capacityCommitments/*}', + 'body' => 'capacity_commitment', + 'placeholders' => [ + 'capacity_commitment.name' => [ + 'getters' => [ + 'getCapacityCommitment', + 'getName', + ], + ], + ], + ], + 'UpdateReservation' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{reservation.name=projects/*/locations/*/reservations/*}', + 'body' => 'reservation', + 'placeholders' => [ + 'reservation.name' => [ + 'getters' => [ + 'getReservation', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/BigQueryReservation/v1/tests/Unit/V1/Client/ReservationServiceClientTest.php b/owl-bot-staging/BigQueryReservation/v1/tests/Unit/V1/Client/ReservationServiceClientTest.php new file mode 100644 index 000000000000..085246ca4fa8 --- /dev/null +++ b/owl-bot-staging/BigQueryReservation/v1/tests/Unit/V1/Client/ReservationServiceClientTest.php @@ -0,0 +1,1611 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ReservationServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ReservationServiceClient($options); + } + + /** @test */ + public function createAssignmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $assignee = 'assignee-369881649'; + $expectedResponse = new Assignment(); + $expectedResponse->setName($name); + $expectedResponse->setAssignee($assignee); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->reservationName('[PROJECT]', '[LOCATION]', '[RESERVATION]'); + $request = (new CreateAssignmentRequest()) + ->setParent($formattedParent); + $response = $gapicClient->createAssignment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/CreateAssignment', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createAssignmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->reservationName('[PROJECT]', '[LOCATION]', '[RESERVATION]'); + $request = (new CreateAssignmentRequest()) + ->setParent($formattedParent); + try { + $gapicClient->createAssignment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createCapacityCommitmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $slotCount = 191518834; + $multiRegionAuxiliary = false; + $isFlatRate = false; + $expectedResponse = new CapacityCommitment(); + $expectedResponse->setName($name); + $expectedResponse->setSlotCount($slotCount); + $expectedResponse->setMultiRegionAuxiliary($multiRegionAuxiliary); + $expectedResponse->setIsFlatRate($isFlatRate); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new CreateCapacityCommitmentRequest()) + ->setParent($formattedParent); + $response = $gapicClient->createCapacityCommitment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/CreateCapacityCommitment', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createCapacityCommitmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new CreateCapacityCommitmentRequest()) + ->setParent($formattedParent); + try { + $gapicClient->createCapacityCommitment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createReservationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $slotCapacity = 1516717605; + $ignoreIdleSlots = false; + $concurrency = 1476186003; + $multiRegionAuxiliary = false; + $primaryLocation = 'primaryLocation182084946'; + $secondaryLocation = 'secondaryLocation-1339637216'; + $originalPrimaryLocation = 'originalPrimaryLocation-1626473984'; + $expectedResponse = new Reservation(); + $expectedResponse->setName($name); + $expectedResponse->setSlotCapacity($slotCapacity); + $expectedResponse->setIgnoreIdleSlots($ignoreIdleSlots); + $expectedResponse->setConcurrency($concurrency); + $expectedResponse->setMultiRegionAuxiliary($multiRegionAuxiliary); + $expectedResponse->setPrimaryLocation($primaryLocation); + $expectedResponse->setSecondaryLocation($secondaryLocation); + $expectedResponse->setOriginalPrimaryLocation($originalPrimaryLocation); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new CreateReservationRequest()) + ->setParent($formattedParent); + $response = $gapicClient->createReservation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/CreateReservation', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createReservationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new CreateReservationRequest()) + ->setParent($formattedParent); + try { + $gapicClient->createReservation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAssignmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->assignmentName('[PROJECT]', '[LOCATION]', '[RESERVATION]', '[ASSIGNMENT]'); + $request = (new DeleteAssignmentRequest()) + ->setName($formattedName); + $gapicClient->deleteAssignment($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/DeleteAssignment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAssignmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->assignmentName('[PROJECT]', '[LOCATION]', '[RESERVATION]', '[ASSIGNMENT]'); + $request = (new DeleteAssignmentRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteAssignment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteCapacityCommitmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->capacityCommitmentName('[PROJECT]', '[LOCATION]', '[CAPACITY_COMMITMENT]'); + $request = (new DeleteCapacityCommitmentRequest()) + ->setName($formattedName); + $gapicClient->deleteCapacityCommitment($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/DeleteCapacityCommitment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteCapacityCommitmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->capacityCommitmentName('[PROJECT]', '[LOCATION]', '[CAPACITY_COMMITMENT]'); + $request = (new DeleteCapacityCommitmentRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteCapacityCommitment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteReservationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->reservationName('[PROJECT]', '[LOCATION]', '[RESERVATION]'); + $request = (new DeleteReservationRequest()) + ->setName($formattedName); + $gapicClient->deleteReservation($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/DeleteReservation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteReservationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->reservationName('[PROJECT]', '[LOCATION]', '[RESERVATION]'); + $request = (new DeleteReservationRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteReservation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function failoverReservationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $slotCapacity = 1516717605; + $ignoreIdleSlots = false; + $concurrency = 1476186003; + $multiRegionAuxiliary = false; + $primaryLocation = 'primaryLocation182084946'; + $secondaryLocation = 'secondaryLocation-1339637216'; + $originalPrimaryLocation = 'originalPrimaryLocation-1626473984'; + $expectedResponse = new Reservation(); + $expectedResponse->setName($name2); + $expectedResponse->setSlotCapacity($slotCapacity); + $expectedResponse->setIgnoreIdleSlots($ignoreIdleSlots); + $expectedResponse->setConcurrency($concurrency); + $expectedResponse->setMultiRegionAuxiliary($multiRegionAuxiliary); + $expectedResponse->setPrimaryLocation($primaryLocation); + $expectedResponse->setSecondaryLocation($secondaryLocation); + $expectedResponse->setOriginalPrimaryLocation($originalPrimaryLocation); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->reservationName('[PROJECT]', '[LOCATION]', '[RESERVATION]'); + $request = (new FailoverReservationRequest()) + ->setName($formattedName); + $response = $gapicClient->failoverReservation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/FailoverReservation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function failoverReservationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->reservationName('[PROJECT]', '[LOCATION]', '[RESERVATION]'); + $request = (new FailoverReservationRequest()) + ->setName($formattedName); + try { + $gapicClient->failoverReservation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBiReservationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $size = 3530753; + $expectedResponse = new BiReservation(); + $expectedResponse->setName($name2); + $expectedResponse->setSize($size); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->biReservationName('[PROJECT]', '[LOCATION]'); + $request = (new GetBiReservationRequest()) + ->setName($formattedName); + $response = $gapicClient->getBiReservation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/GetBiReservation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBiReservationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->biReservationName('[PROJECT]', '[LOCATION]'); + $request = (new GetBiReservationRequest()) + ->setName($formattedName); + try { + $gapicClient->getBiReservation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCapacityCommitmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $slotCount = 191518834; + $multiRegionAuxiliary = false; + $isFlatRate = false; + $expectedResponse = new CapacityCommitment(); + $expectedResponse->setName($name2); + $expectedResponse->setSlotCount($slotCount); + $expectedResponse->setMultiRegionAuxiliary($multiRegionAuxiliary); + $expectedResponse->setIsFlatRate($isFlatRate); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->capacityCommitmentName('[PROJECT]', '[LOCATION]', '[CAPACITY_COMMITMENT]'); + $request = (new GetCapacityCommitmentRequest()) + ->setName($formattedName); + $response = $gapicClient->getCapacityCommitment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/GetCapacityCommitment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCapacityCommitmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->capacityCommitmentName('[PROJECT]', '[LOCATION]', '[CAPACITY_COMMITMENT]'); + $request = (new GetCapacityCommitmentRequest()) + ->setName($formattedName); + try { + $gapicClient->getCapacityCommitment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getReservationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $slotCapacity = 1516717605; + $ignoreIdleSlots = false; + $concurrency = 1476186003; + $multiRegionAuxiliary = false; + $primaryLocation = 'primaryLocation182084946'; + $secondaryLocation = 'secondaryLocation-1339637216'; + $originalPrimaryLocation = 'originalPrimaryLocation-1626473984'; + $expectedResponse = new Reservation(); + $expectedResponse->setName($name2); + $expectedResponse->setSlotCapacity($slotCapacity); + $expectedResponse->setIgnoreIdleSlots($ignoreIdleSlots); + $expectedResponse->setConcurrency($concurrency); + $expectedResponse->setMultiRegionAuxiliary($multiRegionAuxiliary); + $expectedResponse->setPrimaryLocation($primaryLocation); + $expectedResponse->setSecondaryLocation($secondaryLocation); + $expectedResponse->setOriginalPrimaryLocation($originalPrimaryLocation); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->reservationName('[PROJECT]', '[LOCATION]', '[RESERVATION]'); + $request = (new GetReservationRequest()) + ->setName($formattedName); + $response = $gapicClient->getReservation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/GetReservation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getReservationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->reservationName('[PROJECT]', '[LOCATION]', '[RESERVATION]'); + $request = (new GetReservationRequest()) + ->setName($formattedName); + try { + $gapicClient->getReservation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAssignmentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $assignmentsElement = new Assignment(); + $assignments = [ + $assignmentsElement, + ]; + $expectedResponse = new ListAssignmentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAssignments($assignments); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->reservationName('[PROJECT]', '[LOCATION]', '[RESERVATION]'); + $request = (new ListAssignmentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listAssignments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAssignments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/ListAssignments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAssignmentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->reservationName('[PROJECT]', '[LOCATION]', '[RESERVATION]'); + $request = (new ListAssignmentsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listAssignments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCapacityCommitmentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $capacityCommitmentsElement = new CapacityCommitment(); + $capacityCommitments = [ + $capacityCommitmentsElement, + ]; + $expectedResponse = new ListCapacityCommitmentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCapacityCommitments($capacityCommitments); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListCapacityCommitmentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listCapacityCommitments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCapacityCommitments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/ListCapacityCommitments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCapacityCommitmentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListCapacityCommitmentsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listCapacityCommitments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listReservationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $reservationsElement = new Reservation(); + $reservations = [ + $reservationsElement, + ]; + $expectedResponse = new ListReservationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setReservations($reservations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListReservationsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listReservations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getReservations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/ListReservations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listReservationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListReservationsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listReservations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function mergeCapacityCommitmentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $slotCount = 191518834; + $multiRegionAuxiliary = false; + $isFlatRate = false; + $expectedResponse = new CapacityCommitment(); + $expectedResponse->setName($name); + $expectedResponse->setSlotCount($slotCount); + $expectedResponse->setMultiRegionAuxiliary($multiRegionAuxiliary); + $expectedResponse->setIsFlatRate($isFlatRate); + $transport->addResponse($expectedResponse); + $request = new MergeCapacityCommitmentsRequest(); + $response = $gapicClient->mergeCapacityCommitments($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/MergeCapacityCommitments', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function mergeCapacityCommitmentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new MergeCapacityCommitmentsRequest(); + try { + $gapicClient->mergeCapacityCommitments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function moveAssignmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $assignee = 'assignee-369881649'; + $expectedResponse = new Assignment(); + $expectedResponse->setName($name2); + $expectedResponse->setAssignee($assignee); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->assignmentName('[PROJECT]', '[LOCATION]', '[RESERVATION]', '[ASSIGNMENT]'); + $request = (new MoveAssignmentRequest()) + ->setName($formattedName); + $response = $gapicClient->moveAssignment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/MoveAssignment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function moveAssignmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->assignmentName('[PROJECT]', '[LOCATION]', '[RESERVATION]', '[ASSIGNMENT]'); + $request = (new MoveAssignmentRequest()) + ->setName($formattedName); + try { + $gapicClient->moveAssignment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchAllAssignmentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $assignmentsElement = new Assignment(); + $assignments = [ + $assignmentsElement, + ]; + $expectedResponse = new SearchAllAssignmentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAssignments($assignments); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new SearchAllAssignmentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->searchAllAssignments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAssignments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/SearchAllAssignments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchAllAssignmentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new SearchAllAssignmentsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->searchAllAssignments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchAssignmentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $assignmentsElement = new Assignment(); + $assignments = [ + $assignmentsElement, + ]; + $expectedResponse = new SearchAssignmentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAssignments($assignments); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new SearchAssignmentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->searchAssignments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAssignments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/SearchAssignments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchAssignmentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new SearchAssignmentsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->searchAssignments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function splitCapacityCommitmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SplitCapacityCommitmentResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->capacityCommitmentName('[PROJECT]', '[LOCATION]', '[CAPACITY_COMMITMENT]'); + $request = (new SplitCapacityCommitmentRequest()) + ->setName($formattedName); + $response = $gapicClient->splitCapacityCommitment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/SplitCapacityCommitment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function splitCapacityCommitmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->capacityCommitmentName('[PROJECT]', '[LOCATION]', '[CAPACITY_COMMITMENT]'); + $request = (new SplitCapacityCommitmentRequest()) + ->setName($formattedName); + try { + $gapicClient->splitCapacityCommitment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAssignmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $assignee = 'assignee-369881649'; + $expectedResponse = new Assignment(); + $expectedResponse->setName($name); + $expectedResponse->setAssignee($assignee); + $transport->addResponse($expectedResponse); + $request = new UpdateAssignmentRequest(); + $response = $gapicClient->updateAssignment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/UpdateAssignment', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAssignmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new UpdateAssignmentRequest(); + try { + $gapicClient->updateAssignment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateBiReservationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $size = 3530753; + $expectedResponse = new BiReservation(); + $expectedResponse->setName($name); + $expectedResponse->setSize($size); + $transport->addResponse($expectedResponse); + $request = new UpdateBiReservationRequest(); + $response = $gapicClient->updateBiReservation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/UpdateBiReservation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateBiReservationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new UpdateBiReservationRequest(); + try { + $gapicClient->updateBiReservation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateCapacityCommitmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $slotCount = 191518834; + $multiRegionAuxiliary = false; + $isFlatRate = false; + $expectedResponse = new CapacityCommitment(); + $expectedResponse->setName($name); + $expectedResponse->setSlotCount($slotCount); + $expectedResponse->setMultiRegionAuxiliary($multiRegionAuxiliary); + $expectedResponse->setIsFlatRate($isFlatRate); + $transport->addResponse($expectedResponse); + $request = new UpdateCapacityCommitmentRequest(); + $response = $gapicClient->updateCapacityCommitment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/UpdateCapacityCommitment', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateCapacityCommitmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new UpdateCapacityCommitmentRequest(); + try { + $gapicClient->updateCapacityCommitment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateReservationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $slotCapacity = 1516717605; + $ignoreIdleSlots = false; + $concurrency = 1476186003; + $multiRegionAuxiliary = false; + $primaryLocation = 'primaryLocation182084946'; + $secondaryLocation = 'secondaryLocation-1339637216'; + $originalPrimaryLocation = 'originalPrimaryLocation-1626473984'; + $expectedResponse = new Reservation(); + $expectedResponse->setName($name); + $expectedResponse->setSlotCapacity($slotCapacity); + $expectedResponse->setIgnoreIdleSlots($ignoreIdleSlots); + $expectedResponse->setConcurrency($concurrency); + $expectedResponse->setMultiRegionAuxiliary($multiRegionAuxiliary); + $expectedResponse->setPrimaryLocation($primaryLocation); + $expectedResponse->setSecondaryLocation($secondaryLocation); + $expectedResponse->setOriginalPrimaryLocation($originalPrimaryLocation); + $transport->addResponse($expectedResponse); + $request = new UpdateReservationRequest(); + $response = $gapicClient->updateReservation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/UpdateReservation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateReservationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new UpdateReservationRequest(); + try { + $gapicClient->updateReservation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createAssignmentAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $assignee = 'assignee-369881649'; + $expectedResponse = new Assignment(); + $expectedResponse->setName($name); + $expectedResponse->setAssignee($assignee); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->reservationName('[PROJECT]', '[LOCATION]', '[RESERVATION]'); + $request = (new CreateAssignmentRequest()) + ->setParent($formattedParent); + $response = $gapicClient->createAssignmentAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.reservation.v1.ReservationService/CreateAssignment', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Annotations.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Annotations.php new file mode 100644 index 000000000000..e94a47965444 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Annotations.php @@ -0,0 +1,27 @@ +internalAddGeneratedFile( + ' +Ã +2google/cloud/bigquery/storage/v1/annotations.proto google.cloud.bigquery.storage.v1 google/protobuf/descriptor.protoBÀ +$com.google.cloud.bigquery.storage.v1BAnnotationsProtoPZ>cloud.google.com/go/bigquery/storage/apiv1/storagepb;storagepbª Google.Cloud.BigQuery.Storage.V1Ê Google\\Cloud\\BigQuery\\Storage\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Arrow.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Arrow.php new file mode 100644 index 000000000000..c40bcd2e2975 Binary files /dev/null and b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Arrow.php differ diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Avro.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Avro.php new file mode 100644 index 000000000000..1c77c1dfbc3d --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Avro.php @@ -0,0 +1,35 @@ +internalAddGeneratedFile( + ' +· ++google/cloud/bigquery/storage/v1/avro.proto google.cloud.bigquery.storage.v1" + +AvroSchema +schema ( "A +AvroRows +serialized_binary_rows (  + row_count (B"A +AvroSerializationOptions% +enable_display_name_attribute (B¹ +$com.google.cloud.bigquery.storage.v1B AvroProtoPZ>cloud.google.com/go/bigquery/storage/apiv1/storagepb;storagepbª Google.Cloud.BigQuery.Storage.V1Ê Google\\Cloud\\BigQuery\\Storage\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Protobuf.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Protobuf.php new file mode 100644 index 000000000000..b136e094cddd --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Protobuf.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + ' +® +/google/cloud/bigquery/storage/v1/protobuf.proto google.cloud.bigquery.storage.v1 google/protobuf/descriptor.proto"I + ProtoSchema: +proto_descriptor ( 2 .google.protobuf.DescriptorProto"$ + ProtoRows +serialized_rows ( B½ +$com.google.cloud.bigquery.storage.v1B ProtoBufProtoPZ>cloud.google.com/go/bigquery/storage/apiv1/storagepb;storagepbª Google.Cloud.BigQuery.Storage.V1Ê Google\\Cloud\\BigQuery\\Storage\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Storage.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Storage.php new file mode 100644 index 000000000000..b6dc4a5859a8 Binary files /dev/null and b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Storage.php differ diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Stream.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Stream.php new file mode 100644 index 000000000000..6191c102b667 Binary files /dev/null and b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Stream.php differ diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Table.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Table.php new file mode 100644 index 000000000000..ee9b8d1dd02f Binary files /dev/null and b/owl-bot-staging/BigQueryStorage/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Storage/V1/Table.php differ diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest.php new file mode 100644 index 000000000000..0b1e665e3d46 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest.php @@ -0,0 +1,547 @@ +google.cloud.bigquery.storage.v1.AppendRowsRequest + */ +class AppendRowsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The write_stream identifies the append operation. It must be + * provided in the following scenarios: + * * In the first request to an AppendRows connection. + * * In all subsequent requests to an AppendRows connection, if you use the + * same connection to write to multiple tables or change the input schema for + * default streams. + * For explicitly created write streams, the format is: + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * For the special default stream, the format is: + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. + * An example of a possible sequence of requests with write_stream fields + * within a single connection: + * * r1: {write_stream: stream_name_1} + * * r2: {write_stream: /*omit*/} + * * r3: {write_stream: /*omit*/} + * * r4: {write_stream: stream_name_2} + * * r5: {write_stream: stream_name_2} + * The destination changed in request_4, so the write_stream field must be + * populated in all subsequent requests in this stream. + * + * Generated from protobuf field string write_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $write_stream = ''; + /** + * If present, the write is only performed if the next append offset is same + * as the provided value. If not present, the write is performed at the + * current end of stream. Specifying a value for this field is not allowed + * when calling AppendRows for the '_default' stream. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 2; + */ + protected $offset = null; + /** + * Id set by client to annotate its identity. Only initial request setting is + * respected. + * + * Generated from protobuf field string trace_id = 6; + */ + protected $trace_id = ''; + /** + * A map to indicate how to interpret missing value for some fields. Missing + * values are fields present in user schema but missing in rows. The key is + * the field name. The value is the interpretation of missing values for the + * field. + * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all + * missing values in field foo are interpreted as NULL, all missing values in + * field bar are interpreted as the default value of field bar in table + * schema. + * If a field is not in this map and has missing values, the missing values + * in this field are interpreted as NULL. + * This field only applies to the current request, it won't affect other + * requests on the connection. + * Currently, field name can only be top-level column name, can't be a struct + * field path like 'foo.bar'. + * + * Generated from protobuf field map missing_value_interpretations = 7; + */ + private $missing_value_interpretations; + /** + * Optional. Default missing value interpretation for all columns in the + * table. When a value is specified on an `AppendRowsRequest`, it is applied + * to all requests on the connection from that point forward, until a + * subsequent `AppendRowsRequest` sets it to a different value. + * `missing_value_interpretation` can override + * `default_missing_value_interpretation`. For example, if you want to write + * `NULL` instead of using default values for some columns, you can set + * `default_missing_value_interpretation` to `DEFAULT_VALUE` and at the same + * time, set `missing_value_interpretations` to `NULL_VALUE` on those columns. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation default_missing_value_interpretation = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $default_missing_value_interpretation = 0; + protected $rows; + + /** + * @param string $writeStream Required. The write_stream identifies the append operation. It must be + * provided in the following scenarios: + * + * * In the first request to an AppendRows connection. + * + * * In all subsequent requests to an AppendRows connection, if you use the + * same connection to write to multiple tables or change the input schema for + * default streams. + * + * For explicitly created write streams, the format is: + * + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * + * For the special default stream, the format is: + * + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. + * + * An example of a possible sequence of requests with write_stream fields + * within a single connection: + * + * * r1: {write_stream: stream_name_1} + * + * * r2: {write_stream: /*omit*/} + * + * * r3: {write_stream: /*omit*/} + * + * * r4: {write_stream: stream_name_2} + * + * * r5: {write_stream: stream_name_2} + * + * The destination changed in request_4, so the write_stream field must be + * populated in all subsequent requests in this stream. Please see + * {@see BigQueryWriteClient::writeStreamName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest + * + * @experimental + */ + public static function build(string $writeStream): self + { + return (new self()) + ->setWriteStream($writeStream); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $write_stream + * Required. The write_stream identifies the append operation. It must be + * provided in the following scenarios: + * * In the first request to an AppendRows connection. + * * In all subsequent requests to an AppendRows connection, if you use the + * same connection to write to multiple tables or change the input schema for + * default streams. + * For explicitly created write streams, the format is: + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * For the special default stream, the format is: + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. + * An example of a possible sequence of requests with write_stream fields + * within a single connection: + * * r1: {write_stream: stream_name_1} + * * r2: {write_stream: /*omit*/} + * * r3: {write_stream: /*omit*/} + * * r4: {write_stream: stream_name_2} + * * r5: {write_stream: stream_name_2} + * The destination changed in request_4, so the write_stream field must be + * populated in all subsequent requests in this stream. + * @type \Google\Protobuf\Int64Value $offset + * If present, the write is only performed if the next append offset is same + * as the provided value. If not present, the write is performed at the + * current end of stream. Specifying a value for this field is not allowed + * when calling AppendRows for the '_default' stream. + * @type \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ProtoData $proto_rows + * Rows in proto format. + * @type \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ArrowData $arrow_rows + * Rows in arrow format. This is an experimental feature only selected for + * allowlisted customers. + * @type string $trace_id + * Id set by client to annotate its identity. Only initial request setting is + * respected. + * @type array|\Google\Protobuf\Internal\MapField $missing_value_interpretations + * A map to indicate how to interpret missing value for some fields. Missing + * values are fields present in user schema but missing in rows. The key is + * the field name. The value is the interpretation of missing values for the + * field. + * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all + * missing values in field foo are interpreted as NULL, all missing values in + * field bar are interpreted as the default value of field bar in table + * schema. + * If a field is not in this map and has missing values, the missing values + * in this field are interpreted as NULL. + * This field only applies to the current request, it won't affect other + * requests on the connection. + * Currently, field name can only be top-level column name, can't be a struct + * field path like 'foo.bar'. + * @type int $default_missing_value_interpretation + * Optional. Default missing value interpretation for all columns in the + * table. When a value is specified on an `AppendRowsRequest`, it is applied + * to all requests on the connection from that point forward, until a + * subsequent `AppendRowsRequest` sets it to a different value. + * `missing_value_interpretation` can override + * `default_missing_value_interpretation`. For example, if you want to write + * `NULL` instead of using default values for some columns, you can set + * `default_missing_value_interpretation` to `DEFAULT_VALUE` and at the same + * time, set `missing_value_interpretations` to `NULL_VALUE` on those columns. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The write_stream identifies the append operation. It must be + * provided in the following scenarios: + * * In the first request to an AppendRows connection. + * * In all subsequent requests to an AppendRows connection, if you use the + * same connection to write to multiple tables or change the input schema for + * default streams. + * For explicitly created write streams, the format is: + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * For the special default stream, the format is: + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. + * An example of a possible sequence of requests with write_stream fields + * within a single connection: + * * r1: {write_stream: stream_name_1} + * * r2: {write_stream: /*omit*/} + * * r3: {write_stream: /*omit*/} + * * r4: {write_stream: stream_name_2} + * * r5: {write_stream: stream_name_2} + * The destination changed in request_4, so the write_stream field must be + * populated in all subsequent requests in this stream. + * + * Generated from protobuf field string write_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getWriteStream() + { + return $this->write_stream; + } + + /** + * Required. The write_stream identifies the append operation. It must be + * provided in the following scenarios: + * * In the first request to an AppendRows connection. + * * In all subsequent requests to an AppendRows connection, if you use the + * same connection to write to multiple tables or change the input schema for + * default streams. + * For explicitly created write streams, the format is: + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * For the special default stream, the format is: + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. + * An example of a possible sequence of requests with write_stream fields + * within a single connection: + * * r1: {write_stream: stream_name_1} + * * r2: {write_stream: /*omit*/} + * * r3: {write_stream: /*omit*/} + * * r4: {write_stream: stream_name_2} + * * r5: {write_stream: stream_name_2} + * The destination changed in request_4, so the write_stream field must be + * populated in all subsequent requests in this stream. + * + * Generated from protobuf field string write_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWriteStream($var) + { + GPBUtil::checkString($var, True); + $this->write_stream = $var; + + return $this; + } + + /** + * If present, the write is only performed if the next append offset is same + * as the provided value. If not present, the write is performed at the + * current end of stream. Specifying a value for this field is not allowed + * when calling AppendRows for the '_default' stream. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 2; + * @return \Google\Protobuf\Int64Value|null + */ + public function getOffset() + { + return $this->offset; + } + + public function hasOffset() + { + return isset($this->offset); + } + + public function clearOffset() + { + unset($this->offset); + } + + /** + * Returns the unboxed value from getOffset() + + * If present, the write is only performed if the next append offset is same + * as the provided value. If not present, the write is performed at the + * current end of stream. Specifying a value for this field is not allowed + * when calling AppendRows for the '_default' stream. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 2; + * @return int|string|null + */ + public function getOffsetUnwrapped() + { + return $this->readWrapperValue("offset"); + } + + /** + * If present, the write is only performed if the next append offset is same + * as the provided value. If not present, the write is performed at the + * current end of stream. Specifying a value for this field is not allowed + * when calling AppendRows for the '_default' stream. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 2; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->offset = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * If present, the write is only performed if the next append offset is same + * as the provided value. If not present, the write is performed at the + * current end of stream. Specifying a value for this field is not allowed + * when calling AppendRows for the '_default' stream. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 2; + * @param int|string|null $var + * @return $this + */ + public function setOffsetUnwrapped($var) + { + $this->writeWrapperValue("offset", $var); + return $this;} + + /** + * Rows in proto format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData proto_rows = 4; + * @return \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ProtoData|null + */ + public function getProtoRows() + { + return $this->readOneof(4); + } + + public function hasProtoRows() + { + return $this->hasOneof(4); + } + + /** + * Rows in proto format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData proto_rows = 4; + * @param \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ProtoData $var + * @return $this + */ + public function setProtoRows($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ProtoData::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Rows in arrow format. This is an experimental feature only selected for + * allowlisted customers. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AppendRowsRequest.ArrowData arrow_rows = 5; + * @return \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ArrowData|null + */ + public function getArrowRows() + { + return $this->readOneof(5); + } + + public function hasArrowRows() + { + return $this->hasOneof(5); + } + + /** + * Rows in arrow format. This is an experimental feature only selected for + * allowlisted customers. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AppendRowsRequest.ArrowData arrow_rows = 5; + * @param \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ArrowData $var + * @return $this + */ + public function setArrowRows($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ArrowData::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Id set by client to annotate its identity. Only initial request setting is + * respected. + * + * Generated from protobuf field string trace_id = 6; + * @return string + */ + public function getTraceId() + { + return $this->trace_id; + } + + /** + * Id set by client to annotate its identity. Only initial request setting is + * respected. + * + * Generated from protobuf field string trace_id = 6; + * @param string $var + * @return $this + */ + public function setTraceId($var) + { + GPBUtil::checkString($var, True); + $this->trace_id = $var; + + return $this; + } + + /** + * A map to indicate how to interpret missing value for some fields. Missing + * values are fields present in user schema but missing in rows. The key is + * the field name. The value is the interpretation of missing values for the + * field. + * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all + * missing values in field foo are interpreted as NULL, all missing values in + * field bar are interpreted as the default value of field bar in table + * schema. + * If a field is not in this map and has missing values, the missing values + * in this field are interpreted as NULL. + * This field only applies to the current request, it won't affect other + * requests on the connection. + * Currently, field name can only be top-level column name, can't be a struct + * field path like 'foo.bar'. + * + * Generated from protobuf field map missing_value_interpretations = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMissingValueInterpretations() + { + return $this->missing_value_interpretations; + } + + /** + * A map to indicate how to interpret missing value for some fields. Missing + * values are fields present in user schema but missing in rows. The key is + * the field name. The value is the interpretation of missing values for the + * field. + * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all + * missing values in field foo are interpreted as NULL, all missing values in + * field bar are interpreted as the default value of field bar in table + * schema. + * If a field is not in this map and has missing values, the missing values + * in this field are interpreted as NULL. + * This field only applies to the current request, it won't affect other + * requests on the connection. + * Currently, field name can only be top-level column name, can't be a struct + * field path like 'foo.bar'. + * + * Generated from protobuf field map missing_value_interpretations = 7; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMissingValueInterpretations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\MissingValueInterpretation::class); + $this->missing_value_interpretations = $arr; + + return $this; + } + + /** + * Optional. Default missing value interpretation for all columns in the + * table. When a value is specified on an `AppendRowsRequest`, it is applied + * to all requests on the connection from that point forward, until a + * subsequent `AppendRowsRequest` sets it to a different value. + * `missing_value_interpretation` can override + * `default_missing_value_interpretation`. For example, if you want to write + * `NULL` instead of using default values for some columns, you can set + * `default_missing_value_interpretation` to `DEFAULT_VALUE` and at the same + * time, set `missing_value_interpretations` to `NULL_VALUE` on those columns. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation default_missing_value_interpretation = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDefaultMissingValueInterpretation() + { + return $this->default_missing_value_interpretation; + } + + /** + * Optional. Default missing value interpretation for all columns in the + * table. When a value is specified on an `AppendRowsRequest`, it is applied + * to all requests on the connection from that point forward, until a + * subsequent `AppendRowsRequest` sets it to a different value. + * `missing_value_interpretation` can override + * `default_missing_value_interpretation`. For example, if you want to write + * `NULL` instead of using default values for some columns, you can set + * `default_missing_value_interpretation` to `DEFAULT_VALUE` and at the same + * time, set `missing_value_interpretations` to `NULL_VALUE` on those columns. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation default_missing_value_interpretation = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDefaultMissingValueInterpretation($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\MissingValueInterpretation::class); + $this->default_missing_value_interpretation = $var; + + return $this; + } + + /** + * @return string + */ + public function getRows() + { + return $this->whichOneof("rows"); + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest/ArrowData.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest/ArrowData.php new file mode 100644 index 000000000000..111dfc08c23d --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest/ArrowData.php @@ -0,0 +1,126 @@ +google.cloud.bigquery.storage.v1.AppendRowsRequest.ArrowData + */ +class ArrowData extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Arrow Schema used to serialize the data. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSchema writer_schema = 1; + */ + protected $writer_schema = null; + /** + * Required. Serialized row data in Arrow format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowRecordBatch rows = 2; + */ + protected $rows = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Storage\V1\ArrowSchema $writer_schema + * Optional. Arrow Schema used to serialize the data. + * @type \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch $rows + * Required. Serialized row data in Arrow format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Arrow Schema used to serialize the data. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSchema writer_schema = 1; + * @return \Google\Cloud\BigQuery\Storage\V1\ArrowSchema|null + */ + public function getWriterSchema() + { + return $this->writer_schema; + } + + public function hasWriterSchema() + { + return isset($this->writer_schema); + } + + public function clearWriterSchema() + { + unset($this->writer_schema); + } + + /** + * Optional. Arrow Schema used to serialize the data. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSchema writer_schema = 1; + * @param \Google\Cloud\BigQuery\Storage\V1\ArrowSchema $var + * @return $this + */ + public function setWriterSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ArrowSchema::class); + $this->writer_schema = $var; + + return $this; + } + + /** + * Required. Serialized row data in Arrow format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowRecordBatch rows = 2; + * @return \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch|null + */ + public function getRows() + { + return $this->rows; + } + + public function hasRows() + { + return isset($this->rows); + } + + public function clearRows() + { + unset($this->rows); + } + + /** + * Required. Serialized row data in Arrow format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowRecordBatch rows = 2; + * @param \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch $var + * @return $this + */ + public function setRows($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch::class); + $this->rows = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ArrowData::class, \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest_ArrowData::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest/MissingValueInterpretation.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest/MissingValueInterpretation.php new file mode 100644 index 000000000000..f5b70f6fd729 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest/MissingValueInterpretation.php @@ -0,0 +1,68 @@ +google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation + */ +class MissingValueInterpretation +{ + /** + * Invalid missing value interpretation. Requests with this value will be + * rejected. + * + * Generated from protobuf enum MISSING_VALUE_INTERPRETATION_UNSPECIFIED = 0; + */ + const MISSING_VALUE_INTERPRETATION_UNSPECIFIED = 0; + /** + * Missing value is interpreted as NULL. + * + * Generated from protobuf enum NULL_VALUE = 1; + */ + const NULL_VALUE = 1; + /** + * Missing value is interpreted as column default value if declared in the + * table schema, NULL otherwise. + * + * Generated from protobuf enum DEFAULT_VALUE = 2; + */ + const DEFAULT_VALUE = 2; + + private static $valueToName = [ + self::MISSING_VALUE_INTERPRETATION_UNSPECIFIED => 'MISSING_VALUE_INTERPRETATION_UNSPECIFIED', + self::NULL_VALUE => 'NULL_VALUE', + self::DEFAULT_VALUE => 'DEFAULT_VALUE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MissingValueInterpretation::class, \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest_MissingValueInterpretation::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest/ProtoData.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest/ProtoData.php new file mode 100644 index 000000000000..d9dd9af3d1a5 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsRequest/ProtoData.php @@ -0,0 +1,153 @@ +google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData + */ +class ProtoData extends \Google\Protobuf\Internal\Message +{ + /** + * The protocol buffer schema used to serialize the data. Provide this value + * whenever: + * * You send the first request of an RPC connection. + * * You change the input schema. + * * You specify a new destination table. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ProtoSchema writer_schema = 1; + */ + protected $writer_schema = null; + /** + * Serialized row data in protobuf message format. + * Currently, the backend expects the serialized rows to adhere to + * proto2 semantics when appending rows, particularly with respect to + * how default values are encoded. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ProtoRows rows = 2; + */ + protected $rows = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Storage\V1\ProtoSchema $writer_schema + * The protocol buffer schema used to serialize the data. Provide this value + * whenever: + * * You send the first request of an RPC connection. + * * You change the input schema. + * * You specify a new destination table. + * @type \Google\Cloud\BigQuery\Storage\V1\ProtoRows $rows + * Serialized row data in protobuf message format. + * Currently, the backend expects the serialized rows to adhere to + * proto2 semantics when appending rows, particularly with respect to + * how default values are encoded. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * The protocol buffer schema used to serialize the data. Provide this value + * whenever: + * * You send the first request of an RPC connection. + * * You change the input schema. + * * You specify a new destination table. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ProtoSchema writer_schema = 1; + * @return \Google\Cloud\BigQuery\Storage\V1\ProtoSchema|null + */ + public function getWriterSchema() + { + return $this->writer_schema; + } + + public function hasWriterSchema() + { + return isset($this->writer_schema); + } + + public function clearWriterSchema() + { + unset($this->writer_schema); + } + + /** + * The protocol buffer schema used to serialize the data. Provide this value + * whenever: + * * You send the first request of an RPC connection. + * * You change the input schema. + * * You specify a new destination table. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ProtoSchema writer_schema = 1; + * @param \Google\Cloud\BigQuery\Storage\V1\ProtoSchema $var + * @return $this + */ + public function setWriterSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ProtoSchema::class); + $this->writer_schema = $var; + + return $this; + } + + /** + * Serialized row data in protobuf message format. + * Currently, the backend expects the serialized rows to adhere to + * proto2 semantics when appending rows, particularly with respect to + * how default values are encoded. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ProtoRows rows = 2; + * @return \Google\Cloud\BigQuery\Storage\V1\ProtoRows|null + */ + public function getRows() + { + return $this->rows; + } + + public function hasRows() + { + return isset($this->rows); + } + + public function clearRows() + { + unset($this->rows); + } + + /** + * Serialized row data in protobuf message format. + * Currently, the backend expects the serialized rows to adhere to + * proto2 semantics when appending rows, particularly with respect to + * how default values are encoded. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ProtoRows rows = 2; + * @param \Google\Cloud\BigQuery\Storage\V1\ProtoRows $var + * @return $this + */ + public function setRows($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ProtoRows::class); + $this->rows = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProtoData::class, \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest_ProtoData::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsResponse.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsResponse.php new file mode 100644 index 000000000000..0b2fff4bf05a --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsResponse.php @@ -0,0 +1,279 @@ +google.cloud.bigquery.storage.v1.AppendRowsResponse + */ +class AppendRowsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * If backend detects a schema update, pass it to user so that user can + * use it to input new type of message. It will be empty when no schema + * updates have occurred. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableSchema updated_schema = 3; + */ + protected $updated_schema = null; + /** + * If a request failed due to corrupted rows, no rows in the batch will be + * appended. The API will return row level error info, so that the caller can + * remove the bad rows and retry the request. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.RowError row_errors = 4; + */ + private $row_errors; + /** + * The target of the append operation. Matches the write_stream in the + * corresponding request. + * + * Generated from protobuf field string write_stream = 5; + */ + protected $write_stream = ''; + protected $response; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Storage\V1\AppendRowsResponse\AppendResult $append_result + * Result if the append is successful. + * @type \Google\Rpc\Status $error + * Error returned when problems were encountered. If present, + * it indicates rows were not accepted into the system. + * Users can retry or continue with other append requests within the + * same connection. + * Additional information about error signalling: + * ALREADY_EXISTS: Happens when an append specified an offset, and the + * backend already has received data at this offset. Typically encountered + * in retry scenarios, and can be ignored. + * OUT_OF_RANGE: Returned when the specified offset in the stream is beyond + * the current end of the stream. + * INVALID_ARGUMENT: Indicates a malformed request or data. + * ABORTED: Request processing is aborted because of prior failures. The + * request can be retried if previous failure is addressed. + * INTERNAL: Indicates server side error(s) that can be retried. + * @type \Google\Cloud\BigQuery\Storage\V1\TableSchema $updated_schema + * If backend detects a schema update, pass it to user so that user can + * use it to input new type of message. It will be empty when no schema + * updates have occurred. + * @type array<\Google\Cloud\BigQuery\Storage\V1\RowError>|\Google\Protobuf\Internal\RepeatedField $row_errors + * If a request failed due to corrupted rows, no rows in the batch will be + * appended. The API will return row level error info, so that the caller can + * remove the bad rows and retry the request. + * @type string $write_stream + * The target of the append operation. Matches the write_stream in the + * corresponding request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Result if the append is successful. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult append_result = 1; + * @return \Google\Cloud\BigQuery\Storage\V1\AppendRowsResponse\AppendResult|null + */ + public function getAppendResult() + { + return $this->readOneof(1); + } + + public function hasAppendResult() + { + return $this->hasOneof(1); + } + + /** + * Result if the append is successful. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult append_result = 1; + * @param \Google\Cloud\BigQuery\Storage\V1\AppendRowsResponse\AppendResult $var + * @return $this + */ + public function setAppendResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\AppendRowsResponse\AppendResult::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Error returned when problems were encountered. If present, + * it indicates rows were not accepted into the system. + * Users can retry or continue with other append requests within the + * same connection. + * Additional information about error signalling: + * ALREADY_EXISTS: Happens when an append specified an offset, and the + * backend already has received data at this offset. Typically encountered + * in retry scenarios, and can be ignored. + * OUT_OF_RANGE: Returned when the specified offset in the stream is beyond + * the current end of the stream. + * INVALID_ARGUMENT: Indicates a malformed request or data. + * ABORTED: Request processing is aborted because of prior failures. The + * request can be retried if previous failure is addressed. + * INTERNAL: Indicates server side error(s) that can be retried. + * + * Generated from protobuf field .google.rpc.Status error = 2; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->readOneof(2); + } + + public function hasError() + { + return $this->hasOneof(2); + } + + /** + * Error returned when problems were encountered. If present, + * it indicates rows were not accepted into the system. + * Users can retry or continue with other append requests within the + * same connection. + * Additional information about error signalling: + * ALREADY_EXISTS: Happens when an append specified an offset, and the + * backend already has received data at this offset. Typically encountered + * in retry scenarios, and can be ignored. + * OUT_OF_RANGE: Returned when the specified offset in the stream is beyond + * the current end of the stream. + * INVALID_ARGUMENT: Indicates a malformed request or data. + * ABORTED: Request processing is aborted because of prior failures. The + * request can be retried if previous failure is addressed. + * INTERNAL: Indicates server side error(s) that can be retried. + * + * Generated from protobuf field .google.rpc.Status error = 2; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * If backend detects a schema update, pass it to user so that user can + * use it to input new type of message. It will be empty when no schema + * updates have occurred. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableSchema updated_schema = 3; + * @return \Google\Cloud\BigQuery\Storage\V1\TableSchema|null + */ + public function getUpdatedSchema() + { + return $this->updated_schema; + } + + public function hasUpdatedSchema() + { + return isset($this->updated_schema); + } + + public function clearUpdatedSchema() + { + unset($this->updated_schema); + } + + /** + * If backend detects a schema update, pass it to user so that user can + * use it to input new type of message. It will be empty when no schema + * updates have occurred. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableSchema updated_schema = 3; + * @param \Google\Cloud\BigQuery\Storage\V1\TableSchema $var + * @return $this + */ + public function setUpdatedSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\TableSchema::class); + $this->updated_schema = $var; + + return $this; + } + + /** + * If a request failed due to corrupted rows, no rows in the batch will be + * appended. The API will return row level error info, so that the caller can + * remove the bad rows and retry the request. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.RowError row_errors = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRowErrors() + { + return $this->row_errors; + } + + /** + * If a request failed due to corrupted rows, no rows in the batch will be + * appended. The API will return row level error info, so that the caller can + * remove the bad rows and retry the request. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.RowError row_errors = 4; + * @param array<\Google\Cloud\BigQuery\Storage\V1\RowError>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRowErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Storage\V1\RowError::class); + $this->row_errors = $arr; + + return $this; + } + + /** + * The target of the append operation. Matches the write_stream in the + * corresponding request. + * + * Generated from protobuf field string write_stream = 5; + * @return string + */ + public function getWriteStream() + { + return $this->write_stream; + } + + /** + * The target of the append operation. Matches the write_stream in the + * corresponding request. + * + * Generated from protobuf field string write_stream = 5; + * @param string $var + * @return $this + */ + public function setWriteStream($var) + { + GPBUtil::checkString($var, True); + $this->write_stream = $var; + + return $this; + } + + /** + * @return string + */ + public function getResponse() + { + return $this->whichOneof("response"); + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsResponse/AppendResult.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsResponse/AppendResult.php new file mode 100644 index 000000000000..62d0e99a8d29 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AppendRowsResponse/AppendResult.php @@ -0,0 +1,113 @@ +google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult + */ +class AppendResult extends \Google\Protobuf\Internal\Message +{ + /** + * The row offset at which the last append occurred. The offset will not be + * set if appending using default streams. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 1; + */ + protected $offset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Int64Value $offset + * The row offset at which the last append occurred. The offset will not be + * set if appending using default streams. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * The row offset at which the last append occurred. The offset will not be + * set if appending using default streams. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 1; + * @return \Google\Protobuf\Int64Value|null + */ + public function getOffset() + { + return $this->offset; + } + + public function hasOffset() + { + return isset($this->offset); + } + + public function clearOffset() + { + unset($this->offset); + } + + /** + * Returns the unboxed value from getOffset() + + * The row offset at which the last append occurred. The offset will not be + * set if appending using default streams. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 1; + * @return int|string|null + */ + public function getOffsetUnwrapped() + { + return $this->readWrapperValue("offset"); + } + + /** + * The row offset at which the last append occurred. The offset will not be + * set if appending using default streams. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 1; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->offset = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * The row offset at which the last append occurred. The offset will not be + * set if appending using default streams. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 1; + * @param int|string|null $var + * @return $this + */ + public function setOffsetUnwrapped($var) + { + $this->writeWrapperValue("offset", $var); + return $this;} + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AppendResult::class, \Google\Cloud\BigQuery\Storage\V1\AppendRowsResponse_AppendResult::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowRecordBatch.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowRecordBatch.php new file mode 100644 index 000000000000..96ecf21ef673 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowRecordBatch.php @@ -0,0 +1,110 @@ +google.cloud.bigquery.storage.v1.ArrowRecordBatch + */ +class ArrowRecordBatch extends \Google\Protobuf\Internal\Message +{ + /** + * IPC-serialized Arrow RecordBatch. + * + * Generated from protobuf field bytes serialized_record_batch = 1; + */ + protected $serialized_record_batch = ''; + /** + * [Deprecated] The count of rows in `serialized_record_batch`. + * Please use the format-independent ReadRowsResponse.row_count instead. + * + * Generated from protobuf field int64 row_count = 2 [deprecated = true]; + * @deprecated + */ + protected $row_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $serialized_record_batch + * IPC-serialized Arrow RecordBatch. + * @type int|string $row_count + * [Deprecated] The count of rows in `serialized_record_batch`. + * Please use the format-independent ReadRowsResponse.row_count instead. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Arrow::initOnce(); + parent::__construct($data); + } + + /** + * IPC-serialized Arrow RecordBatch. + * + * Generated from protobuf field bytes serialized_record_batch = 1; + * @return string + */ + public function getSerializedRecordBatch() + { + return $this->serialized_record_batch; + } + + /** + * IPC-serialized Arrow RecordBatch. + * + * Generated from protobuf field bytes serialized_record_batch = 1; + * @param string $var + * @return $this + */ + public function setSerializedRecordBatch($var) + { + GPBUtil::checkString($var, False); + $this->serialized_record_batch = $var; + + return $this; + } + + /** + * [Deprecated] The count of rows in `serialized_record_batch`. + * Please use the format-independent ReadRowsResponse.row_count instead. + * + * Generated from protobuf field int64 row_count = 2 [deprecated = true]; + * @return int|string + * @deprecated + */ + public function getRowCount() + { + @trigger_error('row_count is deprecated.', E_USER_DEPRECATED); + return $this->row_count; + } + + /** + * [Deprecated] The count of rows in `serialized_record_batch`. + * Please use the format-independent ReadRowsResponse.row_count instead. + * + * Generated from protobuf field int64 row_count = 2 [deprecated = true]; + * @param int|string $var + * @return $this + * @deprecated + */ + public function setRowCount($var) + { + @trigger_error('row_count is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkInt64($var); + $this->row_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowSchema.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowSchema.php new file mode 100644 index 000000000000..0e081bad2c8d --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowSchema.php @@ -0,0 +1,71 @@ +google.cloud.bigquery.storage.v1.ArrowSchema + */ +class ArrowSchema extends \Google\Protobuf\Internal\Message +{ + /** + * IPC serialized Arrow schema. + * + * Generated from protobuf field bytes serialized_schema = 1; + */ + protected $serialized_schema = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $serialized_schema + * IPC serialized Arrow schema. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Arrow::initOnce(); + parent::__construct($data); + } + + /** + * IPC serialized Arrow schema. + * + * Generated from protobuf field bytes serialized_schema = 1; + * @return string + */ + public function getSerializedSchema() + { + return $this->serialized_schema; + } + + /** + * IPC serialized Arrow schema. + * + * Generated from protobuf field bytes serialized_schema = 1; + * @param string $var + * @return $this + */ + public function setSerializedSchema($var) + { + GPBUtil::checkString($var, False); + $this->serialized_schema = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowSerializationOptions.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowSerializationOptions.php new file mode 100644 index 000000000000..9cbf862501c9 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowSerializationOptions.php @@ -0,0 +1,71 @@ +google.cloud.bigquery.storage.v1.ArrowSerializationOptions + */ +class ArrowSerializationOptions extends \Google\Protobuf\Internal\Message +{ + /** + * The compression codec to use for Arrow buffers in serialized record + * batches. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec buffer_compression = 2; + */ + protected $buffer_compression = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $buffer_compression + * The compression codec to use for Arrow buffers in serialized record + * batches. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Arrow::initOnce(); + parent::__construct($data); + } + + /** + * The compression codec to use for Arrow buffers in serialized record + * batches. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec buffer_compression = 2; + * @return int + */ + public function getBufferCompression() + { + return $this->buffer_compression; + } + + /** + * The compression codec to use for Arrow buffers in serialized record + * batches. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec buffer_compression = 2; + * @param int $var + * @return $this + */ + public function setBufferCompression($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\ArrowSerializationOptions\CompressionCodec::class); + $this->buffer_compression = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowSerializationOptions/CompressionCodec.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowSerializationOptions/CompressionCodec.php new file mode 100644 index 000000000000..08496a159dfe --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ArrowSerializationOptions/CompressionCodec.php @@ -0,0 +1,64 @@ +google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec + */ +class CompressionCodec +{ + /** + * If unspecified no compression will be used. + * + * Generated from protobuf enum COMPRESSION_UNSPECIFIED = 0; + */ + const COMPRESSION_UNSPECIFIED = 0; + /** + * LZ4 Frame (https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md) + * + * Generated from protobuf enum LZ4_FRAME = 1; + */ + const LZ4_FRAME = 1; + /** + * Zstandard compression. + * + * Generated from protobuf enum ZSTD = 2; + */ + const ZSTD = 2; + + private static $valueToName = [ + self::COMPRESSION_UNSPECIFIED => 'COMPRESSION_UNSPECIFIED', + self::LZ4_FRAME => 'LZ4_FRAME', + self::ZSTD => 'ZSTD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CompressionCodec::class, \Google\Cloud\BigQuery\Storage\V1\ArrowSerializationOptions_CompressionCodec::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AvroRows.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AvroRows.php new file mode 100644 index 000000000000..95057dfc33ed --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AvroRows.php @@ -0,0 +1,110 @@ +google.cloud.bigquery.storage.v1.AvroRows + */ +class AvroRows extends \Google\Protobuf\Internal\Message +{ + /** + * Binary serialized rows in a block. + * + * Generated from protobuf field bytes serialized_binary_rows = 1; + */ + protected $serialized_binary_rows = ''; + /** + * [Deprecated] The count of rows in the returning block. + * Please use the format-independent ReadRowsResponse.row_count instead. + * + * Generated from protobuf field int64 row_count = 2 [deprecated = true]; + * @deprecated + */ + protected $row_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $serialized_binary_rows + * Binary serialized rows in a block. + * @type int|string $row_count + * [Deprecated] The count of rows in the returning block. + * Please use the format-independent ReadRowsResponse.row_count instead. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Avro::initOnce(); + parent::__construct($data); + } + + /** + * Binary serialized rows in a block. + * + * Generated from protobuf field bytes serialized_binary_rows = 1; + * @return string + */ + public function getSerializedBinaryRows() + { + return $this->serialized_binary_rows; + } + + /** + * Binary serialized rows in a block. + * + * Generated from protobuf field bytes serialized_binary_rows = 1; + * @param string $var + * @return $this + */ + public function setSerializedBinaryRows($var) + { + GPBUtil::checkString($var, False); + $this->serialized_binary_rows = $var; + + return $this; + } + + /** + * [Deprecated] The count of rows in the returning block. + * Please use the format-independent ReadRowsResponse.row_count instead. + * + * Generated from protobuf field int64 row_count = 2 [deprecated = true]; + * @return int|string + * @deprecated + */ + public function getRowCount() + { + @trigger_error('row_count is deprecated.', E_USER_DEPRECATED); + return $this->row_count; + } + + /** + * [Deprecated] The count of rows in the returning block. + * Please use the format-independent ReadRowsResponse.row_count instead. + * + * Generated from protobuf field int64 row_count = 2 [deprecated = true]; + * @param int|string $var + * @return $this + * @deprecated + */ + public function setRowCount($var) + { + @trigger_error('row_count is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkInt64($var); + $this->row_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AvroSchema.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AvroSchema.php new file mode 100644 index 000000000000..95f031edf513 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AvroSchema.php @@ -0,0 +1,71 @@ +google.cloud.bigquery.storage.v1.AvroSchema + */ +class AvroSchema extends \Google\Protobuf\Internal\Message +{ + /** + * Json serialized schema, as described at + * https://avro.apache.org/docs/1.8.1/spec.html. + * + * Generated from protobuf field string schema = 1; + */ + protected $schema = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $schema + * Json serialized schema, as described at + * https://avro.apache.org/docs/1.8.1/spec.html. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Avro::initOnce(); + parent::__construct($data); + } + + /** + * Json serialized schema, as described at + * https://avro.apache.org/docs/1.8.1/spec.html. + * + * Generated from protobuf field string schema = 1; + * @return string + */ + public function getSchema() + { + return $this->schema; + } + + /** + * Json serialized schema, as described at + * https://avro.apache.org/docs/1.8.1/spec.html. + * + * Generated from protobuf field string schema = 1; + * @param string $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkString($var, True); + $this->schema = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AvroSerializationOptions.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AvroSerializationOptions.php new file mode 100644 index 000000000000..a144d2b4e6b0 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/AvroSerializationOptions.php @@ -0,0 +1,95 @@ +google.cloud.bigquery.storage.v1.AvroSerializationOptions + */ +class AvroSerializationOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Enable displayName attribute in Avro schema. + * The Avro specification requires field names to be alphanumeric. By + * default, in cases when column names do not conform to these requirements + * (e.g. non-ascii unicode codepoints) and Avro is requested as an output + * format, the CreateReadSession call will fail. + * Setting this field to true, populates avro field names with a placeholder + * value and populates a "displayName" attribute for every avro field with the + * original column name. + * + * Generated from protobuf field bool enable_display_name_attribute = 1; + */ + protected $enable_display_name_attribute = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_display_name_attribute + * Enable displayName attribute in Avro schema. + * The Avro specification requires field names to be alphanumeric. By + * default, in cases when column names do not conform to these requirements + * (e.g. non-ascii unicode codepoints) and Avro is requested as an output + * format, the CreateReadSession call will fail. + * Setting this field to true, populates avro field names with a placeholder + * value and populates a "displayName" attribute for every avro field with the + * original column name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Avro::initOnce(); + parent::__construct($data); + } + + /** + * Enable displayName attribute in Avro schema. + * The Avro specification requires field names to be alphanumeric. By + * default, in cases when column names do not conform to these requirements + * (e.g. non-ascii unicode codepoints) and Avro is requested as an output + * format, the CreateReadSession call will fail. + * Setting this field to true, populates avro field names with a placeholder + * value and populates a "displayName" attribute for every avro field with the + * original column name. + * + * Generated from protobuf field bool enable_display_name_attribute = 1; + * @return bool + */ + public function getEnableDisplayNameAttribute() + { + return $this->enable_display_name_attribute; + } + + /** + * Enable displayName attribute in Avro schema. + * The Avro specification requires field names to be alphanumeric. By + * default, in cases when column names do not conform to these requirements + * (e.g. non-ascii unicode codepoints) and Avro is requested as an output + * format, the CreateReadSession call will fail. + * Setting this field to true, populates avro field names with a placeholder + * value and populates a "displayName" attribute for every avro field with the + * original column name. + * + * Generated from protobuf field bool enable_display_name_attribute = 1; + * @param bool $var + * @return $this + */ + public function setEnableDisplayNameAttribute($var) + { + GPBUtil::checkBool($var); + $this->enable_display_name_attribute = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/BatchCommitWriteStreamsRequest.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/BatchCommitWriteStreamsRequest.php new file mode 100644 index 000000000000..50e1addd8cf0 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/BatchCommitWriteStreamsRequest.php @@ -0,0 +1,120 @@ +google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest + */ +class BatchCommitWriteStreamsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent table that all the streams should belong to, in the form + * of `projects/{project}/datasets/{dataset}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The group of streams that will be committed atomically. + * + * Generated from protobuf field repeated string write_streams = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $write_streams; + + /** + * @param string $parent Required. Parent table that all the streams should belong to, in the form + * of `projects/{project}/datasets/{dataset}/tables/{table}`. Please see + * {@see BigQueryWriteClient::tableName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Storage\V1\BatchCommitWriteStreamsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent table that all the streams should belong to, in the form + * of `projects/{project}/datasets/{dataset}/tables/{table}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $write_streams + * Required. The group of streams that will be committed atomically. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent table that all the streams should belong to, in the form + * of `projects/{project}/datasets/{dataset}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent table that all the streams should belong to, in the form + * of `projects/{project}/datasets/{dataset}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The group of streams that will be committed atomically. + * + * Generated from protobuf field repeated string write_streams = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWriteStreams() + { + return $this->write_streams; + } + + /** + * Required. The group of streams that will be committed atomically. + * + * Generated from protobuf field repeated string write_streams = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWriteStreams($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->write_streams = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/BatchCommitWriteStreamsResponse.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/BatchCommitWriteStreamsResponse.php new file mode 100644 index 000000000000..a3647346dc3b --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/BatchCommitWriteStreamsResponse.php @@ -0,0 +1,135 @@ +google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse + */ +class BatchCommitWriteStreamsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The time at which streams were committed in microseconds granularity. + * This field will only exist when there are no stream errors. + * **Note** if this field is not set, it means the commit was not successful. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 1; + */ + protected $commit_time = null; + /** + * Stream level error if commit failed. Only streams with error will be in + * the list. + * If empty, there is no error and all streams are committed successfully. + * If non empty, certain streams have errors and ZERO stream is committed due + * to atomicity guarantee. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.StorageError stream_errors = 2; + */ + private $stream_errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $commit_time + * The time at which streams were committed in microseconds granularity. + * This field will only exist when there are no stream errors. + * **Note** if this field is not set, it means the commit was not successful. + * @type array<\Google\Cloud\BigQuery\Storage\V1\StorageError>|\Google\Protobuf\Internal\RepeatedField $stream_errors + * Stream level error if commit failed. Only streams with error will be in + * the list. + * If empty, there is no error and all streams are committed successfully. + * If non empty, certain streams have errors and ZERO stream is committed due + * to atomicity guarantee. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * The time at which streams were committed in microseconds granularity. + * This field will only exist when there are no stream errors. + * **Note** if this field is not set, it means the commit was not successful. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCommitTime() + { + return $this->commit_time; + } + + public function hasCommitTime() + { + return isset($this->commit_time); + } + + public function clearCommitTime() + { + unset($this->commit_time); + } + + /** + * The time at which streams were committed in microseconds granularity. + * This field will only exist when there are no stream errors. + * **Note** if this field is not set, it means the commit was not successful. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCommitTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->commit_time = $var; + + return $this; + } + + /** + * Stream level error if commit failed. Only streams with error will be in + * the list. + * If empty, there is no error and all streams are committed successfully. + * If non empty, certain streams have errors and ZERO stream is committed due + * to atomicity guarantee. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.StorageError stream_errors = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStreamErrors() + { + return $this->stream_errors; + } + + /** + * Stream level error if commit failed. Only streams with error will be in + * the list. + * If empty, there is no error and all streams are committed successfully. + * If non empty, certain streams have errors and ZERO stream is committed due + * to atomicity guarantee. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.StorageError stream_errors = 2; + * @param array<\Google\Cloud\BigQuery\Storage\V1\StorageError>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStreamErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Storage\V1\StorageError::class); + $this->stream_errors = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/CreateReadSessionRequest.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/CreateReadSessionRequest.php new file mode 100644 index 000000000000..b27b6f13ecc3 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/CreateReadSessionRequest.php @@ -0,0 +1,267 @@ +google.cloud.bigquery.storage.v1.CreateReadSessionRequest + */ +class CreateReadSessionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The request project that owns the session, in the form of + * `projects/{project_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Session to be created. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $read_session = null; + /** + * Max initial number of streams. If unset or zero, the server will + * provide a value of streams so as to produce reasonable throughput. Must be + * non-negative. The number of streams may be lower than the requested number, + * depending on the amount parallelism that is reasonable for the table. + * There is a default system max limit of 1,000. + * This must be greater than or equal to preferred_min_stream_count. + * Typically, clients should either leave this unset to let the system to + * determine an upper bound OR set this a size for the maximum "units of work" + * it can gracefully handle. + * + * Generated from protobuf field int32 max_stream_count = 3; + */ + protected $max_stream_count = 0; + /** + * The minimum preferred stream count. This parameter can be used to inform + * the service that there is a desired lower bound on the number of streams. + * This is typically a target parallelism of the client (e.g. a Spark + * cluster with N-workers would set this to a low multiple of N to ensure + * good cluster utilization). + * The system will make a best effort to provide at least this number of + * streams, but in some cases might provide less. + * + * Generated from protobuf field int32 preferred_min_stream_count = 4; + */ + protected $preferred_min_stream_count = 0; + + /** + * @param string $parent Required. The request project that owns the session, in the form of + * `projects/{project_id}`. Please see + * {@see BigQueryReadClient::projectName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\Storage\V1\ReadSession $readSession Required. Session to be created. + * @param int $maxStreamCount Max initial number of streams. If unset or zero, the server will + * provide a value of streams so as to produce reasonable throughput. Must be + * non-negative. The number of streams may be lower than the requested number, + * depending on the amount parallelism that is reasonable for the table. + * There is a default system max limit of 1,000. + * + * This must be greater than or equal to preferred_min_stream_count. + * Typically, clients should either leave this unset to let the system to + * determine an upper bound OR set this a size for the maximum "units of work" + * it can gracefully handle. + * + * @return \Google\Cloud\BigQuery\Storage\V1\CreateReadSessionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\Storage\V1\ReadSession $readSession, int $maxStreamCount): self + { + return (new self()) + ->setParent($parent) + ->setReadSession($readSession) + ->setMaxStreamCount($maxStreamCount); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The request project that owns the session, in the form of + * `projects/{project_id}`. + * @type \Google\Cloud\BigQuery\Storage\V1\ReadSession $read_session + * Required. Session to be created. + * @type int $max_stream_count + * Max initial number of streams. If unset or zero, the server will + * provide a value of streams so as to produce reasonable throughput. Must be + * non-negative. The number of streams may be lower than the requested number, + * depending on the amount parallelism that is reasonable for the table. + * There is a default system max limit of 1,000. + * This must be greater than or equal to preferred_min_stream_count. + * Typically, clients should either leave this unset to let the system to + * determine an upper bound OR set this a size for the maximum "units of work" + * it can gracefully handle. + * @type int $preferred_min_stream_count + * The minimum preferred stream count. This parameter can be used to inform + * the service that there is a desired lower bound on the number of streams. + * This is typically a target parallelism of the client (e.g. a Spark + * cluster with N-workers would set this to a low multiple of N to ensure + * good cluster utilization). + * The system will make a best effort to provide at least this number of + * streams, but in some cases might provide less. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The request project that owns the session, in the form of + * `projects/{project_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The request project that owns the session, in the form of + * `projects/{project_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Session to be created. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\Storage\V1\ReadSession|null + */ + public function getReadSession() + { + return $this->read_session; + } + + public function hasReadSession() + { + return isset($this->read_session); + } + + public function clearReadSession() + { + unset($this->read_session); + } + + /** + * Required. Session to be created. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\Storage\V1\ReadSession $var + * @return $this + */ + public function setReadSession($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ReadSession::class); + $this->read_session = $var; + + return $this; + } + + /** + * Max initial number of streams. If unset or zero, the server will + * provide a value of streams so as to produce reasonable throughput. Must be + * non-negative. The number of streams may be lower than the requested number, + * depending on the amount parallelism that is reasonable for the table. + * There is a default system max limit of 1,000. + * This must be greater than or equal to preferred_min_stream_count. + * Typically, clients should either leave this unset to let the system to + * determine an upper bound OR set this a size for the maximum "units of work" + * it can gracefully handle. + * + * Generated from protobuf field int32 max_stream_count = 3; + * @return int + */ + public function getMaxStreamCount() + { + return $this->max_stream_count; + } + + /** + * Max initial number of streams. If unset or zero, the server will + * provide a value of streams so as to produce reasonable throughput. Must be + * non-negative. The number of streams may be lower than the requested number, + * depending on the amount parallelism that is reasonable for the table. + * There is a default system max limit of 1,000. + * This must be greater than or equal to preferred_min_stream_count. + * Typically, clients should either leave this unset to let the system to + * determine an upper bound OR set this a size for the maximum "units of work" + * it can gracefully handle. + * + * Generated from protobuf field int32 max_stream_count = 3; + * @param int $var + * @return $this + */ + public function setMaxStreamCount($var) + { + GPBUtil::checkInt32($var); + $this->max_stream_count = $var; + + return $this; + } + + /** + * The minimum preferred stream count. This parameter can be used to inform + * the service that there is a desired lower bound on the number of streams. + * This is typically a target parallelism of the client (e.g. a Spark + * cluster with N-workers would set this to a low multiple of N to ensure + * good cluster utilization). + * The system will make a best effort to provide at least this number of + * streams, but in some cases might provide less. + * + * Generated from protobuf field int32 preferred_min_stream_count = 4; + * @return int + */ + public function getPreferredMinStreamCount() + { + return $this->preferred_min_stream_count; + } + + /** + * The minimum preferred stream count. This parameter can be used to inform + * the service that there is a desired lower bound on the number of streams. + * This is typically a target parallelism of the client (e.g. a Spark + * cluster with N-workers would set this to a low multiple of N to ensure + * good cluster utilization). + * The system will make a best effort to provide at least this number of + * streams, but in some cases might provide less. + * + * Generated from protobuf field int32 preferred_min_stream_count = 4; + * @param int $var + * @return $this + */ + public function setPreferredMinStreamCount($var) + { + GPBUtil::checkInt32($var); + $this->preferred_min_stream_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/CreateWriteStreamRequest.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/CreateWriteStreamRequest.php new file mode 100644 index 000000000000..5f861cd2387f --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/CreateWriteStreamRequest.php @@ -0,0 +1,132 @@ +google.cloud.bigquery.storage.v1.CreateWriteStreamRequest + */ +class CreateWriteStreamRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Reference to the table to which the stream belongs, in the format + * of `projects/{project}/datasets/{dataset}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Stream to be created. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStream write_stream = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $write_stream = null; + + /** + * @param string $parent Required. Reference to the table to which the stream belongs, in the format + * of `projects/{project}/datasets/{dataset}/tables/{table}`. Please see + * {@see BigQueryWriteClient::tableName()} for help formatting this field. + * @param \Google\Cloud\BigQuery\Storage\V1\WriteStream $writeStream Required. Stream to be created. + * + * @return \Google\Cloud\BigQuery\Storage\V1\CreateWriteStreamRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BigQuery\Storage\V1\WriteStream $writeStream): self + { + return (new self()) + ->setParent($parent) + ->setWriteStream($writeStream); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Reference to the table to which the stream belongs, in the format + * of `projects/{project}/datasets/{dataset}/tables/{table}`. + * @type \Google\Cloud\BigQuery\Storage\V1\WriteStream $write_stream + * Required. Stream to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Required. Reference to the table to which the stream belongs, in the format + * of `projects/{project}/datasets/{dataset}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Reference to the table to which the stream belongs, in the format + * of `projects/{project}/datasets/{dataset}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Stream to be created. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStream write_stream = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BigQuery\Storage\V1\WriteStream|null + */ + public function getWriteStream() + { + return $this->write_stream; + } + + public function hasWriteStream() + { + return isset($this->write_stream); + } + + public function clearWriteStream() + { + unset($this->write_stream); + } + + /** + * Required. Stream to be created. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStream write_stream = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BigQuery\Storage\V1\WriteStream $var + * @return $this + */ + public function setWriteStream($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\WriteStream::class); + $this->write_stream = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/DataFormat.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/DataFormat.php new file mode 100644 index 000000000000..c5e81f0da7a1 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/DataFormat.php @@ -0,0 +1,63 @@ +google.cloud.bigquery.storage.v1.DataFormat + */ +class DataFormat +{ + /** + * Data format is unspecified. + * + * Generated from protobuf enum DATA_FORMAT_UNSPECIFIED = 0; + */ + const DATA_FORMAT_UNSPECIFIED = 0; + /** + * Avro is a standard open source row based file format. + * See https://avro.apache.org/ for more details. + * + * Generated from protobuf enum AVRO = 1; + */ + const AVRO = 1; + /** + * Arrow is a standard open source column-based message format. + * See https://arrow.apache.org/ for more details. + * + * Generated from protobuf enum ARROW = 2; + */ + const ARROW = 2; + + private static $valueToName = [ + self::DATA_FORMAT_UNSPECIFIED => 'DATA_FORMAT_UNSPECIFIED', + self::AVRO => 'AVRO', + self::ARROW => 'ARROW', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FinalizeWriteStreamRequest.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FinalizeWriteStreamRequest.php new file mode 100644 index 000000000000..320ada00d1f1 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FinalizeWriteStreamRequest.php @@ -0,0 +1,86 @@ +google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest + */ +class FinalizeWriteStreamRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the stream to finalize, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the stream to finalize, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. Please see + * {@see BigQueryWriteClient::writeStreamName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Storage\V1\FinalizeWriteStreamRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the stream to finalize, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the stream to finalize, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the stream to finalize, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FinalizeWriteStreamResponse.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FinalizeWriteStreamResponse.php new file mode 100644 index 000000000000..8e028e4fa78a --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FinalizeWriteStreamResponse.php @@ -0,0 +1,67 @@ +google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse + */ +class FinalizeWriteStreamResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Number of rows in the finalized stream. + * + * Generated from protobuf field int64 row_count = 1; + */ + protected $row_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $row_count + * Number of rows in the finalized stream. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Number of rows in the finalized stream. + * + * Generated from protobuf field int64 row_count = 1; + * @return int|string + */ + public function getRowCount() + { + return $this->row_count; + } + + /** + * Number of rows in the finalized stream. + * + * Generated from protobuf field int64 row_count = 1; + * @param int|string $var + * @return $this + */ + public function setRowCount($var) + { + GPBUtil::checkInt64($var); + $this->row_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FlushRowsRequest.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FlushRowsRequest.php new file mode 100644 index 000000000000..c89d647475b8 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FlushRowsRequest.php @@ -0,0 +1,158 @@ +google.cloud.bigquery.storage.v1.FlushRowsRequest + */ +class FlushRowsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The stream that is the target of the flush operation. + * + * Generated from protobuf field string write_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $write_stream = ''; + /** + * Ending offset of the flush operation. Rows before this offset(including + * this offset) will be flushed. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 2; + */ + protected $offset = null; + + /** + * @param string $writeStream Required. The stream that is the target of the flush operation. Please see + * {@see BigQueryWriteClient::writeStreamName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Storage\V1\FlushRowsRequest + * + * @experimental + */ + public static function build(string $writeStream): self + { + return (new self()) + ->setWriteStream($writeStream); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $write_stream + * Required. The stream that is the target of the flush operation. + * @type \Google\Protobuf\Int64Value $offset + * Ending offset of the flush operation. Rows before this offset(including + * this offset) will be flushed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The stream that is the target of the flush operation. + * + * Generated from protobuf field string write_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getWriteStream() + { + return $this->write_stream; + } + + /** + * Required. The stream that is the target of the flush operation. + * + * Generated from protobuf field string write_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWriteStream($var) + { + GPBUtil::checkString($var, True); + $this->write_stream = $var; + + return $this; + } + + /** + * Ending offset of the flush operation. Rows before this offset(including + * this offset) will be flushed. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 2; + * @return \Google\Protobuf\Int64Value|null + */ + public function getOffset() + { + return $this->offset; + } + + public function hasOffset() + { + return isset($this->offset); + } + + public function clearOffset() + { + unset($this->offset); + } + + /** + * Returns the unboxed value from getOffset() + + * Ending offset of the flush operation. Rows before this offset(including + * this offset) will be flushed. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 2; + * @return int|string|null + */ + public function getOffsetUnwrapped() + { + return $this->readWrapperValue("offset"); + } + + /** + * Ending offset of the flush operation. Rows before this offset(including + * this offset) will be flushed. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 2; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->offset = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Ending offset of the flush operation. Rows before this offset(including + * this offset) will be flushed. + * + * Generated from protobuf field .google.protobuf.Int64Value offset = 2; + * @param int|string|null $var + * @return $this + */ + public function setOffsetUnwrapped($var) + { + $this->writeWrapperValue("offset", $var); + return $this;} + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FlushRowsResponse.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FlushRowsResponse.php new file mode 100644 index 000000000000..2bf496a5d445 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/FlushRowsResponse.php @@ -0,0 +1,67 @@ +google.cloud.bigquery.storage.v1.FlushRowsResponse + */ +class FlushRowsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The rows before this offset (including this offset) are flushed. + * + * Generated from protobuf field int64 offset = 1; + */ + protected $offset = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $offset + * The rows before this offset (including this offset) are flushed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * The rows before this offset (including this offset) are flushed. + * + * Generated from protobuf field int64 offset = 1; + * @return int|string + */ + public function getOffset() + { + return $this->offset; + } + + /** + * The rows before this offset (including this offset) are flushed. + * + * Generated from protobuf field int64 offset = 1; + * @param int|string $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkInt64($var); + $this->offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/GetWriteStreamRequest.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/GetWriteStreamRequest.php new file mode 100644 index 000000000000..9c23aa9e45f1 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/GetWriteStreamRequest.php @@ -0,0 +1,124 @@ +google.cloud.bigquery.storage.v1.GetWriteStreamRequest + */ +class GetWriteStreamRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the stream to get, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates whether to get full or partial view of the WriteStream. If + * not set, view returned will be basic. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + */ + protected $view = 0; + + /** + * @param string $name Required. Name of the stream to get, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. Please see + * {@see BigQueryWriteClient::writeStreamName()} for help formatting this field. + * + * @return \Google\Cloud\BigQuery\Storage\V1\GetWriteStreamRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the stream to get, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * @type int $view + * Indicates whether to get full or partial view of the WriteStream. If + * not set, view returned will be basic. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the stream to get, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the stream to get, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Indicates whether to get full or partial view of the WriteStream. If + * not set, view returned will be basic. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Indicates whether to get full or partial view of the WriteStream. If + * not set, view returned will be basic. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\WriteStreamView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ProtoRows.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ProtoRows.php new file mode 100644 index 000000000000..da06f296e683 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ProtoRows.php @@ -0,0 +1,73 @@ +google.cloud.bigquery.storage.v1.ProtoRows + */ +class ProtoRows extends \Google\Protobuf\Internal\Message +{ + /** + * A sequence of rows serialized as a Protocol Buffer. + * See https://developers.google.com/protocol-buffers/docs/overview for more + * information on deserializing this field. + * + * Generated from protobuf field repeated bytes serialized_rows = 1; + */ + private $serialized_rows; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $serialized_rows + * A sequence of rows serialized as a Protocol Buffer. + * See https://developers.google.com/protocol-buffers/docs/overview for more + * information on deserializing this field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Protobuf::initOnce(); + parent::__construct($data); + } + + /** + * A sequence of rows serialized as a Protocol Buffer. + * See https://developers.google.com/protocol-buffers/docs/overview for more + * information on deserializing this field. + * + * Generated from protobuf field repeated bytes serialized_rows = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSerializedRows() + { + return $this->serialized_rows; + } + + /** + * A sequence of rows serialized as a Protocol Buffer. + * See https://developers.google.com/protocol-buffers/docs/overview for more + * information on deserializing this field. + * + * Generated from protobuf field repeated bytes serialized_rows = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSerializedRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); + $this->serialized_rows = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ProtoSchema.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ProtoSchema.php new file mode 100644 index 000000000000..6f20a5f57e4e --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ProtoSchema.php @@ -0,0 +1,105 @@ +google.cloud.bigquery.storage.v1.ProtoSchema + */ +class ProtoSchema extends \Google\Protobuf\Internal\Message +{ + /** + * Descriptor for input message. The provided descriptor must be self + * contained, such that data rows sent can be fully decoded using only the + * single descriptor. For data rows that are compositions of multiple + * independent messages, this means the descriptor may need to be transformed + * to only use nested types: + * https://developers.google.com/protocol-buffers/docs/proto#nested + * For additional information for how proto types and values map onto BigQuery + * see: https://cloud.google.com/bigquery/docs/write-api#data_type_conversions + * + * Generated from protobuf field .google.protobuf.DescriptorProto proto_descriptor = 1; + */ + protected $proto_descriptor = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\DescriptorProto $proto_descriptor + * Descriptor for input message. The provided descriptor must be self + * contained, such that data rows sent can be fully decoded using only the + * single descriptor. For data rows that are compositions of multiple + * independent messages, this means the descriptor may need to be transformed + * to only use nested types: + * https://developers.google.com/protocol-buffers/docs/proto#nested + * For additional information for how proto types and values map onto BigQuery + * see: https://cloud.google.com/bigquery/docs/write-api#data_type_conversions + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Protobuf::initOnce(); + parent::__construct($data); + } + + /** + * Descriptor for input message. The provided descriptor must be self + * contained, such that data rows sent can be fully decoded using only the + * single descriptor. For data rows that are compositions of multiple + * independent messages, this means the descriptor may need to be transformed + * to only use nested types: + * https://developers.google.com/protocol-buffers/docs/proto#nested + * For additional information for how proto types and values map onto BigQuery + * see: https://cloud.google.com/bigquery/docs/write-api#data_type_conversions + * + * Generated from protobuf field .google.protobuf.DescriptorProto proto_descriptor = 1; + * @return \Google\Protobuf\DescriptorProto|null + */ + public function getProtoDescriptor() + { + return $this->proto_descriptor; + } + + public function hasProtoDescriptor() + { + return isset($this->proto_descriptor); + } + + public function clearProtoDescriptor() + { + unset($this->proto_descriptor); + } + + /** + * Descriptor for input message. The provided descriptor must be self + * contained, such that data rows sent can be fully decoded using only the + * single descriptor. For data rows that are compositions of multiple + * independent messages, this means the descriptor may need to be transformed + * to only use nested types: + * https://developers.google.com/protocol-buffers/docs/proto#nested + * For additional information for how proto types and values map onto BigQuery + * see: https://cloud.google.com/bigquery/docs/write-api#data_type_conversions + * + * Generated from protobuf field .google.protobuf.DescriptorProto proto_descriptor = 1; + * @param \Google\Protobuf\DescriptorProto $var + * @return $this + */ + public function setProtoDescriptor($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DescriptorProto::class); + $this->proto_descriptor = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadRowsRequest.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadRowsRequest.php new file mode 100644 index 000000000000..c8a2f8817402 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadRowsRequest.php @@ -0,0 +1,127 @@ +google.cloud.bigquery.storage.v1.ReadRowsRequest + */ +class ReadRowsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Stream to read rows from. + * + * Generated from protobuf field string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $read_stream = ''; + /** + * The offset requested must be less than the last row read from Read. + * Requesting a larger offset is undefined. If not specified, start reading + * from offset zero. + * + * Generated from protobuf field int64 offset = 2; + */ + protected $offset = 0; + + /** + * @param string $readStream Required. Stream to read rows from. Please see + * {@see BigQueryReadClient::readStreamName()} for help formatting this field. + * @param int $offset The offset requested must be less than the last row read from Read. + * Requesting a larger offset is undefined. If not specified, start reading + * from offset zero. + * + * @return \Google\Cloud\BigQuery\Storage\V1\ReadRowsRequest + * + * @experimental + */ + public static function build(string $readStream, int $offset): self + { + return (new self()) + ->setReadStream($readStream) + ->setOffset($offset); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $read_stream + * Required. Stream to read rows from. + * @type int|string $offset + * The offset requested must be less than the last row read from Read. + * Requesting a larger offset is undefined. If not specified, start reading + * from offset zero. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Required. Stream to read rows from. + * + * Generated from protobuf field string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getReadStream() + { + return $this->read_stream; + } + + /** + * Required. Stream to read rows from. + * + * Generated from protobuf field string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setReadStream($var) + { + GPBUtil::checkString($var, True); + $this->read_stream = $var; + + return $this; + } + + /** + * The offset requested must be less than the last row read from Read. + * Requesting a larger offset is undefined. If not specified, start reading + * from offset zero. + * + * Generated from protobuf field int64 offset = 2; + * @return int|string + */ + public function getOffset() + { + return $this->offset; + } + + /** + * The offset requested must be less than the last row read from Read. + * Requesting a larger offset is undefined. If not specified, start reading + * from offset zero. + * + * Generated from protobuf field int64 offset = 2; + * @param int|string $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkInt64($var); + $this->offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadRowsResponse.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadRowsResponse.php new file mode 100644 index 000000000000..870309d3a0eb --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadRowsResponse.php @@ -0,0 +1,406 @@ +google.cloud.bigquery.storage.v1.ReadRowsResponse + */ +class ReadRowsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Number of serialized rows in the rows block. + * + * Generated from protobuf field int64 row_count = 6; + */ + protected $row_count = 0; + /** + * Statistics for the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + */ + protected $stats = null; + /** + * Throttling state. If unset, the latest response still describes + * the current throttling status. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + */ + protected $throttle_state = null; + /** + * Optional. If the row data in this ReadRowsResponse is compressed, then + * uncompressed byte size is the original size of the uncompressed row data. + * If it is set to a value greater than 0, then decompress into a buffer of + * size uncompressed_byte_size using the compression codec that was requested + * during session creation time and which is specified in + * TableReadOptions.response_compression_codec in ReadSession. + * This value is not set if no response_compression_codec was not requested + * and it is -1 if the requested compression would not have reduced the size + * of this ReadRowsResponse's row data. This attempts to match Apache Arrow's + * behavior described here https://github.com/apache/arrow/issues/15102 where + * the uncompressed length may be set to -1 to indicate that the data that + * follows is not compressed, which can be useful for cases where compression + * does not yield appreciable savings. When uncompressed_byte_size is not + * greater than 0, the client should skip decompression. + * + * Generated from protobuf field optional int64 uncompressed_byte_size = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $uncompressed_byte_size = null; + protected $rows; + protected $schema; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Storage\V1\AvroRows $avro_rows + * Serialized row data in AVRO format. + * @type \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch $arrow_record_batch + * Serialized row data in Arrow RecordBatch format. + * @type int|string $row_count + * Number of serialized rows in the rows block. + * @type \Google\Cloud\BigQuery\Storage\V1\StreamStats $stats + * Statistics for the stream. + * @type \Google\Cloud\BigQuery\Storage\V1\ThrottleState $throttle_state + * Throttling state. If unset, the latest response still describes + * the current throttling status. + * @type \Google\Cloud\BigQuery\Storage\V1\AvroSchema $avro_schema + * Output only. Avro schema. + * @type \Google\Cloud\BigQuery\Storage\V1\ArrowSchema $arrow_schema + * Output only. Arrow schema. + * @type int|string $uncompressed_byte_size + * Optional. If the row data in this ReadRowsResponse is compressed, then + * uncompressed byte size is the original size of the uncompressed row data. + * If it is set to a value greater than 0, then decompress into a buffer of + * size uncompressed_byte_size using the compression codec that was requested + * during session creation time and which is specified in + * TableReadOptions.response_compression_codec in ReadSession. + * This value is not set if no response_compression_codec was not requested + * and it is -1 if the requested compression would not have reduced the size + * of this ReadRowsResponse's row data. This attempts to match Apache Arrow's + * behavior described here https://github.com/apache/arrow/issues/15102 where + * the uncompressed length may be set to -1 to indicate that the data that + * follows is not compressed, which can be useful for cases where compression + * does not yield appreciable savings. When uncompressed_byte_size is not + * greater than 0, the client should skip decompression. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Serialized row data in AVRO format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + * @return \Google\Cloud\BigQuery\Storage\V1\AvroRows|null + */ + public function getAvroRows() + { + return $this->readOneof(3); + } + + public function hasAvroRows() + { + return $this->hasOneof(3); + } + + /** + * Serialized row data in AVRO format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + * @param \Google\Cloud\BigQuery\Storage\V1\AvroRows $var + * @return $this + */ + public function setAvroRows($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\AvroRows::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Serialized row data in Arrow RecordBatch format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + * @return \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch|null + */ + public function getArrowRecordBatch() + { + return $this->readOneof(4); + } + + public function hasArrowRecordBatch() + { + return $this->hasOneof(4); + } + + /** + * Serialized row data in Arrow RecordBatch format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + * @param \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch $var + * @return $this + */ + public function setArrowRecordBatch($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Number of serialized rows in the rows block. + * + * Generated from protobuf field int64 row_count = 6; + * @return int|string + */ + public function getRowCount() + { + return $this->row_count; + } + + /** + * Number of serialized rows in the rows block. + * + * Generated from protobuf field int64 row_count = 6; + * @param int|string $var + * @return $this + */ + public function setRowCount($var) + { + GPBUtil::checkInt64($var); + $this->row_count = $var; + + return $this; + } + + /** + * Statistics for the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + * @return \Google\Cloud\BigQuery\Storage\V1\StreamStats|null + */ + public function getStats() + { + return $this->stats; + } + + public function hasStats() + { + return isset($this->stats); + } + + public function clearStats() + { + unset($this->stats); + } + + /** + * Statistics for the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + * @param \Google\Cloud\BigQuery\Storage\V1\StreamStats $var + * @return $this + */ + public function setStats($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\StreamStats::class); + $this->stats = $var; + + return $this; + } + + /** + * Throttling state. If unset, the latest response still describes + * the current throttling status. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + * @return \Google\Cloud\BigQuery\Storage\V1\ThrottleState|null + */ + public function getThrottleState() + { + return $this->throttle_state; + } + + public function hasThrottleState() + { + return isset($this->throttle_state); + } + + public function clearThrottleState() + { + unset($this->throttle_state); + } + + /** + * Throttling state. If unset, the latest response still describes + * the current throttling status. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + * @param \Google\Cloud\BigQuery\Storage\V1\ThrottleState $var + * @return $this + */ + public function setThrottleState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ThrottleState::class); + $this->throttle_state = $var; + + return $this; + } + + /** + * Output only. Avro schema. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BigQuery\Storage\V1\AvroSchema|null + */ + public function getAvroSchema() + { + return $this->readOneof(7); + } + + public function hasAvroSchema() + { + return $this->hasOneof(7); + } + + /** + * Output only. Avro schema. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Storage\V1\AvroSchema $var + * @return $this + */ + public function setAvroSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\AvroSchema::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Output only. Arrow schema. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BigQuery\Storage\V1\ArrowSchema|null + */ + public function getArrowSchema() + { + return $this->readOneof(8); + } + + public function hasArrowSchema() + { + return $this->hasOneof(8); + } + + /** + * Output only. Arrow schema. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Storage\V1\ArrowSchema $var + * @return $this + */ + public function setArrowSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ArrowSchema::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Optional. If the row data in this ReadRowsResponse is compressed, then + * uncompressed byte size is the original size of the uncompressed row data. + * If it is set to a value greater than 0, then decompress into a buffer of + * size uncompressed_byte_size using the compression codec that was requested + * during session creation time and which is specified in + * TableReadOptions.response_compression_codec in ReadSession. + * This value is not set if no response_compression_codec was not requested + * and it is -1 if the requested compression would not have reduced the size + * of this ReadRowsResponse's row data. This attempts to match Apache Arrow's + * behavior described here https://github.com/apache/arrow/issues/15102 where + * the uncompressed length may be set to -1 to indicate that the data that + * follows is not compressed, which can be useful for cases where compression + * does not yield appreciable savings. When uncompressed_byte_size is not + * greater than 0, the client should skip decompression. + * + * Generated from protobuf field optional int64 uncompressed_byte_size = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getUncompressedByteSize() + { + return isset($this->uncompressed_byte_size) ? $this->uncompressed_byte_size : 0; + } + + public function hasUncompressedByteSize() + { + return isset($this->uncompressed_byte_size); + } + + public function clearUncompressedByteSize() + { + unset($this->uncompressed_byte_size); + } + + /** + * Optional. If the row data in this ReadRowsResponse is compressed, then + * uncompressed byte size is the original size of the uncompressed row data. + * If it is set to a value greater than 0, then decompress into a buffer of + * size uncompressed_byte_size using the compression codec that was requested + * during session creation time and which is specified in + * TableReadOptions.response_compression_codec in ReadSession. + * This value is not set if no response_compression_codec was not requested + * and it is -1 if the requested compression would not have reduced the size + * of this ReadRowsResponse's row data. This attempts to match Apache Arrow's + * behavior described here https://github.com/apache/arrow/issues/15102 where + * the uncompressed length may be set to -1 to indicate that the data that + * follows is not compressed, which can be useful for cases where compression + * does not yield appreciable savings. When uncompressed_byte_size is not + * greater than 0, the client should skip decompression. + * + * Generated from protobuf field optional int64 uncompressed_byte_size = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setUncompressedByteSize($var) + { + GPBUtil::checkInt64($var); + $this->uncompressed_byte_size = $var; + + return $this; + } + + /** + * @return string + */ + public function getRows() + { + return $this->whichOneof("rows"); + } + + /** + * @return string + */ + public function getSchema() + { + return $this->whichOneof("schema"); + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession.php new file mode 100644 index 000000000000..c574355892c3 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession.php @@ -0,0 +1,604 @@ +google.cloud.bigquery.storage.v1.ReadSession + */ +class ReadSession extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Unique identifier for the session, in the form + * `projects/{project_id}/locations/{location}/sessions/{session_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. Time at which the session becomes invalid. After this time, + * subsequent requests to read this Session will return errors. The + * expire_time is automatically assigned and currently cannot be specified or + * updated. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Immutable. Data format of the output data. DATA_FORMAT_UNSPECIFIED not + * supported. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $data_format = 0; + /** + * Immutable. Table that this ReadSession is reading from, in the form + * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}` + * + * Generated from protobuf field string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $table = ''; + /** + * Optional. Any modifiers which are applied when reading from the specified + * table. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $table_modifiers = null; + /** + * Optional. Read options for this session (e.g. column selection, filters). + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $read_options = null; + /** + * Output only. A list of streams created with the session. + * At least one stream is created with the session. In the future, larger + * request_stream_count values *may* result in this list being unpopulated, + * in that case, the user will need to use a List method to get the streams + * instead, which is not yet available. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $streams; + /** + * Output only. An estimate on the number of bytes this session will scan when + * all streams are completely consumed. This estimate is based on + * metadata from the table which might be incomplete or stale. + * + * Generated from protobuf field int64 estimated_total_bytes_scanned = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $estimated_total_bytes_scanned = 0; + /** + * Output only. A pre-projected estimate of the total physical size of files + * (in bytes) that this session will scan when all streams are consumed. This + * estimate is independent of the selected columns and can be based on + * incomplete or stale metadata from the table. This field is only set for + * BigLake tables. + * + * Generated from protobuf field int64 estimated_total_physical_file_size = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $estimated_total_physical_file_size = 0; + /** + * Output only. An estimate on the number of rows present in this session's + * streams. This estimate is based on metadata from the table which might be + * incomplete or stale. + * + * Generated from protobuf field int64 estimated_row_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $estimated_row_count = 0; + /** + * Optional. ID set by client to annotate a session identity. This does not + * need to be strictly unique, but instead the same ID should be used to group + * logically connected sessions (e.g. All using the same ID for all sessions + * needed to complete a Spark SQL query is reasonable). + * Maximum length is 256 bytes. + * + * Generated from protobuf field string trace_id = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $trace_id = ''; + protected $schema; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Unique identifier for the session, in the form + * `projects/{project_id}/locations/{location}/sessions/{session_id}`. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. Time at which the session becomes invalid. After this time, + * subsequent requests to read this Session will return errors. The + * expire_time is automatically assigned and currently cannot be specified or + * updated. + * @type int $data_format + * Immutable. Data format of the output data. DATA_FORMAT_UNSPECIFIED not + * supported. + * @type \Google\Cloud\BigQuery\Storage\V1\AvroSchema $avro_schema + * Output only. Avro schema. + * @type \Google\Cloud\BigQuery\Storage\V1\ArrowSchema $arrow_schema + * Output only. Arrow schema. + * @type string $table + * Immutable. Table that this ReadSession is reading from, in the form + * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}` + * @type \Google\Cloud\BigQuery\Storage\V1\ReadSession\TableModifiers $table_modifiers + * Optional. Any modifiers which are applied when reading from the specified + * table. + * @type \Google\Cloud\BigQuery\Storage\V1\ReadSession\TableReadOptions $read_options + * Optional. Read options for this session (e.g. column selection, filters). + * @type array<\Google\Cloud\BigQuery\Storage\V1\ReadStream>|\Google\Protobuf\Internal\RepeatedField $streams + * Output only. A list of streams created with the session. + * At least one stream is created with the session. In the future, larger + * request_stream_count values *may* result in this list being unpopulated, + * in that case, the user will need to use a List method to get the streams + * instead, which is not yet available. + * @type int|string $estimated_total_bytes_scanned + * Output only. An estimate on the number of bytes this session will scan when + * all streams are completely consumed. This estimate is based on + * metadata from the table which might be incomplete or stale. + * @type int|string $estimated_total_physical_file_size + * Output only. A pre-projected estimate of the total physical size of files + * (in bytes) that this session will scan when all streams are consumed. This + * estimate is independent of the selected columns and can be based on + * incomplete or stale metadata from the table. This field is only set for + * BigLake tables. + * @type int|string $estimated_row_count + * Output only. An estimate on the number of rows present in this session's + * streams. This estimate is based on metadata from the table which might be + * incomplete or stale. + * @type string $trace_id + * Optional. ID set by client to annotate a session identity. This does not + * need to be strictly unique, but instead the same ID should be used to group + * logically connected sessions (e.g. All using the same ID for all sessions + * needed to complete a Spark SQL query is reasonable). + * Maximum length is 256 bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Stream::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Unique identifier for the session, in the form + * `projects/{project_id}/locations/{location}/sessions/{session_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Unique identifier for the session, in the form + * `projects/{project_id}/locations/{location}/sessions/{session_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Time at which the session becomes invalid. After this time, + * subsequent requests to read this Session will return errors. The + * expire_time is automatically assigned and currently cannot be specified or + * updated. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. Time at which the session becomes invalid. After this time, + * subsequent requests to read this Session will return errors. The + * expire_time is automatically assigned and currently cannot be specified or + * updated. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Immutable. Data format of the output data. DATA_FORMAT_UNSPECIFIED not + * supported. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getDataFormat() + { + return $this->data_format; + } + + /** + * Immutable. Data format of the output data. DATA_FORMAT_UNSPECIFIED not + * supported. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setDataFormat($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\DataFormat::class); + $this->data_format = $var; + + return $this; + } + + /** + * Output only. Avro schema. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BigQuery\Storage\V1\AvroSchema|null + */ + public function getAvroSchema() + { + return $this->readOneof(4); + } + + public function hasAvroSchema() + { + return $this->hasOneof(4); + } + + /** + * Output only. Avro schema. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Storage\V1\AvroSchema $var + * @return $this + */ + public function setAvroSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\AvroSchema::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Output only. Arrow schema. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BigQuery\Storage\V1\ArrowSchema|null + */ + public function getArrowSchema() + { + return $this->readOneof(5); + } + + public function hasArrowSchema() + { + return $this->hasOneof(5); + } + + /** + * Output only. Arrow schema. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Storage\V1\ArrowSchema $var + * @return $this + */ + public function setArrowSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ArrowSchema::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Immutable. Table that this ReadSession is reading from, in the form + * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}` + * + * Generated from protobuf field string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getTable() + { + return $this->table; + } + + /** + * Immutable. Table that this ReadSession is reading from, in the form + * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}` + * + * Generated from protobuf field string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTable($var) + { + GPBUtil::checkString($var, True); + $this->table = $var; + + return $this; + } + + /** + * Optional. Any modifiers which are applied when reading from the specified + * table. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\Storage\V1\ReadSession\TableModifiers|null + */ + public function getTableModifiers() + { + return $this->table_modifiers; + } + + public function hasTableModifiers() + { + return isset($this->table_modifiers); + } + + public function clearTableModifiers() + { + unset($this->table_modifiers); + } + + /** + * Optional. Any modifiers which are applied when reading from the specified + * table. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\Storage\V1\ReadSession\TableModifiers $var + * @return $this + */ + public function setTableModifiers($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ReadSession\TableModifiers::class); + $this->table_modifiers = $var; + + return $this; + } + + /** + * Optional. Read options for this session (e.g. column selection, filters). + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\Storage\V1\ReadSession\TableReadOptions|null + */ + public function getReadOptions() + { + return $this->read_options; + } + + public function hasReadOptions() + { + return isset($this->read_options); + } + + public function clearReadOptions() + { + unset($this->read_options); + } + + /** + * Optional. Read options for this session (e.g. column selection, filters). + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\Storage\V1\ReadSession\TableReadOptions $var + * @return $this + */ + public function setReadOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ReadSession\TableReadOptions::class); + $this->read_options = $var; + + return $this; + } + + /** + * Output only. A list of streams created with the session. + * At least one stream is created with the session. In the future, larger + * request_stream_count values *may* result in this list being unpopulated, + * in that case, the user will need to use a List method to get the streams + * instead, which is not yet available. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStreams() + { + return $this->streams; + } + + /** + * Output only. A list of streams created with the session. + * At least one stream is created with the session. In the future, larger + * request_stream_count values *may* result in this list being unpopulated, + * in that case, the user will need to use a List method to get the streams + * instead, which is not yet available. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BigQuery\Storage\V1\ReadStream>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStreams($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Storage\V1\ReadStream::class); + $this->streams = $arr; + + return $this; + } + + /** + * Output only. An estimate on the number of bytes this session will scan when + * all streams are completely consumed. This estimate is based on + * metadata from the table which might be incomplete or stale. + * + * Generated from protobuf field int64 estimated_total_bytes_scanned = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getEstimatedTotalBytesScanned() + { + return $this->estimated_total_bytes_scanned; + } + + /** + * Output only. An estimate on the number of bytes this session will scan when + * all streams are completely consumed. This estimate is based on + * metadata from the table which might be incomplete or stale. + * + * Generated from protobuf field int64 estimated_total_bytes_scanned = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setEstimatedTotalBytesScanned($var) + { + GPBUtil::checkInt64($var); + $this->estimated_total_bytes_scanned = $var; + + return $this; + } + + /** + * Output only. A pre-projected estimate of the total physical size of files + * (in bytes) that this session will scan when all streams are consumed. This + * estimate is independent of the selected columns and can be based on + * incomplete or stale metadata from the table. This field is only set for + * BigLake tables. + * + * Generated from protobuf field int64 estimated_total_physical_file_size = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getEstimatedTotalPhysicalFileSize() + { + return $this->estimated_total_physical_file_size; + } + + /** + * Output only. A pre-projected estimate of the total physical size of files + * (in bytes) that this session will scan when all streams are consumed. This + * estimate is independent of the selected columns and can be based on + * incomplete or stale metadata from the table. This field is only set for + * BigLake tables. + * + * Generated from protobuf field int64 estimated_total_physical_file_size = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setEstimatedTotalPhysicalFileSize($var) + { + GPBUtil::checkInt64($var); + $this->estimated_total_physical_file_size = $var; + + return $this; + } + + /** + * Output only. An estimate on the number of rows present in this session's + * streams. This estimate is based on metadata from the table which might be + * incomplete or stale. + * + * Generated from protobuf field int64 estimated_row_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getEstimatedRowCount() + { + return $this->estimated_row_count; + } + + /** + * Output only. An estimate on the number of rows present in this session's + * streams. This estimate is based on metadata from the table which might be + * incomplete or stale. + * + * Generated from protobuf field int64 estimated_row_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setEstimatedRowCount($var) + { + GPBUtil::checkInt64($var); + $this->estimated_row_count = $var; + + return $this; + } + + /** + * Optional. ID set by client to annotate a session identity. This does not + * need to be strictly unique, but instead the same ID should be used to group + * logically connected sessions (e.g. All using the same ID for all sessions + * needed to complete a Spark SQL query is reasonable). + * Maximum length is 256 bytes. + * + * Generated from protobuf field string trace_id = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTraceId() + { + return $this->trace_id; + } + + /** + * Optional. ID set by client to annotate a session identity. This does not + * need to be strictly unique, but instead the same ID should be used to group + * logically connected sessions (e.g. All using the same ID for all sessions + * needed to complete a Spark SQL query is reasonable). + * Maximum length is 256 bytes. + * + * Generated from protobuf field string trace_id = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTraceId($var) + { + GPBUtil::checkString($var, True); + $this->trace_id = $var; + + return $this; + } + + /** + * @return string + */ + public function getSchema() + { + return $this->whichOneof("schema"); + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession/TableModifiers.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession/TableModifiers.php new file mode 100644 index 000000000000..059cd772f343 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession/TableModifiers.php @@ -0,0 +1,80 @@ +google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + */ +class TableModifiers extends \Google\Protobuf\Internal\Message +{ + /** + * The snapshot time of the table. If not set, interpreted as now. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 1; + */ + protected $snapshot_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $snapshot_time + * The snapshot time of the table. If not set, interpreted as now. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Stream::initOnce(); + parent::__construct($data); + } + + /** + * The snapshot time of the table. If not set, interpreted as now. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSnapshotTime() + { + return $this->snapshot_time; + } + + public function hasSnapshotTime() + { + return isset($this->snapshot_time); + } + + public function clearSnapshotTime() + { + unset($this->snapshot_time); + } + + /** + * The snapshot time of the table. If not set, interpreted as now. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSnapshotTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->snapshot_time = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TableModifiers::class, \Google\Cloud\BigQuery\Storage\V1\ReadSession_TableModifiers::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession/TableReadOptions.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession/TableReadOptions.php new file mode 100644 index 000000000000..092d49e3d216 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession/TableReadOptions.php @@ -0,0 +1,471 @@ +google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + */ +class TableReadOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The names of the fields in the table to be returned. If no + * field names are specified, then all fields in the table are returned. + * Nested fields -- the child elements of a STRUCT field -- can be selected + * individually using their fully-qualified names, and will be returned as + * record fields containing only the selected nested fields. If a STRUCT + * field is specified in the selected fields list, all of the child elements + * will be returned. + * As an example, consider a table with the following schema: + * { + * "name": "struct_field", + * "type": "RECORD", + * "mode": "NULLABLE", + * "fields": [ + * { + * "name": "string_field1", + * "type": "STRING", + * . "mode": "NULLABLE" + * }, + * { + * "name": "string_field2", + * "type": "STRING", + * "mode": "NULLABLE" + * } + * ] + * } + * Specifying "struct_field" in the selected fields list will result in a + * read session schema with the following logical structure: + * struct_field { + * string_field1 + * string_field2 + * } + * Specifying "struct_field.string_field1" in the selected fields list will + * result in a read session schema with the following logical structure: + * struct_field { + * string_field1 + * } + * The order of the fields in the read session schema is derived from the + * table schema and does not correspond to the order in which the fields are + * specified in this list. + * + * Generated from protobuf field repeated string selected_fields = 1; + */ + private $selected_fields; + /** + * SQL text filtering statement, similar to a WHERE clause in a query. + * Aggregates are not supported. + * Examples: "int_field > 5" + * "date_field = CAST('2014-9-27' as DATE)" + * "nullable_field is not NULL" + * "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))" + * "numeric_field BETWEEN 1.0 AND 5.0" + * Restricted to a maximum length for 1 MB. + * + * Generated from protobuf field string row_restriction = 2; + */ + protected $row_restriction = ''; + /** + * Optional. Specifies a table sampling percentage. Specifically, the query + * planner will use TABLESAMPLE SYSTEM (sample_percentage PERCENT). The + * sampling percentage is applied at the data block granularity. It will + * randomly choose for each data block whether to read the rows in that data + * block. For more details, see + * https://cloud.google.com/bigquery/docs/table-sampling) + * + * Generated from protobuf field optional double sample_percentage = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sample_percentage = null; + /** + * Optional. Set response_compression_codec when creating a read session to + * enable application-level compression of ReadRows responses. + * + * Generated from protobuf field optional .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.ResponseCompressionCodec response_compression_codec = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $response_compression_codec = null; + protected $output_format_serialization_options; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $selected_fields + * Optional. The names of the fields in the table to be returned. If no + * field names are specified, then all fields in the table are returned. + * Nested fields -- the child elements of a STRUCT field -- can be selected + * individually using their fully-qualified names, and will be returned as + * record fields containing only the selected nested fields. If a STRUCT + * field is specified in the selected fields list, all of the child elements + * will be returned. + * As an example, consider a table with the following schema: + * { + * "name": "struct_field", + * "type": "RECORD", + * "mode": "NULLABLE", + * "fields": [ + * { + * "name": "string_field1", + * "type": "STRING", + * . "mode": "NULLABLE" + * }, + * { + * "name": "string_field2", + * "type": "STRING", + * "mode": "NULLABLE" + * } + * ] + * } + * Specifying "struct_field" in the selected fields list will result in a + * read session schema with the following logical structure: + * struct_field { + * string_field1 + * string_field2 + * } + * Specifying "struct_field.string_field1" in the selected fields list will + * result in a read session schema with the following logical structure: + * struct_field { + * string_field1 + * } + * The order of the fields in the read session schema is derived from the + * table schema and does not correspond to the order in which the fields are + * specified in this list. + * @type string $row_restriction + * SQL text filtering statement, similar to a WHERE clause in a query. + * Aggregates are not supported. + * Examples: "int_field > 5" + * "date_field = CAST('2014-9-27' as DATE)" + * "nullable_field is not NULL" + * "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))" + * "numeric_field BETWEEN 1.0 AND 5.0" + * Restricted to a maximum length for 1 MB. + * @type \Google\Cloud\BigQuery\Storage\V1\ArrowSerializationOptions $arrow_serialization_options + * Optional. Options specific to the Apache Arrow output format. + * @type \Google\Cloud\BigQuery\Storage\V1\AvroSerializationOptions $avro_serialization_options + * Optional. Options specific to the Apache Avro output format + * @type float $sample_percentage + * Optional. Specifies a table sampling percentage. Specifically, the query + * planner will use TABLESAMPLE SYSTEM (sample_percentage PERCENT). The + * sampling percentage is applied at the data block granularity. It will + * randomly choose for each data block whether to read the rows in that data + * block. For more details, see + * https://cloud.google.com/bigquery/docs/table-sampling) + * @type int $response_compression_codec + * Optional. Set response_compression_codec when creating a read session to + * enable application-level compression of ReadRows responses. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Stream::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The names of the fields in the table to be returned. If no + * field names are specified, then all fields in the table are returned. + * Nested fields -- the child elements of a STRUCT field -- can be selected + * individually using their fully-qualified names, and will be returned as + * record fields containing only the selected nested fields. If a STRUCT + * field is specified in the selected fields list, all of the child elements + * will be returned. + * As an example, consider a table with the following schema: + * { + * "name": "struct_field", + * "type": "RECORD", + * "mode": "NULLABLE", + * "fields": [ + * { + * "name": "string_field1", + * "type": "STRING", + * . "mode": "NULLABLE" + * }, + * { + * "name": "string_field2", + * "type": "STRING", + * "mode": "NULLABLE" + * } + * ] + * } + * Specifying "struct_field" in the selected fields list will result in a + * read session schema with the following logical structure: + * struct_field { + * string_field1 + * string_field2 + * } + * Specifying "struct_field.string_field1" in the selected fields list will + * result in a read session schema with the following logical structure: + * struct_field { + * string_field1 + * } + * The order of the fields in the read session schema is derived from the + * table schema and does not correspond to the order in which the fields are + * specified in this list. + * + * Generated from protobuf field repeated string selected_fields = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSelectedFields() + { + return $this->selected_fields; + } + + /** + * Optional. The names of the fields in the table to be returned. If no + * field names are specified, then all fields in the table are returned. + * Nested fields -- the child elements of a STRUCT field -- can be selected + * individually using their fully-qualified names, and will be returned as + * record fields containing only the selected nested fields. If a STRUCT + * field is specified in the selected fields list, all of the child elements + * will be returned. + * As an example, consider a table with the following schema: + * { + * "name": "struct_field", + * "type": "RECORD", + * "mode": "NULLABLE", + * "fields": [ + * { + * "name": "string_field1", + * "type": "STRING", + * . "mode": "NULLABLE" + * }, + * { + * "name": "string_field2", + * "type": "STRING", + * "mode": "NULLABLE" + * } + * ] + * } + * Specifying "struct_field" in the selected fields list will result in a + * read session schema with the following logical structure: + * struct_field { + * string_field1 + * string_field2 + * } + * Specifying "struct_field.string_field1" in the selected fields list will + * result in a read session schema with the following logical structure: + * struct_field { + * string_field1 + * } + * The order of the fields in the read session schema is derived from the + * table schema and does not correspond to the order in which the fields are + * specified in this list. + * + * Generated from protobuf field repeated string selected_fields = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSelectedFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->selected_fields = $arr; + + return $this; + } + + /** + * SQL text filtering statement, similar to a WHERE clause in a query. + * Aggregates are not supported. + * Examples: "int_field > 5" + * "date_field = CAST('2014-9-27' as DATE)" + * "nullable_field is not NULL" + * "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))" + * "numeric_field BETWEEN 1.0 AND 5.0" + * Restricted to a maximum length for 1 MB. + * + * Generated from protobuf field string row_restriction = 2; + * @return string + */ + public function getRowRestriction() + { + return $this->row_restriction; + } + + /** + * SQL text filtering statement, similar to a WHERE clause in a query. + * Aggregates are not supported. + * Examples: "int_field > 5" + * "date_field = CAST('2014-9-27' as DATE)" + * "nullable_field is not NULL" + * "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))" + * "numeric_field BETWEEN 1.0 AND 5.0" + * Restricted to a maximum length for 1 MB. + * + * Generated from protobuf field string row_restriction = 2; + * @param string $var + * @return $this + */ + public function setRowRestriction($var) + { + GPBUtil::checkString($var, True); + $this->row_restriction = $var; + + return $this; + } + + /** + * Optional. Options specific to the Apache Arrow output format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSerializationOptions arrow_serialization_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\Storage\V1\ArrowSerializationOptions|null + */ + public function getArrowSerializationOptions() + { + return $this->readOneof(3); + } + + public function hasArrowSerializationOptions() + { + return $this->hasOneof(3); + } + + /** + * Optional. Options specific to the Apache Arrow output format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSerializationOptions arrow_serialization_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\Storage\V1\ArrowSerializationOptions $var + * @return $this + */ + public function setArrowSerializationOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ArrowSerializationOptions::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Options specific to the Apache Avro output format + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AvroSerializationOptions avro_serialization_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\Storage\V1\AvroSerializationOptions|null + */ + public function getAvroSerializationOptions() + { + return $this->readOneof(4); + } + + public function hasAvroSerializationOptions() + { + return $this->hasOneof(4); + } + + /** + * Optional. Options specific to the Apache Avro output format + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AvroSerializationOptions avro_serialization_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\Storage\V1\AvroSerializationOptions $var + * @return $this + */ + public function setAvroSerializationOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\AvroSerializationOptions::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Optional. Specifies a table sampling percentage. Specifically, the query + * planner will use TABLESAMPLE SYSTEM (sample_percentage PERCENT). The + * sampling percentage is applied at the data block granularity. It will + * randomly choose for each data block whether to read the rows in that data + * block. For more details, see + * https://cloud.google.com/bigquery/docs/table-sampling) + * + * Generated from protobuf field optional double sample_percentage = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getSamplePercentage() + { + return isset($this->sample_percentage) ? $this->sample_percentage : 0.0; + } + + public function hasSamplePercentage() + { + return isset($this->sample_percentage); + } + + public function clearSamplePercentage() + { + unset($this->sample_percentage); + } + + /** + * Optional. Specifies a table sampling percentage. Specifically, the query + * planner will use TABLESAMPLE SYSTEM (sample_percentage PERCENT). The + * sampling percentage is applied at the data block granularity. It will + * randomly choose for each data block whether to read the rows in that data + * block. For more details, see + * https://cloud.google.com/bigquery/docs/table-sampling) + * + * Generated from protobuf field optional double sample_percentage = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setSamplePercentage($var) + { + GPBUtil::checkDouble($var); + $this->sample_percentage = $var; + + return $this; + } + + /** + * Optional. Set response_compression_codec when creating a read session to + * enable application-level compression of ReadRows responses. + * + * Generated from protobuf field optional .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.ResponseCompressionCodec response_compression_codec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getResponseCompressionCodec() + { + return isset($this->response_compression_codec) ? $this->response_compression_codec : 0; + } + + public function hasResponseCompressionCodec() + { + return isset($this->response_compression_codec); + } + + public function clearResponseCompressionCodec() + { + unset($this->response_compression_codec); + } + + /** + * Optional. Set response_compression_codec when creating a read session to + * enable application-level compression of ReadRows responses. + * + * Generated from protobuf field optional .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.ResponseCompressionCodec response_compression_codec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setResponseCompressionCodec($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\ReadSession\TableReadOptions\ResponseCompressionCodec::class); + $this->response_compression_codec = $var; + + return $this; + } + + /** + * @return string + */ + public function getOutputFormatSerializationOptions() + { + return $this->whichOneof("output_format_serialization_options"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TableReadOptions::class, \Google\Cloud\BigQuery\Storage\V1\ReadSession_TableReadOptions::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession/TableReadOptions/ResponseCompressionCodec.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession/TableReadOptions/ResponseCompressionCodec.php new file mode 100644 index 000000000000..e64ed46852b7 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadSession/TableReadOptions/ResponseCompressionCodec.php @@ -0,0 +1,63 @@ +google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.ResponseCompressionCodec + */ +class ResponseCompressionCodec +{ + /** + * Default is no compression. + * + * Generated from protobuf enum RESPONSE_COMPRESSION_CODEC_UNSPECIFIED = 0; + */ + const RESPONSE_COMPRESSION_CODEC_UNSPECIFIED = 0; + /** + * Use raw LZ4 compression. + * + * Generated from protobuf enum RESPONSE_COMPRESSION_CODEC_LZ4 = 2; + */ + const RESPONSE_COMPRESSION_CODEC_LZ4 = 2; + + private static $valueToName = [ + self::RESPONSE_COMPRESSION_CODEC_UNSPECIFIED => 'RESPONSE_COMPRESSION_CODEC_UNSPECIFIED', + self::RESPONSE_COMPRESSION_CODEC_LZ4 => 'RESPONSE_COMPRESSION_CODEC_LZ4', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResponseCompressionCodec::class, \Google\Cloud\BigQuery\Storage\V1\ReadSession_TableReadOptions_ResponseCompressionCodec::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadStream.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadStream.php new file mode 100644 index 000000000000..c2f22fa51496 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ReadStream.php @@ -0,0 +1,73 @@ +google.cloud.bigquery.storage.v1.ReadStream + */ +class ReadStream extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the stream, in the form + * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Name of the stream, in the form + * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Stream::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the stream, in the form + * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Name of the stream, in the form + * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/RowError.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/RowError.php new file mode 100644 index 000000000000..123eae533c94 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/RowError.php @@ -0,0 +1,135 @@ +google.cloud.bigquery.storage.v1.RowError + */ +class RowError extends \Google\Protobuf\Internal\Message +{ + /** + * Index of the malformed row in the request. + * + * Generated from protobuf field int64 index = 1; + */ + protected $index = 0; + /** + * Structured error reason for a row error. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.RowError.RowErrorCode code = 2; + */ + protected $code = 0; + /** + * Description of the issue encountered when processing the row. + * + * Generated from protobuf field string message = 3; + */ + protected $message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $index + * Index of the malformed row in the request. + * @type int $code + * Structured error reason for a row error. + * @type string $message + * Description of the issue encountered when processing the row. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Index of the malformed row in the request. + * + * Generated from protobuf field int64 index = 1; + * @return int|string + */ + public function getIndex() + { + return $this->index; + } + + /** + * Index of the malformed row in the request. + * + * Generated from protobuf field int64 index = 1; + * @param int|string $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt64($var); + $this->index = $var; + + return $this; + } + + /** + * Structured error reason for a row error. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.RowError.RowErrorCode code = 2; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * Structured error reason for a row error. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.RowError.RowErrorCode code = 2; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\RowError\RowErrorCode::class); + $this->code = $var; + + return $this; + } + + /** + * Description of the issue encountered when processing the row. + * + * Generated from protobuf field string message = 3; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Description of the issue encountered when processing the row. + * + * Generated from protobuf field string message = 3; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/RowError/RowErrorCode.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/RowError/RowErrorCode.php new file mode 100644 index 000000000000..753c651381c7 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/RowError/RowErrorCode.php @@ -0,0 +1,57 @@ +google.cloud.bigquery.storage.v1.RowError.RowErrorCode + */ +class RowErrorCode +{ + /** + * Default error. + * + * Generated from protobuf enum ROW_ERROR_CODE_UNSPECIFIED = 0; + */ + const ROW_ERROR_CODE_UNSPECIFIED = 0; + /** + * One or more fields in the row has errors. + * + * Generated from protobuf enum FIELDS_ERROR = 1; + */ + const FIELDS_ERROR = 1; + + private static $valueToName = [ + self::ROW_ERROR_CODE_UNSPECIFIED => 'ROW_ERROR_CODE_UNSPECIFIED', + self::FIELDS_ERROR => 'FIELDS_ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RowErrorCode::class, \Google\Cloud\BigQuery\Storage\V1\RowError_RowErrorCode::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/SplitReadStreamRequest.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/SplitReadStreamRequest.php new file mode 100644 index 000000000000..7536ed18b71f --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/SplitReadStreamRequest.php @@ -0,0 +1,125 @@ +google.cloud.bigquery.storage.v1.SplitReadStreamRequest + */ +class SplitReadStreamRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the stream to split. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * A value in the range (0.0, 1.0) that specifies the fractional point at + * which the original stream should be split. The actual split point is + * evaluated on pre-filtered rows, so if a filter is provided, then there is + * no guarantee that the division of the rows between the new child streams + * will be proportional to this fractional value. Additionally, because the + * server-side unit for assigning data is collections of rows, this fraction + * will always map to a data storage boundary on the server side. + * + * Generated from protobuf field double fraction = 2; + */ + protected $fraction = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the stream to split. + * @type float $fraction + * A value in the range (0.0, 1.0) that specifies the fractional point at + * which the original stream should be split. The actual split point is + * evaluated on pre-filtered rows, so if a filter is provided, then there is + * no guarantee that the division of the rows between the new child streams + * will be proportional to this fractional value. Additionally, because the + * server-side unit for assigning data is collections of rows, this fraction + * will always map to a data storage boundary on the server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the stream to split. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the stream to split. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A value in the range (0.0, 1.0) that specifies the fractional point at + * which the original stream should be split. The actual split point is + * evaluated on pre-filtered rows, so if a filter is provided, then there is + * no guarantee that the division of the rows between the new child streams + * will be proportional to this fractional value. Additionally, because the + * server-side unit for assigning data is collections of rows, this fraction + * will always map to a data storage boundary on the server side. + * + * Generated from protobuf field double fraction = 2; + * @return float + */ + public function getFraction() + { + return $this->fraction; + } + + /** + * A value in the range (0.0, 1.0) that specifies the fractional point at + * which the original stream should be split. The actual split point is + * evaluated on pre-filtered rows, so if a filter is provided, then there is + * no guarantee that the division of the rows between the new child streams + * will be proportional to this fractional value. Additionally, because the + * server-side unit for assigning data is collections of rows, this fraction + * will always map to a data storage boundary on the server side. + * + * Generated from protobuf field double fraction = 2; + * @param float $var + * @return $this + */ + public function setFraction($var) + { + GPBUtil::checkDouble($var); + $this->fraction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/SplitReadStreamResponse.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/SplitReadStreamResponse.php new file mode 100644 index 000000000000..272562b4ea98 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/SplitReadStreamResponse.php @@ -0,0 +1,133 @@ +google.cloud.bigquery.storage.v1.SplitReadStreamResponse + */ +class SplitReadStreamResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Primary stream, which contains the beginning portion of + * |original_stream|. An empty value indicates that the original stream can no + * longer be split. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + */ + protected $primary_stream = null; + /** + * Remainder stream, which contains the tail of |original_stream|. An empty + * value indicates that the original stream can no longer be split. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + */ + protected $remainder_stream = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Storage\V1\ReadStream $primary_stream + * Primary stream, which contains the beginning portion of + * |original_stream|. An empty value indicates that the original stream can no + * longer be split. + * @type \Google\Cloud\BigQuery\Storage\V1\ReadStream $remainder_stream + * Remainder stream, which contains the tail of |original_stream|. An empty + * value indicates that the original stream can no longer be split. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Primary stream, which contains the beginning portion of + * |original_stream|. An empty value indicates that the original stream can no + * longer be split. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + * @return \Google\Cloud\BigQuery\Storage\V1\ReadStream|null + */ + public function getPrimaryStream() + { + return $this->primary_stream; + } + + public function hasPrimaryStream() + { + return isset($this->primary_stream); + } + + public function clearPrimaryStream() + { + unset($this->primary_stream); + } + + /** + * Primary stream, which contains the beginning portion of + * |original_stream|. An empty value indicates that the original stream can no + * longer be split. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + * @param \Google\Cloud\BigQuery\Storage\V1\ReadStream $var + * @return $this + */ + public function setPrimaryStream($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ReadStream::class); + $this->primary_stream = $var; + + return $this; + } + + /** + * Remainder stream, which contains the tail of |original_stream|. An empty + * value indicates that the original stream can no longer be split. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + * @return \Google\Cloud\BigQuery\Storage\V1\ReadStream|null + */ + public function getRemainderStream() + { + return $this->remainder_stream; + } + + public function hasRemainderStream() + { + return isset($this->remainder_stream); + } + + public function clearRemainderStream() + { + unset($this->remainder_stream); + } + + /** + * Remainder stream, which contains the tail of |original_stream|. An empty + * value indicates that the original stream can no longer be split. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + * @param \Google\Cloud\BigQuery\Storage\V1\ReadStream $var + * @return $this + */ + public function setRemainderStream($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ReadStream::class); + $this->remainder_stream = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StorageError.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StorageError.php new file mode 100644 index 000000000000..c5d4423b5b73 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StorageError.php @@ -0,0 +1,138 @@ +google.cloud.bigquery.storage.v1.StorageError + */ +class StorageError extends \Google\Protobuf\Internal\Message +{ + /** + * BigQuery Storage specific error code. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode code = 1; + */ + protected $code = 0; + /** + * Name of the failed entity. + * + * Generated from protobuf field string entity = 2; + */ + protected $entity = ''; + /** + * Message that describes the error. + * + * Generated from protobuf field string error_message = 3; + */ + protected $error_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * BigQuery Storage specific error code. + * @type string $entity + * Name of the failed entity. + * @type string $error_message + * Message that describes the error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * BigQuery Storage specific error code. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode code = 1; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * BigQuery Storage specific error code. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode code = 1; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\StorageError\StorageErrorCode::class); + $this->code = $var; + + return $this; + } + + /** + * Name of the failed entity. + * + * Generated from protobuf field string entity = 2; + * @return string + */ + public function getEntity() + { + return $this->entity; + } + + /** + * Name of the failed entity. + * + * Generated from protobuf field string entity = 2; + * @param string $var + * @return $this + */ + public function setEntity($var) + { + GPBUtil::checkString($var, True); + $this->entity = $var; + + return $this; + } + + /** + * Message that describes the error. + * + * Generated from protobuf field string error_message = 3; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * Message that describes the error. + * + * Generated from protobuf field string error_message = 3; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StorageError/StorageErrorCode.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StorageError/StorageErrorCode.php new file mode 100644 index 000000000000..47c1405c8364 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StorageError/StorageErrorCode.php @@ -0,0 +1,154 @@ +google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode + */ +class StorageErrorCode +{ + /** + * Default error. + * + * Generated from protobuf enum STORAGE_ERROR_CODE_UNSPECIFIED = 0; + */ + const STORAGE_ERROR_CODE_UNSPECIFIED = 0; + /** + * Table is not found in the system. + * + * Generated from protobuf enum TABLE_NOT_FOUND = 1; + */ + const TABLE_NOT_FOUND = 1; + /** + * Stream is already committed. + * + * Generated from protobuf enum STREAM_ALREADY_COMMITTED = 2; + */ + const STREAM_ALREADY_COMMITTED = 2; + /** + * Stream is not found. + * + * Generated from protobuf enum STREAM_NOT_FOUND = 3; + */ + const STREAM_NOT_FOUND = 3; + /** + * Invalid Stream type. + * For example, you try to commit a stream that is not pending. + * + * Generated from protobuf enum INVALID_STREAM_TYPE = 4; + */ + const INVALID_STREAM_TYPE = 4; + /** + * Invalid Stream state. + * For example, you try to commit a stream that is not finalized or is + * garbaged. + * + * Generated from protobuf enum INVALID_STREAM_STATE = 5; + */ + const INVALID_STREAM_STATE = 5; + /** + * Stream is finalized. + * + * Generated from protobuf enum STREAM_FINALIZED = 6; + */ + const STREAM_FINALIZED = 6; + /** + * There is a schema mismatch and it is caused by user schema has extra + * field than bigquery schema. + * + * Generated from protobuf enum SCHEMA_MISMATCH_EXTRA_FIELDS = 7; + */ + const SCHEMA_MISMATCH_EXTRA_FIELDS = 7; + /** + * Offset already exists. + * + * Generated from protobuf enum OFFSET_ALREADY_EXISTS = 8; + */ + const OFFSET_ALREADY_EXISTS = 8; + /** + * Offset out of range. + * + * Generated from protobuf enum OFFSET_OUT_OF_RANGE = 9; + */ + const OFFSET_OUT_OF_RANGE = 9; + /** + * Customer-managed encryption key (CMEK) not provided for CMEK-enabled + * data. + * + * Generated from protobuf enum CMEK_NOT_PROVIDED = 10; + */ + const CMEK_NOT_PROVIDED = 10; + /** + * Customer-managed encryption key (CMEK) was incorrectly provided. + * + * Generated from protobuf enum INVALID_CMEK_PROVIDED = 11; + */ + const INVALID_CMEK_PROVIDED = 11; + /** + * There is an encryption error while using customer-managed encryption key. + * + * Generated from protobuf enum CMEK_ENCRYPTION_ERROR = 12; + */ + const CMEK_ENCRYPTION_ERROR = 12; + /** + * Key Management Service (KMS) service returned an error, which can be + * retried. + * + * Generated from protobuf enum KMS_SERVICE_ERROR = 13; + */ + const KMS_SERVICE_ERROR = 13; + /** + * Permission denied while using customer-managed encryption key. + * + * Generated from protobuf enum KMS_PERMISSION_DENIED = 14; + */ + const KMS_PERMISSION_DENIED = 14; + + private static $valueToName = [ + self::STORAGE_ERROR_CODE_UNSPECIFIED => 'STORAGE_ERROR_CODE_UNSPECIFIED', + self::TABLE_NOT_FOUND => 'TABLE_NOT_FOUND', + self::STREAM_ALREADY_COMMITTED => 'STREAM_ALREADY_COMMITTED', + self::STREAM_NOT_FOUND => 'STREAM_NOT_FOUND', + self::INVALID_STREAM_TYPE => 'INVALID_STREAM_TYPE', + self::INVALID_STREAM_STATE => 'INVALID_STREAM_STATE', + self::STREAM_FINALIZED => 'STREAM_FINALIZED', + self::SCHEMA_MISMATCH_EXTRA_FIELDS => 'SCHEMA_MISMATCH_EXTRA_FIELDS', + self::OFFSET_ALREADY_EXISTS => 'OFFSET_ALREADY_EXISTS', + self::OFFSET_OUT_OF_RANGE => 'OFFSET_OUT_OF_RANGE', + self::CMEK_NOT_PROVIDED => 'CMEK_NOT_PROVIDED', + self::INVALID_CMEK_PROVIDED => 'INVALID_CMEK_PROVIDED', + self::CMEK_ENCRYPTION_ERROR => 'CMEK_ENCRYPTION_ERROR', + self::KMS_SERVICE_ERROR => 'KMS_SERVICE_ERROR', + self::KMS_PERMISSION_DENIED => 'KMS_PERMISSION_DENIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StorageErrorCode::class, \Google\Cloud\BigQuery\Storage\V1\StorageError_StorageErrorCode::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StreamStats.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StreamStats.php new file mode 100644 index 000000000000..595b148d28d7 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StreamStats.php @@ -0,0 +1,77 @@ +google.cloud.bigquery.storage.v1.StreamStats + */ +class StreamStats extends \Google\Protobuf\Internal\Message +{ + /** + * Represents the progress of the current stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + */ + protected $progress = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Storage\V1\StreamStats\Progress $progress + * Represents the progress of the current stream. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Represents the progress of the current stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + * @return \Google\Cloud\BigQuery\Storage\V1\StreamStats\Progress|null + */ + public function getProgress() + { + return $this->progress; + } + + public function hasProgress() + { + return isset($this->progress); + } + + public function clearProgress() + { + unset($this->progress); + } + + /** + * Represents the progress of the current stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + * @param \Google\Cloud\BigQuery\Storage\V1\StreamStats\Progress $var + * @return $this + */ + public function setProgress($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\StreamStats\Progress::class); + $this->progress = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StreamStats/Progress.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StreamStats/Progress.php new file mode 100644 index 000000000000..0c145546b306 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/StreamStats/Progress.php @@ -0,0 +1,142 @@ +google.cloud.bigquery.storage.v1.StreamStats.Progress + */ +class Progress extends \Google\Protobuf\Internal\Message +{ + /** + * The fraction of rows assigned to the stream that have been processed by + * the server so far, not including the rows in the current response + * message. + * This value, along with `at_response_end`, can be used to interpolate + * the progress made as the rows in the message are being processed using + * the following formula: `at_response_start + (at_response_end - + * at_response_start) * rows_processed_from_response / rows_in_response`. + * Note that if a filter is provided, the `at_response_end` value of the + * previous response may not necessarily be equal to the + * `at_response_start` value of the current response. + * + * Generated from protobuf field double at_response_start = 1; + */ + protected $at_response_start = 0.0; + /** + * Similar to `at_response_start`, except that this value includes the + * rows in the current response. + * + * Generated from protobuf field double at_response_end = 2; + */ + protected $at_response_end = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $at_response_start + * The fraction of rows assigned to the stream that have been processed by + * the server so far, not including the rows in the current response + * message. + * This value, along with `at_response_end`, can be used to interpolate + * the progress made as the rows in the message are being processed using + * the following formula: `at_response_start + (at_response_end - + * at_response_start) * rows_processed_from_response / rows_in_response`. + * Note that if a filter is provided, the `at_response_end` value of the + * previous response may not necessarily be equal to the + * `at_response_start` value of the current response. + * @type float $at_response_end + * Similar to `at_response_start`, except that this value includes the + * rows in the current response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * The fraction of rows assigned to the stream that have been processed by + * the server so far, not including the rows in the current response + * message. + * This value, along with `at_response_end`, can be used to interpolate + * the progress made as the rows in the message are being processed using + * the following formula: `at_response_start + (at_response_end - + * at_response_start) * rows_processed_from_response / rows_in_response`. + * Note that if a filter is provided, the `at_response_end` value of the + * previous response may not necessarily be equal to the + * `at_response_start` value of the current response. + * + * Generated from protobuf field double at_response_start = 1; + * @return float + */ + public function getAtResponseStart() + { + return $this->at_response_start; + } + + /** + * The fraction of rows assigned to the stream that have been processed by + * the server so far, not including the rows in the current response + * message. + * This value, along with `at_response_end`, can be used to interpolate + * the progress made as the rows in the message are being processed using + * the following formula: `at_response_start + (at_response_end - + * at_response_start) * rows_processed_from_response / rows_in_response`. + * Note that if a filter is provided, the `at_response_end` value of the + * previous response may not necessarily be equal to the + * `at_response_start` value of the current response. + * + * Generated from protobuf field double at_response_start = 1; + * @param float $var + * @return $this + */ + public function setAtResponseStart($var) + { + GPBUtil::checkDouble($var); + $this->at_response_start = $var; + + return $this; + } + + /** + * Similar to `at_response_start`, except that this value includes the + * rows in the current response. + * + * Generated from protobuf field double at_response_end = 2; + * @return float + */ + public function getAtResponseEnd() + { + return $this->at_response_end; + } + + /** + * Similar to `at_response_start`, except that this value includes the + * rows in the current response. + * + * Generated from protobuf field double at_response_end = 2; + * @param float $var + * @return $this + */ + public function setAtResponseEnd($var) + { + GPBUtil::checkDouble($var); + $this->at_response_end = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Progress::class, \Google\Cloud\BigQuery\Storage\V1\StreamStats_Progress::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema.php new file mode 100644 index 000000000000..f435b08ae188 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema.php @@ -0,0 +1,535 @@ +google.cloud.bigquery.storage.v1.TableFieldSchema + */ +class TableFieldSchema extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The field name. The name must contain only letters (a-z, A-Z), + * numbers (0-9), or underscores (_), and must start with a letter or + * underscore. The maximum length is 128 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The field data type. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + /** + * Optional. The field mode. The default value is NULLABLE. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.Mode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = 0; + /** + * Optional. Describes the nested schema fields if the type property is set to + * STRUCT. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.TableFieldSchema fields = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $fields; + /** + * Optional. The field description. The maximum length is 1,024 characters. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Maximum length of values of this field for STRINGS or BYTES. + * If max_length is not specified, no maximum length constraint is imposed + * on this field. + * If type = "STRING", then max_length represents the maximum UTF-8 + * length of strings in this field. + * If type = "BYTES", then max_length represents the maximum number of + * bytes in this field. + * It is invalid to set this field if type is not "STRING" or "BYTES". + * + * Generated from protobuf field int64 max_length = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_length = 0; + /** + * Optional. Precision (maximum number of total digits in base 10) and scale + * (maximum number of digits in the fractional part in base 10) constraints + * for values of this field for NUMERIC or BIGNUMERIC. + * It is invalid to set precision or scale if type is not "NUMERIC" or + * "BIGNUMERIC". + * If precision and scale are not specified, no value range constraint is + * imposed on this field insofar as values are permitted by the type. + * Values of this NUMERIC or BIGNUMERIC field must be in this range when: + * * Precision (P) and scale (S) are specified: + * [-10^(P-S) + 10^(-S), 10^(P-S) - 10^(-S)] + * * Precision (P) is specified but not scale (and thus scale is + * interpreted to be equal to zero): + * [-10^P + 1, 10^P - 1]. + * Acceptable values for precision and scale if both are specified: + * * If type = "NUMERIC": + * 1 <= precision - scale <= 29 and 0 <= scale <= 9. + * * If type = "BIGNUMERIC": + * 1 <= precision - scale <= 38 and 0 <= scale <= 38. + * Acceptable values for precision if only precision is specified but not + * scale (and thus scale is interpreted to be equal to zero): + * * If type = "NUMERIC": 1 <= precision <= 29. + * * If type = "BIGNUMERIC": 1 <= precision <= 38. + * If scale is specified but not precision, then it is invalid. + * + * Generated from protobuf field int64 precision = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $precision = 0; + /** + * Optional. See documentation for precision. + * + * Generated from protobuf field int64 scale = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $scale = 0; + /** + * Optional. A SQL expression to specify the [default value] + * (https://cloud.google.com/bigquery/docs/default-values) for this field. + * + * Generated from protobuf field string default_value_expression = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $default_value_expression = ''; + /** + * Optional. The subtype of the RANGE, if the type of this field is RANGE. If + * the type is RANGE, this field is required. Possible values for the field + * element type of a RANGE include: + * * DATE + * * DATETIME + * * TIMESTAMP + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.FieldElementType range_element_type = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $range_element_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The field name. The name must contain only letters (a-z, A-Z), + * numbers (0-9), or underscores (_), and must start with a letter or + * underscore. The maximum length is 128 characters. + * @type int $type + * Required. The field data type. + * @type int $mode + * Optional. The field mode. The default value is NULLABLE. + * @type array<\Google\Cloud\BigQuery\Storage\V1\TableFieldSchema>|\Google\Protobuf\Internal\RepeatedField $fields + * Optional. Describes the nested schema fields if the type property is set to + * STRUCT. + * @type string $description + * Optional. The field description. The maximum length is 1,024 characters. + * @type int|string $max_length + * Optional. Maximum length of values of this field for STRINGS or BYTES. + * If max_length is not specified, no maximum length constraint is imposed + * on this field. + * If type = "STRING", then max_length represents the maximum UTF-8 + * length of strings in this field. + * If type = "BYTES", then max_length represents the maximum number of + * bytes in this field. + * It is invalid to set this field if type is not "STRING" or "BYTES". + * @type int|string $precision + * Optional. Precision (maximum number of total digits in base 10) and scale + * (maximum number of digits in the fractional part in base 10) constraints + * for values of this field for NUMERIC or BIGNUMERIC. + * It is invalid to set precision or scale if type is not "NUMERIC" or + * "BIGNUMERIC". + * If precision and scale are not specified, no value range constraint is + * imposed on this field insofar as values are permitted by the type. + * Values of this NUMERIC or BIGNUMERIC field must be in this range when: + * * Precision (P) and scale (S) are specified: + * [-10^(P-S) + 10^(-S), 10^(P-S) - 10^(-S)] + * * Precision (P) is specified but not scale (and thus scale is + * interpreted to be equal to zero): + * [-10^P + 1, 10^P - 1]. + * Acceptable values for precision and scale if both are specified: + * * If type = "NUMERIC": + * 1 <= precision - scale <= 29 and 0 <= scale <= 9. + * * If type = "BIGNUMERIC": + * 1 <= precision - scale <= 38 and 0 <= scale <= 38. + * Acceptable values for precision if only precision is specified but not + * scale (and thus scale is interpreted to be equal to zero): + * * If type = "NUMERIC": 1 <= precision <= 29. + * * If type = "BIGNUMERIC": 1 <= precision <= 38. + * If scale is specified but not precision, then it is invalid. + * @type int|string $scale + * Optional. See documentation for precision. + * @type string $default_value_expression + * Optional. A SQL expression to specify the [default value] + * (https://cloud.google.com/bigquery/docs/default-values) for this field. + * @type \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema\FieldElementType $range_element_type + * Optional. The subtype of the RANGE, if the type of this field is RANGE. If + * the type is RANGE, this field is required. Possible values for the field + * element type of a RANGE include: + * * DATE + * * DATETIME + * * TIMESTAMP + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Table::initOnce(); + parent::__construct($data); + } + + /** + * Required. The field name. The name must contain only letters (a-z, A-Z), + * numbers (0-9), or underscores (_), and must start with a letter or + * underscore. The maximum length is 128 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The field name. The name must contain only letters (a-z, A-Z), + * numbers (0-9), or underscores (_), and must start with a letter or + * underscore. The maximum length is 128 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The field data type. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The field data type. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Optional. The field mode. The default value is NULLABLE. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.Mode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Optional. The field mode. The default value is NULLABLE. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.Mode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema\Mode::class); + $this->mode = $var; + + return $this; + } + + /** + * Optional. Describes the nested schema fields if the type property is set to + * STRUCT. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.TableFieldSchema fields = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * Optional. Describes the nested schema fields if the type property is set to + * STRUCT. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.TableFieldSchema fields = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BigQuery\Storage\V1\TableFieldSchema>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema::class); + $this->fields = $arr; + + return $this; + } + + /** + * Optional. The field description. The maximum length is 1,024 characters. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The field description. The maximum length is 1,024 characters. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Maximum length of values of this field for STRINGS or BYTES. + * If max_length is not specified, no maximum length constraint is imposed + * on this field. + * If type = "STRING", then max_length represents the maximum UTF-8 + * length of strings in this field. + * If type = "BYTES", then max_length represents the maximum number of + * bytes in this field. + * It is invalid to set this field if type is not "STRING" or "BYTES". + * + * Generated from protobuf field int64 max_length = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getMaxLength() + { + return $this->max_length; + } + + /** + * Optional. Maximum length of values of this field for STRINGS or BYTES. + * If max_length is not specified, no maximum length constraint is imposed + * on this field. + * If type = "STRING", then max_length represents the maximum UTF-8 + * length of strings in this field. + * If type = "BYTES", then max_length represents the maximum number of + * bytes in this field. + * It is invalid to set this field if type is not "STRING" or "BYTES". + * + * Generated from protobuf field int64 max_length = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setMaxLength($var) + { + GPBUtil::checkInt64($var); + $this->max_length = $var; + + return $this; + } + + /** + * Optional. Precision (maximum number of total digits in base 10) and scale + * (maximum number of digits in the fractional part in base 10) constraints + * for values of this field for NUMERIC or BIGNUMERIC. + * It is invalid to set precision or scale if type is not "NUMERIC" or + * "BIGNUMERIC". + * If precision and scale are not specified, no value range constraint is + * imposed on this field insofar as values are permitted by the type. + * Values of this NUMERIC or BIGNUMERIC field must be in this range when: + * * Precision (P) and scale (S) are specified: + * [-10^(P-S) + 10^(-S), 10^(P-S) - 10^(-S)] + * * Precision (P) is specified but not scale (and thus scale is + * interpreted to be equal to zero): + * [-10^P + 1, 10^P - 1]. + * Acceptable values for precision and scale if both are specified: + * * If type = "NUMERIC": + * 1 <= precision - scale <= 29 and 0 <= scale <= 9. + * * If type = "BIGNUMERIC": + * 1 <= precision - scale <= 38 and 0 <= scale <= 38. + * Acceptable values for precision if only precision is specified but not + * scale (and thus scale is interpreted to be equal to zero): + * * If type = "NUMERIC": 1 <= precision <= 29. + * * If type = "BIGNUMERIC": 1 <= precision <= 38. + * If scale is specified but not precision, then it is invalid. + * + * Generated from protobuf field int64 precision = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getPrecision() + { + return $this->precision; + } + + /** + * Optional. Precision (maximum number of total digits in base 10) and scale + * (maximum number of digits in the fractional part in base 10) constraints + * for values of this field for NUMERIC or BIGNUMERIC. + * It is invalid to set precision or scale if type is not "NUMERIC" or + * "BIGNUMERIC". + * If precision and scale are not specified, no value range constraint is + * imposed on this field insofar as values are permitted by the type. + * Values of this NUMERIC or BIGNUMERIC field must be in this range when: + * * Precision (P) and scale (S) are specified: + * [-10^(P-S) + 10^(-S), 10^(P-S) - 10^(-S)] + * * Precision (P) is specified but not scale (and thus scale is + * interpreted to be equal to zero): + * [-10^P + 1, 10^P - 1]. + * Acceptable values for precision and scale if both are specified: + * * If type = "NUMERIC": + * 1 <= precision - scale <= 29 and 0 <= scale <= 9. + * * If type = "BIGNUMERIC": + * 1 <= precision - scale <= 38 and 0 <= scale <= 38. + * Acceptable values for precision if only precision is specified but not + * scale (and thus scale is interpreted to be equal to zero): + * * If type = "NUMERIC": 1 <= precision <= 29. + * * If type = "BIGNUMERIC": 1 <= precision <= 38. + * If scale is specified but not precision, then it is invalid. + * + * Generated from protobuf field int64 precision = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setPrecision($var) + { + GPBUtil::checkInt64($var); + $this->precision = $var; + + return $this; + } + + /** + * Optional. See documentation for precision. + * + * Generated from protobuf field int64 scale = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getScale() + { + return $this->scale; + } + + /** + * Optional. See documentation for precision. + * + * Generated from protobuf field int64 scale = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setScale($var) + { + GPBUtil::checkInt64($var); + $this->scale = $var; + + return $this; + } + + /** + * Optional. A SQL expression to specify the [default value] + * (https://cloud.google.com/bigquery/docs/default-values) for this field. + * + * Generated from protobuf field string default_value_expression = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDefaultValueExpression() + { + return $this->default_value_expression; + } + + /** + * Optional. A SQL expression to specify the [default value] + * (https://cloud.google.com/bigquery/docs/default-values) for this field. + * + * Generated from protobuf field string default_value_expression = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDefaultValueExpression($var) + { + GPBUtil::checkString($var, True); + $this->default_value_expression = $var; + + return $this; + } + + /** + * Optional. The subtype of the RANGE, if the type of this field is RANGE. If + * the type is RANGE, this field is required. Possible values for the field + * element type of a RANGE include: + * * DATE + * * DATETIME + * * TIMESTAMP + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.FieldElementType range_element_type = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema\FieldElementType|null + */ + public function getRangeElementType() + { + return $this->range_element_type; + } + + public function hasRangeElementType() + { + return isset($this->range_element_type); + } + + public function clearRangeElementType() + { + unset($this->range_element_type); + } + + /** + * Optional. The subtype of the RANGE, if the type of this field is RANGE. If + * the type is RANGE, this field is required. Possible values for the field + * element type of a RANGE include: + * * DATE + * * DATETIME + * * TIMESTAMP + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.FieldElementType range_element_type = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema\FieldElementType $var + * @return $this + */ + public function setRangeElementType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema\FieldElementType::class); + $this->range_element_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema/FieldElementType.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema/FieldElementType.php new file mode 100644 index 000000000000..3ce7bc2b9dac --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema/FieldElementType.php @@ -0,0 +1,70 @@ +google.cloud.bigquery.storage.v1.TableFieldSchema.FieldElementType + */ +class FieldElementType extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The type of a field element. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.Type type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Required. The type of a field element. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Table::initOnce(); + parent::__construct($data); + } + + /** + * Required. The type of a field element. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.Type type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The type of a field element. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableFieldSchema.Type type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema\Type::class); + $this->type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FieldElementType::class, \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema_FieldElementType::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema/Mode.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema/Mode.php new file mode 100644 index 000000000000..8fc99eec5196 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema/Mode.php @@ -0,0 +1,63 @@ +google.cloud.bigquery.storage.v1.TableFieldSchema.Mode + */ +class Mode +{ + /** + * Illegal value + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Generated from protobuf enum NULLABLE = 1; + */ + const NULLABLE = 1; + /** + * Generated from protobuf enum REQUIRED = 2; + */ + const REQUIRED = 2; + /** + * Generated from protobuf enum REPEATED = 3; + */ + const REPEATED = 3; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::NULLABLE => 'NULLABLE', + self::REQUIRED => 'REQUIRED', + self::REPEATED => 'REPEATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema_Mode::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema/Type.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema/Type.php new file mode 100644 index 000000000000..bf9405b5ff75 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableFieldSchema/Type.php @@ -0,0 +1,160 @@ +google.cloud.bigquery.storage.v1.TableFieldSchema.Type + */ +class Type +{ + /** + * Illegal value + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * 64K, UTF8 + * + * Generated from protobuf enum STRING = 1; + */ + const STRING = 1; + /** + * 64-bit signed + * + * Generated from protobuf enum INT64 = 2; + */ + const INT64 = 2; + /** + * 64-bit IEEE floating point + * + * Generated from protobuf enum DOUBLE = 3; + */ + const DOUBLE = 3; + /** + * Aggregate type + * + * Generated from protobuf enum STRUCT = 4; + */ + const STRUCT = 4; + /** + * 64K, Binary + * + * Generated from protobuf enum BYTES = 5; + */ + const BYTES = 5; + /** + * 2-valued + * + * Generated from protobuf enum BOOL = 6; + */ + const BOOL = 6; + /** + * 64-bit signed usec since UTC epoch + * + * Generated from protobuf enum TIMESTAMP = 7; + */ + const TIMESTAMP = 7; + /** + * Civil date - Year, Month, Day + * + * Generated from protobuf enum DATE = 8; + */ + const DATE = 8; + /** + * Civil time - Hour, Minute, Second, Microseconds + * + * Generated from protobuf enum TIME = 9; + */ + const TIME = 9; + /** + * Combination of civil date and civil time + * + * Generated from protobuf enum DATETIME = 10; + */ + const DATETIME = 10; + /** + * Geography object + * + * Generated from protobuf enum GEOGRAPHY = 11; + */ + const GEOGRAPHY = 11; + /** + * Numeric value + * + * Generated from protobuf enum NUMERIC = 12; + */ + const NUMERIC = 12; + /** + * BigNumeric value + * + * Generated from protobuf enum BIGNUMERIC = 13; + */ + const BIGNUMERIC = 13; + /** + * Interval + * + * Generated from protobuf enum INTERVAL = 14; + */ + const INTERVAL = 14; + /** + * JSON, String + * + * Generated from protobuf enum JSON = 15; + */ + const JSON = 15; + /** + * RANGE + * + * Generated from protobuf enum RANGE = 16; + */ + const RANGE = 16; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::STRING => 'STRING', + self::INT64 => 'INT64', + self::DOUBLE => 'DOUBLE', + self::STRUCT => 'STRUCT', + self::BYTES => 'BYTES', + self::BOOL => 'BOOL', + self::TIMESTAMP => 'TIMESTAMP', + self::DATE => 'DATE', + self::TIME => 'TIME', + self::DATETIME => 'DATETIME', + self::GEOGRAPHY => 'GEOGRAPHY', + self::NUMERIC => 'NUMERIC', + self::BIGNUMERIC => 'BIGNUMERIC', + self::INTERVAL => 'INTERVAL', + self::JSON => 'JSON', + self::RANGE => 'RANGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema_Type::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableSchema.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableSchema.php new file mode 100644 index 000000000000..8aaba43df1d9 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/TableSchema.php @@ -0,0 +1,69 @@ +google.cloud.bigquery.storage.v1.TableSchema + */ +class TableSchema extends \Google\Protobuf\Internal\Message +{ + /** + * Describes the fields in a table. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.TableFieldSchema fields = 1; + */ + private $fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BigQuery\Storage\V1\TableFieldSchema>|\Google\Protobuf\Internal\RepeatedField $fields + * Describes the fields in a table. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Table::initOnce(); + parent::__construct($data); + } + + /** + * Describes the fields in a table. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.TableFieldSchema fields = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * Describes the fields in a table. + * + * Generated from protobuf field repeated .google.cloud.bigquery.storage.v1.TableFieldSchema fields = 1; + * @param array<\Google\Cloud\BigQuery\Storage\V1\TableFieldSchema>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Storage\V1\TableFieldSchema::class); + $this->fields = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ThrottleState.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ThrottleState.php new file mode 100644 index 000000000000..2680abd3dee0 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/ThrottleState.php @@ -0,0 +1,71 @@ +google.cloud.bigquery.storage.v1.ThrottleState + */ +class ThrottleState extends \Google\Protobuf\Internal\Message +{ + /** + * How much this connection is being throttled. Zero means no throttling, + * 100 means fully throttled. + * + * Generated from protobuf field int32 throttle_percent = 1; + */ + protected $throttle_percent = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $throttle_percent + * How much this connection is being throttled. Zero means no throttling, + * 100 means fully throttled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * How much this connection is being throttled. Zero means no throttling, + * 100 means fully throttled. + * + * Generated from protobuf field int32 throttle_percent = 1; + * @return int + */ + public function getThrottlePercent() + { + return $this->throttle_percent; + } + + /** + * How much this connection is being throttled. Zero means no throttling, + * 100 means fully throttled. + * + * Generated from protobuf field int32 throttle_percent = 1; + * @param int $var + * @return $this + */ + public function setThrottlePercent($var) + { + GPBUtil::checkInt32($var); + $this->throttle_percent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStream.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStream.php new file mode 100644 index 000000000000..c49dce81a82e --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStream.php @@ -0,0 +1,341 @@ +google.cloud.bigquery.storage.v1.WriteStream + */ +class WriteStream extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the stream, in the form + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Immutable. Type of the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStream.Type type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $type = 0; + /** + * Output only. Create time of the stream. For the _default stream, this is + * the creation_time of the table. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Commit time of the stream. + * If a stream is of `COMMITTED` type, then it will have a commit_time same as + * `create_time`. If the stream is of `PENDING` type, empty commit_time + * means it is not committed. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $commit_time = null; + /** + * Output only. The schema of the destination table. It is only returned in + * `CreateWriteStream` response. Caller should generate data that's + * compatible with this schema to send in initial `AppendRowsRequest`. + * The table schema could go out of date during the life time of the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableSchema table_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $table_schema = null; + /** + * Immutable. Mode of the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $write_mode = 0; + /** + * Immutable. The geographic location where the stream's dataset resides. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * + * Generated from protobuf field string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $location = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Name of the stream, in the form + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * @type int $type + * Immutable. Type of the stream. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time of the stream. For the _default stream, this is + * the creation_time of the table. + * @type \Google\Protobuf\Timestamp $commit_time + * Output only. Commit time of the stream. + * If a stream is of `COMMITTED` type, then it will have a commit_time same as + * `create_time`. If the stream is of `PENDING` type, empty commit_time + * means it is not committed. + * @type \Google\Cloud\BigQuery\Storage\V1\TableSchema $table_schema + * Output only. The schema of the destination table. It is only returned in + * `CreateWriteStream` response. Caller should generate data that's + * compatible with this schema to send in initial `AppendRowsRequest`. + * The table schema could go out of date during the life time of the stream. + * @type int $write_mode + * Immutable. Mode of the stream. + * @type string $location + * Immutable. The geographic location where the stream's dataset resides. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Stream::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the stream, in the form + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Name of the stream, in the form + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Immutable. Type of the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStream.Type type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Immutable. Type of the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStream.Type type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\WriteStream\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. Create time of the stream. For the _default stream, this is + * the creation_time of the table. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Create time of the stream. For the _default stream, this is + * the creation_time of the table. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Commit time of the stream. + * If a stream is of `COMMITTED` type, then it will have a commit_time same as + * `create_time`. If the stream is of `PENDING` type, empty commit_time + * means it is not committed. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCommitTime() + { + return $this->commit_time; + } + + public function hasCommitTime() + { + return isset($this->commit_time); + } + + public function clearCommitTime() + { + unset($this->commit_time); + } + + /** + * Output only. Commit time of the stream. + * If a stream is of `COMMITTED` type, then it will have a commit_time same as + * `create_time`. If the stream is of `PENDING` type, empty commit_time + * means it is not committed. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCommitTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->commit_time = $var; + + return $this; + } + + /** + * Output only. The schema of the destination table. It is only returned in + * `CreateWriteStream` response. Caller should generate data that's + * compatible with this schema to send in initial `AppendRowsRequest`. + * The table schema could go out of date during the life time of the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableSchema table_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BigQuery\Storage\V1\TableSchema|null + */ + public function getTableSchema() + { + return $this->table_schema; + } + + public function hasTableSchema() + { + return isset($this->table_schema); + } + + public function clearTableSchema() + { + unset($this->table_schema); + } + + /** + * Output only. The schema of the destination table. It is only returned in + * `CreateWriteStream` response. Caller should generate data that's + * compatible with this schema to send in initial `AppendRowsRequest`. + * The table schema could go out of date during the life time of the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.TableSchema table_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Storage\V1\TableSchema $var + * @return $this + */ + public function setTableSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\TableSchema::class); + $this->table_schema = $var; + + return $this; + } + + /** + * Immutable. Mode of the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getWriteMode() + { + return $this->write_mode; + } + + /** + * Immutable. Mode of the stream. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setWriteMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Storage\V1\WriteStream\WriteMode::class); + $this->write_mode = $var; + + return $this; + } + + /** + * Immutable. The geographic location where the stream's dataset resides. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * + * Generated from protobuf field string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Immutable. The geographic location where the stream's dataset resides. See + * https://cloud.google.com/bigquery/docs/locations for supported + * locations. + * + * Generated from protobuf field string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStream/Type.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStream/Type.php new file mode 100644 index 000000000000..f8c772aef35d --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStream/Type.php @@ -0,0 +1,72 @@ +google.cloud.bigquery.storage.v1.WriteStream.Type + */ +class Type +{ + /** + * Unknown type. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Data will commit automatically and appear as soon as the write is + * acknowledged. + * + * Generated from protobuf enum COMMITTED = 1; + */ + const COMMITTED = 1; + /** + * Data is invisible until the stream is committed. + * + * Generated from protobuf enum PENDING = 2; + */ + const PENDING = 2; + /** + * Data is only visible up to the offset to which it was flushed. + * + * Generated from protobuf enum BUFFERED = 3; + */ + const BUFFERED = 3; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::COMMITTED => 'COMMITTED', + self::PENDING => 'PENDING', + self::BUFFERED => 'BUFFERED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\BigQuery\Storage\V1\WriteStream_Type::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStream/WriteMode.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStream/WriteMode.php new file mode 100644 index 000000000000..1f21103bc93d --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStream/WriteMode.php @@ -0,0 +1,58 @@ +google.cloud.bigquery.storage.v1.WriteStream.WriteMode + */ +class WriteMode +{ + /** + * Unknown type. + * + * Generated from protobuf enum WRITE_MODE_UNSPECIFIED = 0; + */ + const WRITE_MODE_UNSPECIFIED = 0; + /** + * Insert new records into the table. + * It is the default value if customers do not specify it. + * + * Generated from protobuf enum INSERT = 1; + */ + const INSERT = 1; + + private static $valueToName = [ + self::WRITE_MODE_UNSPECIFIED => 'WRITE_MODE_UNSPECIFIED', + self::INSERT => 'INSERT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(WriteMode::class, \Google\Cloud\BigQuery\Storage\V1\WriteStream_WriteMode::class); + diff --git a/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStreamView.php b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStreamView.php new file mode 100644 index 000000000000..5d008746e9fe --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/proto/src/Google/Cloud/BigQuery/Storage/V1/WriteStreamView.php @@ -0,0 +1,66 @@ +google.cloud.bigquery.storage.v1.WriteStreamView + */ +class WriteStreamView +{ + /** + * The default / unset value. + * + * Generated from protobuf enum WRITE_STREAM_VIEW_UNSPECIFIED = 0; + */ + const WRITE_STREAM_VIEW_UNSPECIFIED = 0; + /** + * The BASIC projection returns basic metadata about a write stream. The + * basic view does not include schema information. This is the default view + * returned by GetWriteStream. + * + * Generated from protobuf enum BASIC = 1; + */ + const BASIC = 1; + /** + * The FULL projection returns all available write stream metadata, including + * the schema. CreateWriteStream returns the full projection of write stream + * metadata. + * + * Generated from protobuf enum FULL = 2; + */ + const FULL = 2; + + private static $valueToName = [ + self::WRITE_STREAM_VIEW_UNSPECIFIED => 'WRITE_STREAM_VIEW_UNSPECIFIED', + self::BASIC => 'BASIC', + self::FULL => 'FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryReadClient/create_read_session.php b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryReadClient/create_read_session.php new file mode 100644 index 000000000000..9f0268f26fe2 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryReadClient/create_read_session.php @@ -0,0 +1,92 @@ +setParent($formattedParent) + ->setReadSession($readSession); + + // Call the API and handle any network failures. + try { + /** @var ReadSession $response */ + $response = $bigQueryReadClient->createReadSession($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigQueryReadClient::projectName('[PROJECT]'); + + create_read_session_sample($formattedParent); +} +// [END bigquerystorage_v1_generated_BigQueryRead_CreateReadSession_sync] diff --git a/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryReadClient/read_rows.php b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryReadClient/read_rows.php new file mode 100644 index 000000000000..8c6fabde6488 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryReadClient/read_rows.php @@ -0,0 +1,87 @@ +setReadStream($formattedReadStream); + + // Call the API and handle any network failures. + try { + /** @var ServerStream $stream */ + $stream = $bigQueryReadClient->readRows($request); + + /** @var ReadRowsResponse $element */ + foreach ($stream->readAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedReadStream = BigQueryReadClient::readStreamName( + '[PROJECT]', + '[LOCATION]', + '[SESSION]', + '[STREAM]' + ); + + read_rows_sample($formattedReadStream); +} +// [END bigquerystorage_v1_generated_BigQueryRead_ReadRows_sync] diff --git a/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryReadClient/split_read_stream.php b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryReadClient/split_read_stream.php new file mode 100644 index 000000000000..d4ca17c4ca0a --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryReadClient/split_read_stream.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SplitReadStreamResponse $response */ + $response = $bigQueryReadClient->splitReadStream($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigQueryReadClient::readStreamName( + '[PROJECT]', + '[LOCATION]', + '[SESSION]', + '[STREAM]' + ); + + split_read_stream_sample($formattedName); +} +// [END bigquerystorage_v1_generated_BigQueryRead_SplitReadStream_sync] diff --git a/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/append_rows.php b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/append_rows.php new file mode 100644 index 000000000000..ce8a38bab12b --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/append_rows.php @@ -0,0 +1,143 @@ +setWriteStream($formattedWriteStream); + + // Call the API and handle any network failures. + try { + /** @var BidiStream $stream */ + $stream = $bigQueryWriteClient->appendRows(); + $stream->writeAll([$request,]); + + /** @var AppendRowsResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedWriteStream = BigQueryWriteClient::writeStreamName( + '[PROJECT]', + '[DATASET]', + '[TABLE]', + '[STREAM]' + ); + + append_rows_sample($formattedWriteStream); +} +// [END bigquerystorage_v1_generated_BigQueryWrite_AppendRows_sync] diff --git a/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/batch_commit_write_streams.php b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/batch_commit_write_streams.php new file mode 100644 index 000000000000..dee9cd4ef5c4 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/batch_commit_write_streams.php @@ -0,0 +1,83 @@ +setParent($formattedParent) + ->setWriteStreams($writeStreams); + + // Call the API and handle any network failures. + try { + /** @var BatchCommitWriteStreamsResponse $response */ + $response = $bigQueryWriteClient->batchCommitWriteStreams($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigQueryWriteClient::tableName('[PROJECT]', '[DATASET]', '[TABLE]'); + $writeStreamsElement = '[WRITE_STREAMS]'; + + batch_commit_write_streams_sample($formattedParent, $writeStreamsElement); +} +// [END bigquerystorage_v1_generated_BigQueryWrite_BatchCommitWriteStreams_sync] diff --git a/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/create_write_stream.php b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/create_write_stream.php new file mode 100644 index 000000000000..42802be34b6c --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/create_write_stream.php @@ -0,0 +1,79 @@ +setParent($formattedParent) + ->setWriteStream($writeStream); + + // Call the API and handle any network failures. + try { + /** @var WriteStream $response */ + $response = $bigQueryWriteClient->createWriteStream($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigQueryWriteClient::tableName('[PROJECT]', '[DATASET]', '[TABLE]'); + + create_write_stream_sample($formattedParent); +} +// [END bigquerystorage_v1_generated_BigQueryWrite_CreateWriteStream_sync] diff --git a/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/finalize_write_stream.php b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/finalize_write_stream.php new file mode 100644 index 000000000000..980109a2d895 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/finalize_write_stream.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var FinalizeWriteStreamResponse $response */ + $response = $bigQueryWriteClient->finalizeWriteStream($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigQueryWriteClient::writeStreamName( + '[PROJECT]', + '[DATASET]', + '[TABLE]', + '[STREAM]' + ); + + finalize_write_stream_sample($formattedName); +} +// [END bigquerystorage_v1_generated_BigQueryWrite_FinalizeWriteStream_sync] diff --git a/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/flush_rows.php b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/flush_rows.php new file mode 100644 index 000000000000..413fe426771e --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/flush_rows.php @@ -0,0 +1,83 @@ +setWriteStream($formattedWriteStream); + + // Call the API and handle any network failures. + try { + /** @var FlushRowsResponse $response */ + $response = $bigQueryWriteClient->flushRows($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedWriteStream = BigQueryWriteClient::writeStreamName( + '[PROJECT]', + '[DATASET]', + '[TABLE]', + '[STREAM]' + ); + + flush_rows_sample($formattedWriteStream); +} +// [END bigquerystorage_v1_generated_BigQueryWrite_FlushRows_sync] diff --git a/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/get_write_stream.php b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/get_write_stream.php new file mode 100644 index 000000000000..d8bbaf0d5d06 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/samples/V1/BigQueryWriteClient/get_write_stream.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var WriteStream $response */ + $response = $bigQueryWriteClient->getWriteStream($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigQueryWriteClient::writeStreamName( + '[PROJECT]', + '[DATASET]', + '[TABLE]', + '[STREAM]' + ); + + get_write_stream_sample($formattedName); +} +// [END bigquerystorage_v1_generated_BigQueryWrite_GetWriteStream_sync] diff --git a/owl-bot-staging/BigQueryStorage/v1/src/V1/Client/BigQueryReadClient.php b/owl-bot-staging/BigQueryStorage/v1/src/V1/Client/BigQueryReadClient.php new file mode 100644 index 000000000000..f7149115c008 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/src/V1/Client/BigQueryReadClient.php @@ -0,0 +1,392 @@ + createReadSessionAsync(CreateReadSessionRequest $request, array $optionalArgs = []) + * @method PromiseInterface splitReadStreamAsync(SplitReadStreamRequest $request, array $optionalArgs = []) + */ +final class BigQueryReadClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.bigquery.storage.v1.BigQueryRead'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'bigquerystorage.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'bigquerystorage.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/big_query_read_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/big_query_read_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/big_query_read_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/big_query_read_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a read_session + * resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted read_session resource. + */ + public static function readSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('readSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a read_stream + * resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $stream + * + * @return string The formatted read_stream resource. + */ + public static function readStreamName(string $project, string $location, string $session, string $stream): string + { + return self::getPathTemplate('readStream')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'stream' => $stream, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a table + * resource. + * + * @param string $project + * @param string $dataset + * @param string $table + * + * @return string The formatted table resource. + */ + public static function tableName(string $project, string $dataset, string $table): string + { + return self::getPathTemplate('table')->render([ + 'project' => $project, + 'dataset' => $dataset, + 'table' => $table, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - project: projects/{project} + * - readSession: projects/{project}/locations/{location}/sessions/{session} + * - readStream: projects/{project}/locations/{location}/sessions/{session}/streams/{stream} + * - table: projects/{project}/datasets/{dataset}/tables/{table} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'bigquerystorage.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new read session. A read session divides the contents of a + * BigQuery table into one or more streams, which can then be used to read + * data from the table. The read session also specifies properties of the + * data to be read, such as a list of columns or a push-down filter describing + * the rows to be returned. + * + * A particular row can be read by at most one stream. When the caller has + * reached the end of each stream in the session, then all the data in the + * table has been read. + * + * Data is assigned to each stream such that roughly the same number of + * rows can be read from each stream. Because the server-side unit for + * assigning data is collections of rows, the API does not guarantee that + * each stream will return the same number or rows. Additionally, the + * limits are enforced based on the number of pre-filtered rows, so some + * filters can lead to lopsided assignments. + * + * Read sessions automatically expire 6 hours after they are created and do + * not require manual clean-up by the caller. + * + * The async variant is {@see BigQueryReadClient::createReadSessionAsync()} . + * + * @example samples/V1/BigQueryReadClient/create_read_session.php + * + * @param CreateReadSessionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ReadSession + * + * @throws ApiException Thrown if the API call fails. + */ + public function createReadSession(CreateReadSessionRequest $request, array $callOptions = []): ReadSession + { + return $this->startApiCall('CreateReadSession', $request, $callOptions)->wait(); + } + + /** + * Reads rows from the stream in the format prescribed by the ReadSession. + * Each response contains one or more table rows, up to a maximum of 100 MiB + * per response; read requests which attempt to read individual rows larger + * than 100 MiB will fail. + * + * Each request also returns a set of stream statistics reflecting the current + * state of the stream. + * + * @example samples/V1/BigQueryReadClient/read_rows.php + * + * @param ReadRowsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return ServerStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function readRows(ReadRowsRequest $request, array $callOptions = []): ServerStream + { + return $this->startApiCall('ReadRows', $request, $callOptions); + } + + /** + * Splits a given `ReadStream` into two `ReadStream` objects. These + * `ReadStream` objects are referred to as the primary and the residual + * streams of the split. The original `ReadStream` can still be read from in + * the same manner as before. Both of the returned `ReadStream` objects can + * also be read from, and the rows returned by both child streams will be + * the same as the rows read from the original stream. + * + * Moreover, the two child streams will be allocated back-to-back in the + * original `ReadStream`. Concretely, it is guaranteed that for streams + * original, primary, and residual, that original[0-j] = primary[0-j] and + * original[j-n] = residual[0-m] once the streams have been read to + * completion. + * + * The async variant is {@see BigQueryReadClient::splitReadStreamAsync()} . + * + * @example samples/V1/BigQueryReadClient/split_read_stream.php + * + * @param SplitReadStreamRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SplitReadStreamResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function splitReadStream(SplitReadStreamRequest $request, array $callOptions = []): SplitReadStreamResponse + { + return $this->startApiCall('SplitReadStream', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BigQueryStorage/v1/src/V1/Client/BigQueryWriteClient.php b/owl-bot-staging/BigQueryStorage/v1/src/V1/Client/BigQueryWriteClient.php new file mode 100644 index 000000000000..a770c0cad2b5 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/src/V1/Client/BigQueryWriteClient.php @@ -0,0 +1,458 @@ + batchCommitWriteStreamsAsync(BatchCommitWriteStreamsRequest $request, array $optionalArgs = []) + * @method PromiseInterface createWriteStreamAsync(CreateWriteStreamRequest $request, array $optionalArgs = []) + * @method PromiseInterface finalizeWriteStreamAsync(FinalizeWriteStreamRequest $request, array $optionalArgs = []) + * @method PromiseInterface flushRowsAsync(FlushRowsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getWriteStreamAsync(GetWriteStreamRequest $request, array $optionalArgs = []) + */ +final class BigQueryWriteClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.bigquery.storage.v1.BigQueryWrite'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'bigquerystorage.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'bigquerystorage.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/bigquery.insertdata', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/big_query_write_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/big_query_write_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/big_query_write_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/big_query_write_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a table + * resource. + * + * @param string $project + * @param string $dataset + * @param string $table + * + * @return string The formatted table resource. + */ + public static function tableName(string $project, string $dataset, string $table): string + { + return self::getPathTemplate('table')->render([ + 'project' => $project, + 'dataset' => $dataset, + 'table' => $table, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a write_stream + * resource. + * + * @param string $project + * @param string $dataset + * @param string $table + * @param string $stream + * + * @return string The formatted write_stream resource. + */ + public static function writeStreamName(string $project, string $dataset, string $table, string $stream): string + { + return self::getPathTemplate('writeStream')->render([ + 'project' => $project, + 'dataset' => $dataset, + 'table' => $table, + 'stream' => $stream, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - table: projects/{project}/datasets/{dataset}/tables/{table} + * - writeStream: projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'bigquerystorage.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Appends data to the given stream. + * + * If `offset` is specified, the `offset` is checked against the end of + * stream. The server returns `OUT_OF_RANGE` in `AppendRowsResponse` if an + * attempt is made to append to an offset beyond the current end of the stream + * or `ALREADY_EXISTS` if user provides an `offset` that has already been + * written to. User can retry with adjusted offset within the same RPC + * connection. If `offset` is not specified, append happens at the end of the + * stream. + * + * The response contains an optional offset at which the append + * happened. No offset information will be returned for appends to a + * default stream. + * + * Responses are received in the same order in which requests are sent. + * There will be one response for each successful inserted request. Responses + * may optionally embed error information if the originating AppendRequest was + * not successfully processed. + * + * The specifics of when successfully appended data is made visible to the + * table are governed by the type of stream: + * + * * For COMMITTED streams (which includes the default stream), data is + * visible immediately upon successful append. + * + * * For BUFFERED streams, data is made visible via a subsequent `FlushRows` + * rpc which advances a cursor to a newer offset in the stream. + * + * * For PENDING streams, data is not made visible until the stream itself is + * finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly + * committed via the `BatchCommitWriteStreams` rpc. + * + * @example samples/V1/BigQueryWriteClient/append_rows.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function appendRows(array $callOptions = []): BidiStream + { + return $this->startApiCall('AppendRows', null, $callOptions); + } + + /** + * Atomically commits a group of `PENDING` streams that belong to the same + * `parent` table. + * + * Streams must be finalized before commit and cannot be committed multiple + * times. Once a stream is committed, data in the stream becomes available + * for read operations. + * + * The async variant is {@see BigQueryWriteClient::batchCommitWriteStreamsAsync()} + * . + * + * @example samples/V1/BigQueryWriteClient/batch_commit_write_streams.php + * + * @param BatchCommitWriteStreamsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BatchCommitWriteStreamsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchCommitWriteStreams(BatchCommitWriteStreamsRequest $request, array $callOptions = []): BatchCommitWriteStreamsResponse + { + return $this->startApiCall('BatchCommitWriteStreams', $request, $callOptions)->wait(); + } + + /** + * Creates a write stream to the given table. + * Additionally, every table has a special stream named '_default' + * to which data can be written. This stream doesn't need to be created using + * CreateWriteStream. It is a stream that can be used simultaneously by any + * number of clients. Data written to this stream is considered committed as + * soon as an acknowledgement is received. + * + * The async variant is {@see BigQueryWriteClient::createWriteStreamAsync()} . + * + * @example samples/V1/BigQueryWriteClient/create_write_stream.php + * + * @param CreateWriteStreamRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return WriteStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function createWriteStream(CreateWriteStreamRequest $request, array $callOptions = []): WriteStream + { + return $this->startApiCall('CreateWriteStream', $request, $callOptions)->wait(); + } + + /** + * Finalize a write stream so that no new data can be appended to the + * stream. Finalize is not supported on the '_default' stream. + * + * The async variant is {@see BigQueryWriteClient::finalizeWriteStreamAsync()} . + * + * @example samples/V1/BigQueryWriteClient/finalize_write_stream.php + * + * @param FinalizeWriteStreamRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FinalizeWriteStreamResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function finalizeWriteStream(FinalizeWriteStreamRequest $request, array $callOptions = []): FinalizeWriteStreamResponse + { + return $this->startApiCall('FinalizeWriteStream', $request, $callOptions)->wait(); + } + + /** + * Flushes rows to a BUFFERED stream. + * + * If users are appending rows to BUFFERED stream, flush operation is + * required in order for the rows to become available for reading. A + * Flush operation flushes up to any previously flushed offset in a BUFFERED + * stream, to the offset specified in the request. + * + * Flush is not supported on the _default stream, since it is not BUFFERED. + * + * The async variant is {@see BigQueryWriteClient::flushRowsAsync()} . + * + * @example samples/V1/BigQueryWriteClient/flush_rows.php + * + * @param FlushRowsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FlushRowsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function flushRows(FlushRowsRequest $request, array $callOptions = []): FlushRowsResponse + { + return $this->startApiCall('FlushRows', $request, $callOptions)->wait(); + } + + /** + * Gets information about a write stream. + * + * The async variant is {@see BigQueryWriteClient::getWriteStreamAsync()} . + * + * @example samples/V1/BigQueryWriteClient/get_write_stream.php + * + * @param GetWriteStreamRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return WriteStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function getWriteStream(GetWriteStreamRequest $request, array $callOptions = []): WriteStream + { + return $this->startApiCall('GetWriteStream', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/BigQueryStorage/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BigQueryStorage/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..35b88c9b5daf --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/src/V1/gapic_metadata.json @@ -0,0 +1,72 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.bigquery.storage.v1", + "libraryPackage": "Google\\Cloud\\BigQuery\\Storage\\V1", + "services": { + "BigQueryRead": { + "clients": { + "grpc": { + "libraryClient": "BigQueryReadGapicClient", + "rpcs": { + "CreateReadSession": { + "methods": [ + "createReadSession" + ] + }, + "ReadRows": { + "methods": [ + "readRows" + ] + }, + "SplitReadStream": { + "methods": [ + "splitReadStream" + ] + } + } + } + } + }, + "BigQueryWrite": { + "clients": { + "grpc": { + "libraryClient": "BigQueryWriteGapicClient", + "rpcs": { + "AppendRows": { + "methods": [ + "appendRows" + ] + }, + "BatchCommitWriteStreams": { + "methods": [ + "batchCommitWriteStreams" + ] + }, + "CreateWriteStream": { + "methods": [ + "createWriteStream" + ] + }, + "FinalizeWriteStream": { + "methods": [ + "finalizeWriteStream" + ] + }, + "FlushRows": { + "methods": [ + "flushRows" + ] + }, + "GetWriteStream": { + "methods": [ + "getWriteStream" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_read_client_config.json b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_read_client_config.json new file mode 100644 index 000000000000..780af364091c --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_read_client_config.json @@ -0,0 +1,73 @@ +{ + "interfaces": { + "google.cloud.bigquery.storage.v1.BigQueryRead": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ], + "retry_policy_3_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 86400000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 86400000, + "total_timeout_millis": 86400000 + }, + "retry_policy_3_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateReadSession": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ReadRows": { + "timeout_millis": 86400000 + }, + "SplitReadStream": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + } + } + } + } +} diff --git a/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_read_descriptor_config.php b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_read_descriptor_config.php new file mode 100644 index 000000000000..38011adeeb9a --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_read_descriptor_config.php @@ -0,0 +1,74 @@ + [ + 'google.cloud.bigquery.storage.v1.BigQueryRead' => [ + 'CreateReadSession' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Storage\V1\ReadSession', + 'headerParams' => [ + [ + 'keyName' => 'read_session.table', + 'fieldAccessors' => [ + 'getReadSession', + 'getTable', + ], + ], + ], + ], + 'ReadRows' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'ServerStreaming', + ], + 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Storage\V1\ReadRowsResponse', + 'headerParams' => [ + [ + 'keyName' => 'read_stream', + 'fieldAccessors' => [ + 'getReadStream', + ], + ], + ], + ], + 'SplitReadStream' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Storage\V1\SplitReadStreamResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'project' => 'projects/{project}', + 'readSession' => 'projects/{project}/locations/{location}/sessions/{session}', + 'readStream' => 'projects/{project}/locations/{location}/sessions/{session}/streams/{stream}', + 'table' => 'projects/{project}/datasets/{dataset}/tables/{table}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_read_rest_client_config.php b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_read_rest_client_config.php new file mode 100644 index 000000000000..7733f1719340 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_read_rest_client_config.php @@ -0,0 +1,63 @@ + [ + 'google.cloud.bigquery.storage.v1.BigQueryRead' => [ + 'CreateReadSession' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{read_session.table=projects/*/datasets/*/tables/*}', + 'body' => '*', + 'placeholders' => [ + 'read_session.table' => [ + 'getters' => [ + 'getReadSession', + 'getTable', + ], + ], + ], + ], + 'ReadRows' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{read_stream=projects/*/locations/*/sessions/*/streams/*}', + 'placeholders' => [ + 'read_stream' => [ + 'getters' => [ + 'getReadStream', + ], + ], + ], + ], + 'SplitReadStream' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/sessions/*/streams/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_write_client_config.json b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_write_client_config.json new file mode 100644 index 000000000000..c24690087513 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_write_client_config.json @@ -0,0 +1,90 @@ +{ + "interfaces": { + "google.cloud.bigquery.storage.v1.BigQueryWrite": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_4_codes": [ + "UNAVAILABLE" + ], + "retry_policy_5_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE", + "RESOURCE_EXHAUSTED" + ], + "retry_policy_6_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE", + "RESOURCE_EXHAUSTED" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_4_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 86400000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 86400000, + "total_timeout_millis": 86400000 + }, + "retry_policy_5_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + }, + "retry_policy_6_params": { + "initial_retry_delay_millis": 10000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 120000, + "initial_rpc_timeout_millis": 1200000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 1200000, + "total_timeout_millis": 1200000 + } + }, + "methods": { + "AppendRows": { + "timeout_millis": 86400000 + }, + "BatchCommitWriteStreams": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" + }, + "CreateWriteStream": { + "timeout_millis": 1200000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "FinalizeWriteStream": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" + }, + "FlushRows": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" + }, + "GetWriteStream": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" + } + } + } + } +} diff --git a/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_write_descriptor_config.php b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_write_descriptor_config.php new file mode 100644 index 000000000000..60b87fa400a8 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_write_descriptor_config.php @@ -0,0 +1,107 @@ + [ + 'google.cloud.bigquery.storage.v1.BigQueryWrite' => [ + 'AppendRows' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Storage\V1\AppendRowsResponse', + 'headerParams' => [ + [ + 'keyName' => 'write_stream', + 'fieldAccessors' => [ + 'getWriteStream', + ], + ], + ], + ], + 'BatchCommitWriteStreams' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Storage\V1\BatchCommitWriteStreamsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateWriteStream' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Storage\V1\WriteStream', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'FinalizeWriteStream' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Storage\V1\FinalizeWriteStreamResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'FlushRows' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Storage\V1\FlushRowsResponse', + 'headerParams' => [ + [ + 'keyName' => 'write_stream', + 'fieldAccessors' => [ + 'getWriteStream', + ], + ], + ], + ], + 'GetWriteStream' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BigQuery\Storage\V1\WriteStream', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'table' => 'projects/{project}/datasets/{dataset}/tables/{table}', + 'writeStream' => 'projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}', + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_write_rest_client_config.php b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_write_rest_client_config.php new file mode 100644 index 000000000000..3279f1679d8b --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/src/V1/resources/big_query_write_rest_client_config.php @@ -0,0 +1,90 @@ + [ + 'google.cloud.bigquery.storage.v1.BigQueryWrite' => [ + 'BatchCommitWriteStreams' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/datasets/*/tables/*}', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'write_streams', + ], + ], + 'CreateWriteStream' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/datasets/*/tables/*}', + 'body' => 'write_stream', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'FinalizeWriteStream' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/datasets/*/tables/*/streams/*}', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'FlushRows' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{write_stream=projects/*/datasets/*/tables/*/streams/*}', + 'body' => '*', + 'placeholders' => [ + 'write_stream' => [ + 'getters' => [ + 'getWriteStream', + ], + ], + ], + ], + 'GetWriteStream' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/datasets/*/tables/*/streams/*}', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryStorage/v1/tests/Unit/V1/Client/BigQueryReadClientTest.php b/owl-bot-staging/BigQueryStorage/v1/tests/Unit/V1/Client/BigQueryReadClientTest.php new file mode 100644 index 000000000000..cd753856f172 --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/tests/Unit/V1/Client/BigQueryReadClientTest.php @@ -0,0 +1,338 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BigQueryReadClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BigQueryReadClient($options); + } + + /** @test */ + public function createReadSessionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $table = 'table110115790'; + $estimatedTotalBytesScanned = 452788190; + $estimatedTotalPhysicalFileSize = 938325754; + $estimatedRowCount = 1745583577; + $traceId = 'traceId1270300245'; + $expectedResponse = new ReadSession(); + $expectedResponse->setName($name); + $expectedResponse->setTable($table); + $expectedResponse->setEstimatedTotalBytesScanned($estimatedTotalBytesScanned); + $expectedResponse->setEstimatedTotalPhysicalFileSize($estimatedTotalPhysicalFileSize); + $expectedResponse->setEstimatedRowCount($estimatedRowCount); + $expectedResponse->setTraceId($traceId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $readSession = new ReadSession(); + $request = (new CreateReadSessionRequest()) + ->setParent($formattedParent) + ->setReadSession($readSession); + $response = $gapicClient->createReadSession($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.storage.v1.BigQueryRead/CreateReadSession', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getReadSession(); + $this->assertProtobufEquals($readSession, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createReadSessionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $readSession = new ReadSession(); + $request = (new CreateReadSessionRequest()) + ->setParent($formattedParent) + ->setReadSession($readSession); + try { + $gapicClient->createReadSession($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function readRowsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $rowCount = 1340416618; + $uncompressedByteSize = 2094376525; + $expectedResponse = new ReadRowsResponse(); + $expectedResponse->setRowCount($rowCount); + $expectedResponse->setUncompressedByteSize($uncompressedByteSize); + $transport->addResponse($expectedResponse); + $rowCount2 = 349815907; + $uncompressedByteSize2 = 1643824294; + $expectedResponse2 = new ReadRowsResponse(); + $expectedResponse2->setRowCount($rowCount2); + $expectedResponse2->setUncompressedByteSize($uncompressedByteSize2); + $transport->addResponse($expectedResponse2); + $rowCount3 = 349815906; + $uncompressedByteSize3 = 1643824295; + $expectedResponse3 = new ReadRowsResponse(); + $expectedResponse3->setRowCount($rowCount3); + $expectedResponse3->setUncompressedByteSize($uncompressedByteSize3); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedReadStream = $gapicClient->readStreamName('[PROJECT]', '[LOCATION]', '[SESSION]', '[STREAM]'); + $request = (new ReadRowsRequest()) + ->setReadStream($formattedReadStream); + $serverStream = $gapicClient->readRows($request); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.storage.v1.BigQueryRead/ReadRows', $actualFuncCall); + $actualValue = $actualRequestObject->getReadStream(); + $this->assertProtobufEquals($formattedReadStream, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function readRowsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $formattedReadStream = $gapicClient->readStreamName('[PROJECT]', '[LOCATION]', '[SESSION]', '[STREAM]'); + $request = (new ReadRowsRequest()) + ->setReadStream($formattedReadStream); + $serverStream = $gapicClient->readRows($request); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function splitReadStreamTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SplitReadStreamResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->readStreamName('[PROJECT]', '[LOCATION]', '[SESSION]', '[STREAM]'); + $request = (new SplitReadStreamRequest()) + ->setName($formattedName); + $response = $gapicClient->splitReadStream($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.storage.v1.BigQueryRead/SplitReadStream', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function splitReadStreamExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->readStreamName('[PROJECT]', '[LOCATION]', '[SESSION]', '[STREAM]'); + $request = (new SplitReadStreamRequest()) + ->setName($formattedName); + try { + $gapicClient->splitReadStream($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createReadSessionAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $table = 'table110115790'; + $estimatedTotalBytesScanned = 452788190; + $estimatedTotalPhysicalFileSize = 938325754; + $estimatedRowCount = 1745583577; + $traceId = 'traceId1270300245'; + $expectedResponse = new ReadSession(); + $expectedResponse->setName($name); + $expectedResponse->setTable($table); + $expectedResponse->setEstimatedTotalBytesScanned($estimatedTotalBytesScanned); + $expectedResponse->setEstimatedTotalPhysicalFileSize($estimatedTotalPhysicalFileSize); + $expectedResponse->setEstimatedRowCount($estimatedRowCount); + $expectedResponse->setTraceId($traceId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $readSession = new ReadSession(); + $request = (new CreateReadSessionRequest()) + ->setParent($formattedParent) + ->setReadSession($readSession); + $response = $gapicClient->createReadSessionAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.storage.v1.BigQueryRead/CreateReadSession', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getReadSession(); + $this->assertProtobufEquals($readSession, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/BigQueryStorage/v1/tests/Unit/V1/Client/BigQueryWriteClientTest.php b/owl-bot-staging/BigQueryStorage/v1/tests/Unit/V1/Client/BigQueryWriteClientTest.php new file mode 100644 index 000000000000..3a279b3cf38b --- /dev/null +++ b/owl-bot-staging/BigQueryStorage/v1/tests/Unit/V1/Client/BigQueryWriteClientTest.php @@ -0,0 +1,537 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BigQueryWriteClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BigQueryWriteClient($options); + } + + /** @test */ + public function appendRowsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $writeStream = 'writeStream-1431753760'; + $expectedResponse = new AppendRowsResponse(); + $expectedResponse->setWriteStream($writeStream); + $transport->addResponse($expectedResponse); + $writeStream2 = 'writeStream2-1525825645'; + $expectedResponse2 = new AppendRowsResponse(); + $expectedResponse2->setWriteStream($writeStream2); + $transport->addResponse($expectedResponse2); + $writeStream3 = 'writeStream3-1525825644'; + $expectedResponse3 = new AppendRowsResponse(); + $expectedResponse3->setWriteStream($writeStream3); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedWriteStream4 = $gapicClient->writeStreamName('[PROJECT]', '[DATASET]', '[TABLE]', '[STREAM]'); + $request = new AppendRowsRequest(); + $request->setWriteStream($formattedWriteStream4); + $formattedWriteStream5 = $gapicClient->writeStreamName('[PROJECT]', '[DATASET]', '[TABLE]', '[STREAM]'); + $request2 = new AppendRowsRequest(); + $request2->setWriteStream($formattedWriteStream5); + $formattedWriteStream6 = $gapicClient->writeStreamName('[PROJECT]', '[DATASET]', '[TABLE]', '[STREAM]'); + $request3 = new AppendRowsRequest(); + $request3->setWriteStream($formattedWriteStream6); + $bidi = $gapicClient->appendRows(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([ + $request2, + $request3, + ]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.storage.v1.BigQueryWrite/AppendRows', $streamFuncCall); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function appendRowsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->appendRows(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchCommitWriteStreamsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchCommitWriteStreamsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->tableName('[PROJECT]', '[DATASET]', '[TABLE]'); + $writeStreams = []; + $request = (new BatchCommitWriteStreamsRequest()) + ->setParent($formattedParent) + ->setWriteStreams($writeStreams); + $response = $gapicClient->batchCommitWriteStreams($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.storage.v1.BigQueryWrite/BatchCommitWriteStreams', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getWriteStreams(); + $this->assertProtobufEquals($writeStreams, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchCommitWriteStreamsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->tableName('[PROJECT]', '[DATASET]', '[TABLE]'); + $writeStreams = []; + $request = (new BatchCommitWriteStreamsRequest()) + ->setParent($formattedParent) + ->setWriteStreams($writeStreams); + try { + $gapicClient->batchCommitWriteStreams($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createWriteStreamTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $location = 'location1901043637'; + $expectedResponse = new WriteStream(); + $expectedResponse->setName($name); + $expectedResponse->setLocation($location); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->tableName('[PROJECT]', '[DATASET]', '[TABLE]'); + $writeStream = new WriteStream(); + $request = (new CreateWriteStreamRequest()) + ->setParent($formattedParent) + ->setWriteStream($writeStream); + $response = $gapicClient->createWriteStream($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.storage.v1.BigQueryWrite/CreateWriteStream', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getWriteStream(); + $this->assertProtobufEquals($writeStream, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createWriteStreamExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->tableName('[PROJECT]', '[DATASET]', '[TABLE]'); + $writeStream = new WriteStream(); + $request = (new CreateWriteStreamRequest()) + ->setParent($formattedParent) + ->setWriteStream($writeStream); + try { + $gapicClient->createWriteStream($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function finalizeWriteStreamTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $rowCount = 1340416618; + $expectedResponse = new FinalizeWriteStreamResponse(); + $expectedResponse->setRowCount($rowCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->writeStreamName('[PROJECT]', '[DATASET]', '[TABLE]', '[STREAM]'); + $request = (new FinalizeWriteStreamRequest()) + ->setName($formattedName); + $response = $gapicClient->finalizeWriteStream($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.storage.v1.BigQueryWrite/FinalizeWriteStream', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function finalizeWriteStreamExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->writeStreamName('[PROJECT]', '[DATASET]', '[TABLE]', '[STREAM]'); + $request = (new FinalizeWriteStreamRequest()) + ->setName($formattedName); + try { + $gapicClient->finalizeWriteStream($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function flushRowsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $offset2 = 755984506; + $expectedResponse = new FlushRowsResponse(); + $expectedResponse->setOffset($offset2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedWriteStream = $gapicClient->writeStreamName('[PROJECT]', '[DATASET]', '[TABLE]', '[STREAM]'); + $request = (new FlushRowsRequest()) + ->setWriteStream($formattedWriteStream); + $response = $gapicClient->flushRows($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.storage.v1.BigQueryWrite/FlushRows', $actualFuncCall); + $actualValue = $actualRequestObject->getWriteStream(); + $this->assertProtobufEquals($formattedWriteStream, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function flushRowsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedWriteStream = $gapicClient->writeStreamName('[PROJECT]', '[DATASET]', '[TABLE]', '[STREAM]'); + $request = (new FlushRowsRequest()) + ->setWriteStream($formattedWriteStream); + try { + $gapicClient->flushRows($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getWriteStreamTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $location = 'location1901043637'; + $expectedResponse = new WriteStream(); + $expectedResponse->setName($name2); + $expectedResponse->setLocation($location); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->writeStreamName('[PROJECT]', '[DATASET]', '[TABLE]', '[STREAM]'); + $request = (new GetWriteStreamRequest()) + ->setName($formattedName); + $response = $gapicClient->getWriteStream($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.storage.v1.BigQueryWrite/GetWriteStream', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getWriteStreamExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->writeStreamName('[PROJECT]', '[DATASET]', '[TABLE]', '[STREAM]'); + $request = (new GetWriteStreamRequest()) + ->setName($formattedName); + try { + $gapicClient->getWriteStream($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchCommitWriteStreamsAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchCommitWriteStreamsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->tableName('[PROJECT]', '[DATASET]', '[TABLE]'); + $writeStreams = []; + $request = (new BatchCommitWriteStreamsRequest()) + ->setParent($formattedParent) + ->setWriteStreams($writeStreams); + $response = $gapicClient->batchCommitWriteStreamsAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.storage.v1.BigQueryWrite/BatchCommitWriteStreams', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getWriteStreams(); + $this->assertProtobufEquals($writeStreams, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/BigtableInstanceAdmin.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/BigtableInstanceAdmin.php new file mode 100644 index 000000000000..6b6c3b1fe5b0 Binary files /dev/null and b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/BigtableInstanceAdmin.php differ diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/BigtableTableAdmin.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/BigtableTableAdmin.php new file mode 100644 index 000000000000..6b8f62546804 Binary files /dev/null and b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/BigtableTableAdmin.php differ diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Common.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Common.php new file mode 100644 index 000000000000..3fe1a1d11e7f Binary files /dev/null and b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Common.php differ diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Instance.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Instance.php new file mode 100644 index 000000000000..7cfcef682206 Binary files /dev/null and b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Instance.php differ diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Table.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Table.php new file mode 100644 index 000000000000..8bd9c50772af Binary files /dev/null and b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Table.php differ diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Types.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Types.php new file mode 100644 index 000000000000..1dcd7b40b1da Binary files /dev/null and b/owl-bot-staging/Bigtable/v2/Admin/proto/src/GPBMetadata/Google/Bigtable/Admin/V2/Types.php differ diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile.php new file mode 100644 index 000000000000..4eb3ef034a7e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile.php @@ -0,0 +1,368 @@ +google.bigtable.admin.v2.AppProfile + */ +class AppProfile extends \Google\Protobuf\Internal\Message +{ + /** + * The unique name of the app profile. Values are of the form + * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Strongly validated etag for optimistic concurrency control. Preserve the + * value returned from `GetAppProfile` when calling `UpdateAppProfile` to + * fail the request if there has been a modification in the mean time. The + * `update_mask` of the request need not include `etag` for this protection + * to apply. + * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and + * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more + * details. + * + * Generated from protobuf field string etag = 2; + */ + protected $etag = ''; + /** + * Long form description of the use case for this AppProfile. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + protected $routing_policy; + protected $isolation; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the app profile. Values are of the form + * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * @type string $etag + * Strongly validated etag for optimistic concurrency control. Preserve the + * value returned from `GetAppProfile` when calling `UpdateAppProfile` to + * fail the request if there has been a modification in the mean time. The + * `update_mask` of the request need not include `etag` for this protection + * to apply. + * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and + * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more + * details. + * @type string $description + * Long form description of the use case for this AppProfile. + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny $multi_cluster_routing_use_any + * Use a multi-cluster routing policy. + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile\SingleClusterRouting $single_cluster_routing + * Use a single-cluster routing policy. + * @type int $priority + * This field has been deprecated in favor of `standard_isolation.priority`. + * If you set this field, `standard_isolation.priority` will be set instead. + * The priority of requests sent using this app profile. + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile\StandardIsolation $standard_isolation + * The standard options used for isolating this app profile's traffic from + * other use cases. + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile\DataBoostIsolationReadOnly $data_boost_isolation_read_only + * Specifies that this app profile is intended for read-only usage via the + * Data Boost feature. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The unique name of the app profile. Values are of the form + * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique name of the app profile. Values are of the form + * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Strongly validated etag for optimistic concurrency control. Preserve the + * value returned from `GetAppProfile` when calling `UpdateAppProfile` to + * fail the request if there has been a modification in the mean time. The + * `update_mask` of the request need not include `etag` for this protection + * to apply. + * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and + * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more + * details. + * + * Generated from protobuf field string etag = 2; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Strongly validated etag for optimistic concurrency control. Preserve the + * value returned from `GetAppProfile` when calling `UpdateAppProfile` to + * fail the request if there has been a modification in the mean time. The + * `update_mask` of the request need not include `etag` for this protection + * to apply. + * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and + * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more + * details. + * + * Generated from protobuf field string etag = 2; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Long form description of the use case for this AppProfile. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Long form description of the use case for this AppProfile. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Use a multi-cluster routing policy. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny|null + */ + public function getMultiClusterRoutingUseAny() + { + return $this->readOneof(5); + } + + public function hasMultiClusterRoutingUseAny() + { + return $this->hasOneof(5); + } + + /** + * Use a multi-cluster routing policy. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny $var + * @return $this + */ + public function setMultiClusterRoutingUseAny($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Use a single-cluster routing policy. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile\SingleClusterRouting|null + */ + public function getSingleClusterRouting() + { + return $this->readOneof(6); + } + + public function hasSingleClusterRouting() + { + return $this->hasOneof(6); + } + + /** + * Use a single-cluster routing policy. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile\SingleClusterRouting $var + * @return $this + */ + public function setSingleClusterRouting($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AppProfile\SingleClusterRouting::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * This field has been deprecated in favor of `standard_isolation.priority`. + * If you set this field, `standard_isolation.priority` will be set instead. + * The priority of requests sent using this app profile. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * @return int + * @deprecated + */ + public function getPriority() + { + @trigger_error('priority is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(7); + } + + public function hasPriority() + { + @trigger_error('priority is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(7); + } + + /** + * This field has been deprecated in favor of `standard_isolation.priority`. + * If you set this field, `standard_isolation.priority` will be set instead. + * The priority of requests sent using this app profile. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setPriority($var) + { + @trigger_error('priority is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\AppProfile\Priority::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * The standard options used for isolating this app profile's traffic from + * other use cases. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile\StandardIsolation|null + */ + public function getStandardIsolation() + { + return $this->readOneof(11); + } + + public function hasStandardIsolation() + { + return $this->hasOneof(11); + } + + /** + * The standard options used for isolating this app profile's traffic from + * other use cases. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile\StandardIsolation $var + * @return $this + */ + public function setStandardIsolation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AppProfile\StandardIsolation::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Specifies that this app profile is intended for read-only usage via the + * Data Boost feature. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile\DataBoostIsolationReadOnly|null + */ + public function getDataBoostIsolationReadOnly() + { + return $this->readOneof(10); + } + + public function hasDataBoostIsolationReadOnly() + { + return $this->hasOneof(10); + } + + /** + * Specifies that this app profile is intended for read-only usage via the + * Data Boost feature. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile\DataBoostIsolationReadOnly $var + * @return $this + */ + public function setDataBoostIsolationReadOnly($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AppProfile\DataBoostIsolationReadOnly::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * @return string + */ + public function getRoutingPolicy() + { + return $this->whichOneof("routing_policy"); + } + + /** + * @return string + */ + public function getIsolation() + { + return $this->whichOneof("isolation"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/DataBoostIsolationReadOnly.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/DataBoostIsolationReadOnly.php new file mode 100644 index 000000000000..7a8e71fd8019 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/DataBoostIsolationReadOnly.php @@ -0,0 +1,90 @@ +google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + */ +class DataBoostIsolationReadOnly extends \Google\Protobuf\Internal\Message +{ + /** + * The Compute Billing Owner for this Data Boost App Profile. + * + * Generated from protobuf field optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + */ + protected $compute_billing_owner = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $compute_billing_owner + * The Compute Billing Owner for this Data Boost App Profile. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The Compute Billing Owner for this Data Boost App Profile. + * + * Generated from protobuf field optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * @return int + */ + public function getComputeBillingOwner() + { + return isset($this->compute_billing_owner) ? $this->compute_billing_owner : 0; + } + + public function hasComputeBillingOwner() + { + return isset($this->compute_billing_owner); + } + + public function clearComputeBillingOwner() + { + unset($this->compute_billing_owner); + } + + /** + * The Compute Billing Owner for this Data Boost App Profile. + * + * Generated from protobuf field optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * @param int $var + * @return $this + */ + public function setComputeBillingOwner($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\AppProfile\DataBoostIsolationReadOnly\ComputeBillingOwner::class); + $this->compute_billing_owner = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DataBoostIsolationReadOnly::class, \Google\Cloud\Bigtable\Admin\V2\AppProfile_DataBoostIsolationReadOnly::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/DataBoostIsolationReadOnly/ComputeBillingOwner.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/DataBoostIsolationReadOnly/ComputeBillingOwner.php new file mode 100644 index 000000000000..7da3c3942452 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/DataBoostIsolationReadOnly/ComputeBillingOwner.php @@ -0,0 +1,60 @@ +google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + */ +class ComputeBillingOwner +{ + /** + * Unspecified value. + * + * Generated from protobuf enum COMPUTE_BILLING_OWNER_UNSPECIFIED = 0; + */ + const COMPUTE_BILLING_OWNER_UNSPECIFIED = 0; + /** + * The host Cloud Project containing the targeted Bigtable Instance / + * Table pays for compute. + * + * Generated from protobuf enum HOST_PAYS = 1; + */ + const HOST_PAYS = 1; + + private static $valueToName = [ + self::COMPUTE_BILLING_OWNER_UNSPECIFIED => 'COMPUTE_BILLING_OWNER_UNSPECIFIED', + self::HOST_PAYS => 'HOST_PAYS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ComputeBillingOwner::class, \Google\Cloud\Bigtable\Admin\V2\AppProfile_DataBoostIsolationReadOnly_ComputeBillingOwner::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/MultiClusterRoutingUseAny.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/MultiClusterRoutingUseAny.php new file mode 100644 index 000000000000..455a007dbf2b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/MultiClusterRoutingUseAny.php @@ -0,0 +1,123 @@ +google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + */ +class MultiClusterRoutingUseAny extends \Google\Protobuf\Internal\Message +{ + /** + * The set of clusters to route to. The order is ignored; clusters will be + * tried in order of distance. If left empty, all clusters are eligible. + * + * Generated from protobuf field repeated string cluster_ids = 1; + */ + private $cluster_ids; + protected $affinity; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $cluster_ids + * The set of clusters to route to. The order is ignored; clusters will be + * tried in order of distance. If left empty, all clusters are eligible. + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny\RowAffinity $row_affinity + * Row affinity sticky routing based on the row key of the request. + * Requests that span multiple rows are routed non-deterministically. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The set of clusters to route to. The order is ignored; clusters will be + * tried in order of distance. If left empty, all clusters are eligible. + * + * Generated from protobuf field repeated string cluster_ids = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClusterIds() + { + return $this->cluster_ids; + } + + /** + * The set of clusters to route to. The order is ignored; clusters will be + * tried in order of distance. If left empty, all clusters are eligible. + * + * Generated from protobuf field repeated string cluster_ids = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClusterIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->cluster_ids = $arr; + + return $this; + } + + /** + * Row affinity sticky routing based on the row key of the request. + * Requests that span multiple rows are routed non-deterministically. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny\RowAffinity|null + */ + public function getRowAffinity() + { + return $this->readOneof(3); + } + + public function hasRowAffinity() + { + return $this->hasOneof(3); + } + + /** + * Row affinity sticky routing based on the row key of the request. + * Requests that span multiple rows are routed non-deterministically. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny\RowAffinity $var + * @return $this + */ + public function setRowAffinity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny\RowAffinity::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getAffinity() + { + return $this->whichOneof("affinity"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MultiClusterRoutingUseAny::class, \Google\Cloud\Bigtable\Admin\V2\AppProfile_MultiClusterRoutingUseAny::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/MultiClusterRoutingUseAny/RowAffinity.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/MultiClusterRoutingUseAny/RowAffinity.php new file mode 100644 index 000000000000..f553b0a42fad --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/MultiClusterRoutingUseAny/RowAffinity.php @@ -0,0 +1,44 @@ +google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + */ +class RowAffinity extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RowAffinity::class, \Google\Cloud\Bigtable\Admin\V2\AppProfile_MultiClusterRoutingUseAny_RowAffinity::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/Priority.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/Priority.php new file mode 100644 index 000000000000..df376e17c64e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/Priority.php @@ -0,0 +1,67 @@ +google.bigtable.admin.v2.AppProfile.Priority + */ +class Priority +{ + /** + * Default value. Mapped to PRIORITY_HIGH (the legacy behavior) on creation. + * + * Generated from protobuf enum PRIORITY_UNSPECIFIED = 0; + */ + const PRIORITY_UNSPECIFIED = 0; + /** + * Generated from protobuf enum PRIORITY_LOW = 1; + */ + const PRIORITY_LOW = 1; + /** + * Generated from protobuf enum PRIORITY_MEDIUM = 2; + */ + const PRIORITY_MEDIUM = 2; + /** + * Generated from protobuf enum PRIORITY_HIGH = 3; + */ + const PRIORITY_HIGH = 3; + + private static $valueToName = [ + self::PRIORITY_UNSPECIFIED => 'PRIORITY_UNSPECIFIED', + self::PRIORITY_LOW => 'PRIORITY_LOW', + self::PRIORITY_MEDIUM => 'PRIORITY_MEDIUM', + self::PRIORITY_HIGH => 'PRIORITY_HIGH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Priority::class, \Google\Cloud\Bigtable\Admin\V2\AppProfile_Priority::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/SingleClusterRouting.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/SingleClusterRouting.php new file mode 100644 index 000000000000..5bd27b02ed0b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/SingleClusterRouting.php @@ -0,0 +1,114 @@ +google.bigtable.admin.v2.AppProfile.SingleClusterRouting + */ +class SingleClusterRouting extends \Google\Protobuf\Internal\Message +{ + /** + * The cluster to which read/write requests should be routed. + * + * Generated from protobuf field string cluster_id = 1; + */ + protected $cluster_id = ''; + /** + * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are + * allowed by this app profile. It is unsafe to send these requests to + * the same table/row/column in multiple clusters. + * + * Generated from protobuf field bool allow_transactional_writes = 2; + */ + protected $allow_transactional_writes = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cluster_id + * The cluster to which read/write requests should be routed. + * @type bool $allow_transactional_writes + * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are + * allowed by this app profile. It is unsafe to send these requests to + * the same table/row/column in multiple clusters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The cluster to which read/write requests should be routed. + * + * Generated from protobuf field string cluster_id = 1; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * The cluster to which read/write requests should be routed. + * + * Generated from protobuf field string cluster_id = 1; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are + * allowed by this app profile. It is unsafe to send these requests to + * the same table/row/column in multiple clusters. + * + * Generated from protobuf field bool allow_transactional_writes = 2; + * @return bool + */ + public function getAllowTransactionalWrites() + { + return $this->allow_transactional_writes; + } + + /** + * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are + * allowed by this app profile. It is unsafe to send these requests to + * the same table/row/column in multiple clusters. + * + * Generated from protobuf field bool allow_transactional_writes = 2; + * @param bool $var + * @return $this + */ + public function setAllowTransactionalWrites($var) + { + GPBUtil::checkBool($var); + $this->allow_transactional_writes = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SingleClusterRouting::class, \Google\Cloud\Bigtable\Admin\V2\AppProfile_SingleClusterRouting::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/StandardIsolation.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/StandardIsolation.php new file mode 100644 index 000000000000..3638ebc75214 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AppProfile/StandardIsolation.php @@ -0,0 +1,71 @@ +google.bigtable.admin.v2.AppProfile.StandardIsolation + */ +class StandardIsolation extends \Google\Protobuf\Internal\Message +{ + /** + * The priority of requests sent using this app profile. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + */ + protected $priority = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $priority + * The priority of requests sent using this app profile. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The priority of requests sent using this app profile. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + * @return int + */ + public function getPriority() + { + return $this->priority; + } + + /** + * The priority of requests sent using this app profile. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\AppProfile\Priority::class); + $this->priority = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StandardIsolation::class, \Google\Cloud\Bigtable\Admin\V2\AppProfile_StandardIsolation::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView.php new file mode 100644 index 000000000000..a5533981fbc1 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView.php @@ -0,0 +1,203 @@ +google.bigtable.admin.v2.AuthorizedView + */ +class AuthorizedView extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of this AuthorizedView. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * The etag for this AuthorizedView. + * If this is provided on update, it must match the server's etag. The server + * returns ABORTED error on a mismatched etag. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + /** + * Set to true to make the AuthorizedView protected against deletion. + * The parent Table and containing Instance cannot be deleted if an + * AuthorizedView has this bit set. + * + * Generated from protobuf field bool deletion_protection = 4; + */ + protected $deletion_protection = false; + protected $authorized_view; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The name of this AuthorizedView. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}` + * @type \Google\Cloud\Bigtable\Admin\V2\AuthorizedView\SubsetView $subset_view + * An AuthorizedView permitting access to an explicit subset of a Table. + * @type string $etag + * The etag for this AuthorizedView. + * If this is provided on update, it must match the server's etag. The server + * returns ABORTED error on a mismatched etag. + * @type bool $deletion_protection + * Set to true to make the AuthorizedView protected against deletion. + * The parent Table and containing Instance cannot be deleted if an + * AuthorizedView has this bit set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The name of this AuthorizedView. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of this AuthorizedView. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * An AuthorizedView permitting access to an explicit subset of a Table. + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + * @return \Google\Cloud\Bigtable\Admin\V2\AuthorizedView\SubsetView|null + */ + public function getSubsetView() + { + return $this->readOneof(2); + } + + public function hasSubsetView() + { + return $this->hasOneof(2); + } + + /** + * An AuthorizedView permitting access to an explicit subset of a Table. + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + * @param \Google\Cloud\Bigtable\Admin\V2\AuthorizedView\SubsetView $var + * @return $this + */ + public function setSubsetView($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AuthorizedView\SubsetView::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The etag for this AuthorizedView. + * If this is provided on update, it must match the server's etag. The server + * returns ABORTED error on a mismatched etag. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * The etag for this AuthorizedView. + * If this is provided on update, it must match the server's etag. The server + * returns ABORTED error on a mismatched etag. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Set to true to make the AuthorizedView protected against deletion. + * The parent Table and containing Instance cannot be deleted if an + * AuthorizedView has this bit set. + * + * Generated from protobuf field bool deletion_protection = 4; + * @return bool + */ + public function getDeletionProtection() + { + return $this->deletion_protection; + } + + /** + * Set to true to make the AuthorizedView protected against deletion. + * The parent Table and containing Instance cannot be deleted if an + * AuthorizedView has this bit set. + * + * Generated from protobuf field bool deletion_protection = 4; + * @param bool $var + * @return $this + */ + public function setDeletionProtection($var) + { + GPBUtil::checkBool($var); + $this->deletion_protection = $var; + + return $this; + } + + /** + * @return string + */ + public function getAuthorizedView() + { + return $this->whichOneof("authorized_view"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView/FamilySubsets.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView/FamilySubsets.php new file mode 100644 index 000000000000..3a6359fca96d --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView/FamilySubsets.php @@ -0,0 +1,120 @@ +google.bigtable.admin.v2.AuthorizedView.FamilySubsets + */ +class FamilySubsets extends \Google\Protobuf\Internal\Message +{ + /** + * Individual exact column qualifiers to be included in the AuthorizedView. + * + * Generated from protobuf field repeated bytes qualifiers = 1; + */ + private $qualifiers; + /** + * Prefixes for qualifiers to be included in the AuthorizedView. Every + * qualifier starting with one of these prefixes is included in the + * AuthorizedView. To provide access to all qualifiers, include the empty + * string as a prefix + * (""). + * + * Generated from protobuf field repeated bytes qualifier_prefixes = 2; + */ + private $qualifier_prefixes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $qualifiers + * Individual exact column qualifiers to be included in the AuthorizedView. + * @type array|\Google\Protobuf\Internal\RepeatedField $qualifier_prefixes + * Prefixes for qualifiers to be included in the AuthorizedView. Every + * qualifier starting with one of these prefixes is included in the + * AuthorizedView. To provide access to all qualifiers, include the empty + * string as a prefix + * (""). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Individual exact column qualifiers to be included in the AuthorizedView. + * + * Generated from protobuf field repeated bytes qualifiers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQualifiers() + { + return $this->qualifiers; + } + + /** + * Individual exact column qualifiers to be included in the AuthorizedView. + * + * Generated from protobuf field repeated bytes qualifiers = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQualifiers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); + $this->qualifiers = $arr; + + return $this; + } + + /** + * Prefixes for qualifiers to be included in the AuthorizedView. Every + * qualifier starting with one of these prefixes is included in the + * AuthorizedView. To provide access to all qualifiers, include the empty + * string as a prefix + * (""). + * + * Generated from protobuf field repeated bytes qualifier_prefixes = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQualifierPrefixes() + { + return $this->qualifier_prefixes; + } + + /** + * Prefixes for qualifiers to be included in the AuthorizedView. Every + * qualifier starting with one of these prefixes is included in the + * AuthorizedView. To provide access to all qualifiers, include the empty + * string as a prefix + * (""). + * + * Generated from protobuf field repeated bytes qualifier_prefixes = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQualifierPrefixes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); + $this->qualifier_prefixes = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FamilySubsets::class, \Google\Cloud\Bigtable\Admin\V2\AuthorizedView_FamilySubsets::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView/ResponseView.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView/ResponseView.php new file mode 100644 index 000000000000..de81a7c072d4 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView/ResponseView.php @@ -0,0 +1,72 @@ +google.bigtable.admin.v2.AuthorizedView.ResponseView + */ +class ResponseView +{ + /** + * Uses the default view for each method as documented in the request. + * + * Generated from protobuf enum RESPONSE_VIEW_UNSPECIFIED = 0; + */ + const RESPONSE_VIEW_UNSPECIFIED = 0; + /** + * Only populates `name`. + * + * Generated from protobuf enum NAME_ONLY = 1; + */ + const NAME_ONLY = 1; + /** + * Only populates the AuthorizedView's basic metadata. This includes: + * name, deletion_protection, etag. + * + * Generated from protobuf enum BASIC = 2; + */ + const BASIC = 2; + /** + * Populates every fields. + * + * Generated from protobuf enum FULL = 3; + */ + const FULL = 3; + + private static $valueToName = [ + self::RESPONSE_VIEW_UNSPECIFIED => 'RESPONSE_VIEW_UNSPECIFIED', + self::NAME_ONLY => 'NAME_ONLY', + self::BASIC => 'BASIC', + self::FULL => 'FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResponseView::class, \Google\Cloud\Bigtable\Admin\V2\AuthorizedView_ResponseView::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView/SubsetView.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView/SubsetView.php new file mode 100644 index 000000000000..e20712a5b644 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AuthorizedView/SubsetView.php @@ -0,0 +1,112 @@ +google.bigtable.admin.v2.AuthorizedView.SubsetView + */ +class SubsetView extends \Google\Protobuf\Internal\Message +{ + /** + * Row prefixes to be included in the AuthorizedView. + * To provide access to all rows, include the empty string as a prefix (""). + * + * Generated from protobuf field repeated bytes row_prefixes = 1; + */ + private $row_prefixes; + /** + * Map from column family name to the columns in this family to be included + * in the AuthorizedView. + * + * Generated from protobuf field map family_subsets = 2; + */ + private $family_subsets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $row_prefixes + * Row prefixes to be included in the AuthorizedView. + * To provide access to all rows, include the empty string as a prefix (""). + * @type array|\Google\Protobuf\Internal\MapField $family_subsets + * Map from column family name to the columns in this family to be included + * in the AuthorizedView. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Row prefixes to be included in the AuthorizedView. + * To provide access to all rows, include the empty string as a prefix (""). + * + * Generated from protobuf field repeated bytes row_prefixes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRowPrefixes() + { + return $this->row_prefixes; + } + + /** + * Row prefixes to be included in the AuthorizedView. + * To provide access to all rows, include the empty string as a prefix (""). + * + * Generated from protobuf field repeated bytes row_prefixes = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRowPrefixes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); + $this->row_prefixes = $arr; + + return $this; + } + + /** + * Map from column family name to the columns in this family to be included + * in the AuthorizedView. + * + * Generated from protobuf field map family_subsets = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getFamilySubsets() + { + return $this->family_subsets; + } + + /** + * Map from column family name to the columns in this family to be included + * in the AuthorizedView. + * + * Generated from protobuf field map family_subsets = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setFamilySubsets($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\AuthorizedView\FamilySubsets::class); + $this->family_subsets = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SubsetView::class, \Google\Cloud\Bigtable\Admin\V2\AuthorizedView_SubsetView::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AutoscalingLimits.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AutoscalingLimits.php new file mode 100644 index 000000000000..87c9350253d9 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AutoscalingLimits.php @@ -0,0 +1,101 @@ +google.bigtable.admin.v2.AutoscalingLimits + */ +class AutoscalingLimits extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Minimum number of nodes to scale down to. + * + * Generated from protobuf field int32 min_serve_nodes = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $min_serve_nodes = 0; + /** + * Required. Maximum number of nodes to scale up to. + * + * Generated from protobuf field int32 max_serve_nodes = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $max_serve_nodes = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $min_serve_nodes + * Required. Minimum number of nodes to scale down to. + * @type int $max_serve_nodes + * Required. Maximum number of nodes to scale up to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. Minimum number of nodes to scale down to. + * + * Generated from protobuf field int32 min_serve_nodes = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMinServeNodes() + { + return $this->min_serve_nodes; + } + + /** + * Required. Minimum number of nodes to scale down to. + * + * Generated from protobuf field int32 min_serve_nodes = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMinServeNodes($var) + { + GPBUtil::checkInt32($var); + $this->min_serve_nodes = $var; + + return $this; + } + + /** + * Required. Maximum number of nodes to scale up to. + * + * Generated from protobuf field int32 max_serve_nodes = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMaxServeNodes() + { + return $this->max_serve_nodes; + } + + /** + * Required. Maximum number of nodes to scale up to. + * + * Generated from protobuf field int32 max_serve_nodes = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMaxServeNodes($var) + { + GPBUtil::checkInt32($var); + $this->max_serve_nodes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AutoscalingTargets.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AutoscalingTargets.php new file mode 100644 index 000000000000..4825251531fe --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/AutoscalingTargets.php @@ -0,0 +1,133 @@ +google.bigtable.admin.v2.AutoscalingTargets + */ +class AutoscalingTargets extends \Google\Protobuf\Internal\Message +{ + /** + * The cpu utilization that the Autoscaler should be trying to achieve. + * This number is on a scale from 0 (no utilization) to + * 100 (total utilization), and is limited between 10 and 80, otherwise it + * will return INVALID_ARGUMENT error. + * + * Generated from protobuf field int32 cpu_utilization_percent = 2; + */ + protected $cpu_utilization_percent = 0; + /** + * The storage utilization that the Autoscaler should be trying to achieve. + * This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD + * cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster, + * otherwise it will return INVALID_ARGUMENT error. If this value is set to 0, + * it will be treated as if it were set to the default value: 2560 for SSD, + * 8192 for HDD. + * + * Generated from protobuf field int32 storage_utilization_gib_per_node = 3; + */ + protected $storage_utilization_gib_per_node = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $cpu_utilization_percent + * The cpu utilization that the Autoscaler should be trying to achieve. + * This number is on a scale from 0 (no utilization) to + * 100 (total utilization), and is limited between 10 and 80, otherwise it + * will return INVALID_ARGUMENT error. + * @type int $storage_utilization_gib_per_node + * The storage utilization that the Autoscaler should be trying to achieve. + * This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD + * cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster, + * otherwise it will return INVALID_ARGUMENT error. If this value is set to 0, + * it will be treated as if it were set to the default value: 2560 for SSD, + * 8192 for HDD. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The cpu utilization that the Autoscaler should be trying to achieve. + * This number is on a scale from 0 (no utilization) to + * 100 (total utilization), and is limited between 10 and 80, otherwise it + * will return INVALID_ARGUMENT error. + * + * Generated from protobuf field int32 cpu_utilization_percent = 2; + * @return int + */ + public function getCpuUtilizationPercent() + { + return $this->cpu_utilization_percent; + } + + /** + * The cpu utilization that the Autoscaler should be trying to achieve. + * This number is on a scale from 0 (no utilization) to + * 100 (total utilization), and is limited between 10 and 80, otherwise it + * will return INVALID_ARGUMENT error. + * + * Generated from protobuf field int32 cpu_utilization_percent = 2; + * @param int $var + * @return $this + */ + public function setCpuUtilizationPercent($var) + { + GPBUtil::checkInt32($var); + $this->cpu_utilization_percent = $var; + + return $this; + } + + /** + * The storage utilization that the Autoscaler should be trying to achieve. + * This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD + * cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster, + * otherwise it will return INVALID_ARGUMENT error. If this value is set to 0, + * it will be treated as if it were set to the default value: 2560 for SSD, + * 8192 for HDD. + * + * Generated from protobuf field int32 storage_utilization_gib_per_node = 3; + * @return int + */ + public function getStorageUtilizationGibPerNode() + { + return $this->storage_utilization_gib_per_node; + } + + /** + * The storage utilization that the Autoscaler should be trying to achieve. + * This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD + * cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster, + * otherwise it will return INVALID_ARGUMENT error. If this value is set to 0, + * it will be treated as if it were set to the default value: 2560 for SSD, + * 8192 for HDD. + * + * Generated from protobuf field int32 storage_utilization_gib_per_node = 3; + * @param int $var + * @return $this + */ + public function setStorageUtilizationGibPerNode($var) + { + GPBUtil::checkInt32($var); + $this->storage_utilization_gib_per_node = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Backup.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Backup.php new file mode 100644 index 000000000000..f5dc03ee44e3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Backup.php @@ -0,0 +1,573 @@ +google.bigtable.admin.v2.Backup + */ +class Backup extends \Google\Protobuf\Internal\Message +{ + /** + * A globally unique identifier for the backup which cannot be + * changed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/ + * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*` + * The final segment of the name must be between 1 and 50 characters + * in length. + * The backup is stored in the cluster identified by the prefix of the backup + * name of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. Immutable. Name of the table from which this backup was created. + * This needs to be in the same instance as the backup. Values are of the form + * `projects/{project}/instances/{instance}/tables/{source_table}`. + * + * Generated from protobuf field string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + */ + protected $source_table = ''; + /** + * Output only. Name of the backup from which this backup was copied. If a + * backup is not created by copying a backup, this field will be empty. Values + * are of the form: + * projects//instances//clusters//backups/ + * + * Generated from protobuf field string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $source_backup = ''; + /** + * Required. The expiration time of the backup. + * When creating a backup or updating its `expire_time`, the value must be + * greater than the backup creation time by: + * - At least 6 hours + * - At most 90 days + * Once the `expire_time` has passed, Cloud Bigtable will delete the backup. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $expire_time = null; + /** + * Output only. `start_time` is the time that the backup was started + * (i.e. approximately the time the + * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] + * request is received). The row data in this backup will be no older than + * this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. `end_time` is the time that the backup was finished. The row + * data in the backup will be no newer than this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size_bytes = 0; + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_info = null; + /** + * Indicates the backup type of the backup. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + */ + protected $backup_type = 0; + /** + * The time at which the hot backup will be converted to a standard backup. + * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the + * hot backup to a standard backup. This value must be greater than the backup + * creation time by: + * - At least 24 hours + * This field only applies for hot backups. When creating or updating a + * standard backup, attempting to set this field will fail the request. + * + * Generated from protobuf field .google.protobuf.Timestamp hot_to_standard_time = 12; + */ + protected $hot_to_standard_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * A globally unique identifier for the backup which cannot be + * changed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/ + * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*` + * The final segment of the name must be between 1 and 50 characters + * in length. + * The backup is stored in the cluster identified by the prefix of the backup + * name of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @type string $source_table + * Required. Immutable. Name of the table from which this backup was created. + * This needs to be in the same instance as the backup. Values are of the form + * `projects/{project}/instances/{instance}/tables/{source_table}`. + * @type string $source_backup + * Output only. Name of the backup from which this backup was copied. If a + * backup is not created by copying a backup, this field will be empty. Values + * are of the form: + * projects//instances//clusters//backups/ + * @type \Google\Protobuf\Timestamp $expire_time + * Required. The expiration time of the backup. + * When creating a backup or updating its `expire_time`, the value must be + * greater than the backup creation time by: + * - At least 6 hours + * - At most 90 days + * Once the `expire_time` has passed, Cloud Bigtable will delete the backup. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. `start_time` is the time that the backup was started + * (i.e. approximately the time the + * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] + * request is received). The row data in this backup will be no older than + * this timestamp. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. `end_time` is the time that the backup was finished. The row + * data in the backup will be no newer than this timestamp. + * @type int|string $size_bytes + * Output only. Size of the backup in bytes. + * @type int $state + * Output only. The current state of the backup. + * @type \Google\Cloud\Bigtable\Admin\V2\EncryptionInfo $encryption_info + * Output only. The encryption information for the backup. + * @type int $backup_type + * Indicates the backup type of the backup. + * @type \Google\Protobuf\Timestamp $hot_to_standard_time + * The time at which the hot backup will be converted to a standard backup. + * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the + * hot backup to a standard backup. This value must be greater than the backup + * creation time by: + * - At least 24 hours + * This field only applies for hot backups. When creating or updating a + * standard backup, attempting to set this field will fail the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * A globally unique identifier for the backup which cannot be + * changed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/ + * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*` + * The final segment of the name must be between 1 and 50 characters + * in length. + * The backup is stored in the cluster identified by the prefix of the backup + * name of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * A globally unique identifier for the backup which cannot be + * changed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/ + * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*` + * The final segment of the name must be between 1 and 50 characters + * in length. + * The backup is stored in the cluster identified by the prefix of the backup + * name of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Immutable. Name of the table from which this backup was created. + * This needs to be in the same instance as the backup. Values are of the form + * `projects/{project}/instances/{instance}/tables/{source_table}`. + * + * Generated from protobuf field string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSourceTable() + { + return $this->source_table; + } + + /** + * Required. Immutable. Name of the table from which this backup was created. + * This needs to be in the same instance as the backup. Values are of the form + * `projects/{project}/instances/{instance}/tables/{source_table}`. + * + * Generated from protobuf field string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSourceTable($var) + { + GPBUtil::checkString($var, True); + $this->source_table = $var; + + return $this; + } + + /** + * Output only. Name of the backup from which this backup was copied. If a + * backup is not created by copying a backup, this field will be empty. Values + * are of the form: + * projects//instances//clusters//backups/ + * + * Generated from protobuf field string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSourceBackup() + { + return $this->source_backup; + } + + /** + * Output only. Name of the backup from which this backup was copied. If a + * backup is not created by copying a backup, this field will be empty. Values + * are of the form: + * projects//instances//clusters//backups/ + * + * Generated from protobuf field string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSourceBackup($var) + { + GPBUtil::checkString($var, True); + $this->source_backup = $var; + + return $this; + } + + /** + * Required. The expiration time of the backup. + * When creating a backup or updating its `expire_time`, the value must be + * greater than the backup creation time by: + * - At least 6 hours + * - At most 90 days + * Once the `expire_time` has passed, Cloud Bigtable will delete the backup. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Required. The expiration time of the backup. + * When creating a backup or updating its `expire_time`, the value must be + * greater than the backup creation time by: + * - At least 6 hours + * - At most 90 days + * Once the `expire_time` has passed, Cloud Bigtable will delete the backup. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. `start_time` is the time that the backup was started + * (i.e. approximately the time the + * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] + * request is received). The row data in this backup will be no older than + * this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. `start_time` is the time that the backup was started + * (i.e. approximately the time the + * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] + * request is received). The row data in this backup will be no older than + * this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. `end_time` is the time that the backup was finished. The row + * data in the backup will be no newer than this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. `end_time` is the time that the backup was finished. The row + * data in the backup will be no newer than this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getSizeBytes() + { + return $this->size_bytes; + } + + /** + * Output only. Size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->size_bytes = $var; + + return $this; + } + + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Backup\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Bigtable\Admin\V2\EncryptionInfo|null + */ + public function getEncryptionInfo() + { + return $this->encryption_info; + } + + public function hasEncryptionInfo() + { + return isset($this->encryption_info); + } + + public function clearEncryptionInfo() + { + unset($this->encryption_info); + } + + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Bigtable\Admin\V2\EncryptionInfo $var + * @return $this + */ + public function setEncryptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\EncryptionInfo::class); + $this->encryption_info = $var; + + return $this; + } + + /** + * Indicates the backup type of the backup. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * @return int + */ + public function getBackupType() + { + return $this->backup_type; + } + + /** + * Indicates the backup type of the backup. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * @param int $var + * @return $this + */ + public function setBackupType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Backup\BackupType::class); + $this->backup_type = $var; + + return $this; + } + + /** + * The time at which the hot backup will be converted to a standard backup. + * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the + * hot backup to a standard backup. This value must be greater than the backup + * creation time by: + * - At least 24 hours + * This field only applies for hot backups. When creating or updating a + * standard backup, attempting to set this field will fail the request. + * + * Generated from protobuf field .google.protobuf.Timestamp hot_to_standard_time = 12; + * @return \Google\Protobuf\Timestamp|null + */ + public function getHotToStandardTime() + { + return $this->hot_to_standard_time; + } + + public function hasHotToStandardTime() + { + return isset($this->hot_to_standard_time); + } + + public function clearHotToStandardTime() + { + unset($this->hot_to_standard_time); + } + + /** + * The time at which the hot backup will be converted to a standard backup. + * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the + * hot backup to a standard backup. This value must be greater than the backup + * creation time by: + * - At least 24 hours + * This field only applies for hot backups. When creating or updating a + * standard backup, attempting to set this field will fail the request. + * + * Generated from protobuf field .google.protobuf.Timestamp hot_to_standard_time = 12; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setHotToStandardTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->hot_to_standard_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Backup/BackupType.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Backup/BackupType.php new file mode 100644 index 000000000000..cf2244ea9b7e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Backup/BackupType.php @@ -0,0 +1,69 @@ +google.bigtable.admin.v2.Backup.BackupType + */ +class BackupType +{ + /** + * Not specified. + * + * Generated from protobuf enum BACKUP_TYPE_UNSPECIFIED = 0; + */ + const BACKUP_TYPE_UNSPECIFIED = 0; + /** + * The default type for Cloud Bigtable managed backups. Supported for + * backups created in both HDD and SSD instances. Requires optimization when + * restored to a table in an SSD instance. + * + * Generated from protobuf enum STANDARD = 1; + */ + const STANDARD = 1; + /** + * A backup type with faster restore to SSD performance. Only supported for + * backups created in SSD instances. A new SSD table restored from a hot + * backup reaches production performance more quickly than a standard + * backup. + * + * Generated from protobuf enum HOT = 2; + */ + const HOT = 2; + + private static $valueToName = [ + self::BACKUP_TYPE_UNSPECIFIED => 'BACKUP_TYPE_UNSPECIFIED', + self::STANDARD => 'STANDARD', + self::HOT => 'HOT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BackupType::class, \Google\Cloud\Bigtable\Admin\V2\Backup_BackupType::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Backup/State.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Backup/State.php new file mode 100644 index 000000000000..1e7867d2bd8a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Backup/State.php @@ -0,0 +1,65 @@ +google.bigtable.admin.v2.Backup.State + */ +class State +{ + /** + * Not specified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The pending backup is still being created. Operations on the + * backup may fail with `FAILED_PRECONDITION` in this state. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The backup is complete and ready for use. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Bigtable\Admin\V2\Backup_State::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/BackupInfo.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/BackupInfo.php new file mode 100644 index 000000000000..a9680225f63e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/BackupInfo.php @@ -0,0 +1,243 @@ +google.bigtable.admin.v2.BackupInfo + */ +class BackupInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the backup. + * + * Generated from protobuf field string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup = ''; + /** + * Output only. The time that the backup was started. Row data in the backup + * will be no older than this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. This time that the backup was finished. Row data in the + * backup will be no newer than this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Name of the table the backup was created from. + * + * Generated from protobuf field string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $source_table = ''; + /** + * Output only. Name of the backup from which this backup was copied. If a + * backup is not created by copying a backup, this field will be empty. Values + * are of the form: + * projects//instances//clusters//backups/ + * + * Generated from protobuf field string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $source_backup = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backup + * Output only. Name of the backup. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The time that the backup was started. Row data in the backup + * will be no older than this timestamp. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. This time that the backup was finished. Row data in the + * backup will be no newer than this timestamp. + * @type string $source_table + * Output only. Name of the table the backup was created from. + * @type string $source_backup + * Output only. Name of the backup from which this backup was copied. If a + * backup is not created by copying a backup, this field will be empty. Values + * are of the form: + * projects//instances//clusters//backups/ + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the backup. + * + * Generated from protobuf field string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getBackup() + { + return $this->backup; + } + + /** + * Output only. Name of the backup. + * + * Generated from protobuf field string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkString($var, True); + $this->backup = $var; + + return $this; + } + + /** + * Output only. The time that the backup was started. Row data in the backup + * will be no older than this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The time that the backup was started. Row data in the backup + * will be no older than this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. This time that the backup was finished. Row data in the + * backup will be no newer than this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. This time that the backup was finished. Row data in the + * backup will be no newer than this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Name of the table the backup was created from. + * + * Generated from protobuf field string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSourceTable() + { + return $this->source_table; + } + + /** + * Output only. Name of the table the backup was created from. + * + * Generated from protobuf field string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSourceTable($var) + { + GPBUtil::checkString($var, True); + $this->source_table = $var; + + return $this; + } + + /** + * Output only. Name of the backup from which this backup was copied. If a + * backup is not created by copying a backup, this field will be empty. Values + * are of the form: + * projects//instances//clusters//backups/ + * + * Generated from protobuf field string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSourceBackup() + { + return $this->source_backup; + } + + /** + * Output only. Name of the backup from which this backup was copied. If a + * backup is not created by copying a backup, this field will be empty. Values + * are of the form: + * projects//instances//clusters//backups/ + * + * Generated from protobuf field string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSourceBackup($var) + { + GPBUtil::checkString($var, True); + $this->source_backup = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ChangeStreamConfig.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ChangeStreamConfig.php new file mode 100644 index 000000000000..49dbf3a36659 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ChangeStreamConfig.php @@ -0,0 +1,93 @@ +google.bigtable.admin.v2.ChangeStreamConfig + */ +class ChangeStreamConfig extends \Google\Protobuf\Internal\Message +{ + /** + * How long the change stream should be retained. Change stream data older + * than the retention period will not be returned when reading the change + * stream from the table. + * Values must be at least 1 day and at most 7 days, and will be truncated to + * microsecond granularity. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + */ + protected $retention_period = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $retention_period + * How long the change stream should be retained. Change stream data older + * than the retention period will not be returned when reading the change + * stream from the table. + * Values must be at least 1 day and at most 7 days, and will be truncated to + * microsecond granularity. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * How long the change stream should be retained. Change stream data older + * than the retention period will not be returned when reading the change + * stream from the table. + * Values must be at least 1 day and at most 7 days, and will be truncated to + * microsecond granularity. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getRetentionPeriod() + { + return $this->retention_period; + } + + public function hasRetentionPeriod() + { + return isset($this->retention_period); + } + + public function clearRetentionPeriod() + { + unset($this->retention_period); + } + + /** + * How long the change stream should be retained. Change stream data older + * than the retention period will not be returned when reading the change + * stream from the table. + * Values must be at least 1 day and at most 7 days, and will be truncated to + * microsecond granularity. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRetentionPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->retention_period = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CheckConsistencyRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CheckConsistencyRequest.php new file mode 100644 index 000000000000..543b4f861565 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CheckConsistencyRequest.php @@ -0,0 +1,215 @@ +google.bigtable.admin.v2.CheckConsistencyRequest + */ +class CheckConsistencyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the Table for which to check replication + * consistency. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The token created using GenerateConsistencyToken for the Table. + * + * Generated from protobuf field string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $consistency_token = ''; + protected $mode; + + /** + * @param string $name Required. The unique name of the Table for which to check replication + * consistency. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. Please see + * {@see BigtableTableAdminClient::tableName()} for help formatting this field. + * @param string $consistencyToken Required. The token created using GenerateConsistencyToken for the Table. + * + * @return \Google\Cloud\Bigtable\Admin\V2\CheckConsistencyRequest + * + * @experimental + */ + public static function build(string $name, string $consistencyToken): self + { + return (new self()) + ->setName($name) + ->setConsistencyToken($consistencyToken); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the Table for which to check replication + * consistency. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @type string $consistency_token + * Required. The token created using GenerateConsistencyToken for the Table. + * @type \Google\Cloud\Bigtable\Admin\V2\StandardReadRemoteWrites $standard_read_remote_writes + * Checks that reads using an app profile with `StandardIsolation` can + * see all writes committed before the token was created, even if the + * read and write target different clusters. + * @type \Google\Cloud\Bigtable\Admin\V2\DataBoostReadLocalWrites $data_boost_read_local_writes + * Checks that reads using an app profile with `DataBoostIsolationReadOnly` + * can see all writes committed before the token was created, but only if + * the read and write target the same cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the Table for which to check replication + * consistency. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the Table for which to check replication + * consistency. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The token created using GenerateConsistencyToken for the Table. + * + * Generated from protobuf field string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getConsistencyToken() + { + return $this->consistency_token; + } + + /** + * Required. The token created using GenerateConsistencyToken for the Table. + * + * Generated from protobuf field string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setConsistencyToken($var) + { + GPBUtil::checkString($var, True); + $this->consistency_token = $var; + + return $this; + } + + /** + * Checks that reads using an app profile with `StandardIsolation` can + * see all writes committed before the token was created, even if the + * read and write target different clusters. + * + * Generated from protobuf field .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * @return \Google\Cloud\Bigtable\Admin\V2\StandardReadRemoteWrites|null + */ + public function getStandardReadRemoteWrites() + { + return $this->readOneof(3); + } + + public function hasStandardReadRemoteWrites() + { + return $this->hasOneof(3); + } + + /** + * Checks that reads using an app profile with `StandardIsolation` can + * see all writes committed before the token was created, even if the + * read and write target different clusters. + * + * Generated from protobuf field .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * @param \Google\Cloud\Bigtable\Admin\V2\StandardReadRemoteWrites $var + * @return $this + */ + public function setStandardReadRemoteWrites($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\StandardReadRemoteWrites::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Checks that reads using an app profile with `DataBoostIsolationReadOnly` + * can see all writes committed before the token was created, but only if + * the read and write target the same cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * @return \Google\Cloud\Bigtable\Admin\V2\DataBoostReadLocalWrites|null + */ + public function getDataBoostReadLocalWrites() + { + return $this->readOneof(4); + } + + public function hasDataBoostReadLocalWrites() + { + return $this->hasOneof(4); + } + + /** + * Checks that reads using an app profile with `DataBoostIsolationReadOnly` + * can see all writes committed before the token was created, but only if + * the read and write target the same cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * @param \Google\Cloud\Bigtable\Admin\V2\DataBoostReadLocalWrites $var + * @return $this + */ + public function setDataBoostReadLocalWrites($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\DataBoostReadLocalWrites::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getMode() + { + return $this->whichOneof("mode"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CheckConsistencyResponse.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CheckConsistencyResponse.php new file mode 100644 index 000000000000..86e789432683 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CheckConsistencyResponse.php @@ -0,0 +1,72 @@ +google.bigtable.admin.v2.CheckConsistencyResponse + */ +class CheckConsistencyResponse extends \Google\Protobuf\Internal\Message +{ + /** + * True only if the token is consistent. A token is consistent if replication + * has caught up with the restrictions specified in the request. + * + * Generated from protobuf field bool consistent = 1; + */ + protected $consistent = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $consistent + * True only if the token is consistent. A token is consistent if replication + * has caught up with the restrictions specified in the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * True only if the token is consistent. A token is consistent if replication + * has caught up with the restrictions specified in the request. + * + * Generated from protobuf field bool consistent = 1; + * @return bool + */ + public function getConsistent() + { + return $this->consistent; + } + + /** + * True only if the token is consistent. A token is consistent if replication + * has caught up with the restrictions specified in the request. + * + * Generated from protobuf field bool consistent = 1; + * @param bool $var + * @return $this + */ + public function setConsistent($var) + { + GPBUtil::checkBool($var); + $this->consistent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster.php new file mode 100644 index 000000000000..f85b6bce6a47 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster.php @@ -0,0 +1,349 @@ +google.bigtable.admin.v2.Cluster + */ +class Cluster extends \Google\Protobuf\Internal\Message +{ + /** + * The unique name of the cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Immutable. The location where this cluster's nodes and storage reside. For + * best performance, clients should be located as close as possible to this + * cluster. Currently only zones are supported, so values should be of the + * form `projects/{project}/locations/{zone}`. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $location = ''; + /** + * Output only. The current state of the cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * The number of nodes allocated to this cluster. More nodes enable higher + * throughput and more consistent performance. + * + * Generated from protobuf field int32 serve_nodes = 4; + */ + protected $serve_nodes = 0; + /** + * Immutable. The node scaling factor of this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $node_scaling_factor = 0; + /** + * Immutable. The type of storage used by this cluster to serve its + * parent instance's tables, unless explicitly overridden. + * + * Generated from protobuf field .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $default_storage_type = 0; + /** + * Immutable. The encryption configuration for CMEK-protected clusters. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $encryption_config = null; + protected $config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. + * @type string $location + * Immutable. The location where this cluster's nodes and storage reside. For + * best performance, clients should be located as close as possible to this + * cluster. Currently only zones are supported, so values should be of the + * form `projects/{project}/locations/{zone}`. + * @type int $state + * Output only. The current state of the cluster. + * @type int $serve_nodes + * The number of nodes allocated to this cluster. More nodes enable higher + * throughput and more consistent performance. + * @type int $node_scaling_factor + * Immutable. The node scaling factor of this cluster. + * @type \Google\Cloud\Bigtable\Admin\V2\Cluster\ClusterConfig $cluster_config + * Configuration for this cluster. + * @type int $default_storage_type + * Immutable. The type of storage used by this cluster to serve its + * parent instance's tables, unless explicitly overridden. + * @type \Google\Cloud\Bigtable\Admin\V2\Cluster\EncryptionConfig $encryption_config + * Immutable. The encryption configuration for CMEK-protected clusters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The unique name of the cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique name of the cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Immutable. The location where this cluster's nodes and storage reside. For + * best performance, clients should be located as close as possible to this + * cluster. Currently only zones are supported, so values should be of the + * form `projects/{project}/locations/{zone}`. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Immutable. The location where this cluster's nodes and storage reside. For + * best performance, clients should be located as close as possible to this + * cluster. Currently only zones are supported, so values should be of the + * form `projects/{project}/locations/{zone}`. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Output only. The current state of the cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Cluster\State::class); + $this->state = $var; + + return $this; + } + + /** + * The number of nodes allocated to this cluster. More nodes enable higher + * throughput and more consistent performance. + * + * Generated from protobuf field int32 serve_nodes = 4; + * @return int + */ + public function getServeNodes() + { + return $this->serve_nodes; + } + + /** + * The number of nodes allocated to this cluster. More nodes enable higher + * throughput and more consistent performance. + * + * Generated from protobuf field int32 serve_nodes = 4; + * @param int $var + * @return $this + */ + public function setServeNodes($var) + { + GPBUtil::checkInt32($var); + $this->serve_nodes = $var; + + return $this; + } + + /** + * Immutable. The node scaling factor of this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getNodeScalingFactor() + { + return $this->node_scaling_factor; + } + + /** + * Immutable. The node scaling factor of this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setNodeScalingFactor($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Cluster\NodeScalingFactor::class); + $this->node_scaling_factor = $var; + + return $this; + } + + /** + * Configuration for this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + * @return \Google\Cloud\Bigtable\Admin\V2\Cluster\ClusterConfig|null + */ + public function getClusterConfig() + { + return $this->readOneof(7); + } + + public function hasClusterConfig() + { + return $this->hasOneof(7); + } + + /** + * Configuration for this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + * @param \Google\Cloud\Bigtable\Admin\V2\Cluster\ClusterConfig $var + * @return $this + */ + public function setClusterConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Cluster\ClusterConfig::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Immutable. The type of storage used by this cluster to serve its + * parent instance's tables, unless explicitly overridden. + * + * Generated from protobuf field .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getDefaultStorageType() + { + return $this->default_storage_type; + } + + /** + * Immutable. The type of storage used by this cluster to serve its + * parent instance's tables, unless explicitly overridden. + * + * Generated from protobuf field .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setDefaultStorageType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\StorageType::class); + $this->default_storage_type = $var; + + return $this; + } + + /** + * Immutable. The encryption configuration for CMEK-protected clusters. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\Bigtable\Admin\V2\Cluster\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * Immutable. The encryption configuration for CMEK-protected clusters. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\Bigtable\Admin\V2\Cluster\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Cluster\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + + /** + * @return string + */ + public function getConfig() + { + return $this->whichOneof("config"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/ClusterAutoscalingConfig.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/ClusterAutoscalingConfig.php new file mode 100644 index 000000000000..997961367dd3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/ClusterAutoscalingConfig.php @@ -0,0 +1,124 @@ +google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + */ +class ClusterAutoscalingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Autoscaling limits for this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaling_limits = null; + /** + * Required. Autoscaling targets for this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaling_targets = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\AutoscalingLimits $autoscaling_limits + * Required. Autoscaling limits for this cluster. + * @type \Google\Cloud\Bigtable\Admin\V2\AutoscalingTargets $autoscaling_targets + * Required. Autoscaling targets for this cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Required. Autoscaling limits for this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\AutoscalingLimits|null + */ + public function getAutoscalingLimits() + { + return $this->autoscaling_limits; + } + + public function hasAutoscalingLimits() + { + return isset($this->autoscaling_limits); + } + + public function clearAutoscalingLimits() + { + unset($this->autoscaling_limits); + } + + /** + * Required. Autoscaling limits for this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\AutoscalingLimits $var + * @return $this + */ + public function setAutoscalingLimits($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AutoscalingLimits::class); + $this->autoscaling_limits = $var; + + return $this; + } + + /** + * Required. Autoscaling targets for this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\AutoscalingTargets|null + */ + public function getAutoscalingTargets() + { + return $this->autoscaling_targets; + } + + public function hasAutoscalingTargets() + { + return isset($this->autoscaling_targets); + } + + public function clearAutoscalingTargets() + { + unset($this->autoscaling_targets); + } + + /** + * Required. Autoscaling targets for this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\AutoscalingTargets $var + * @return $this + */ + public function setAutoscalingTargets($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AutoscalingTargets::class); + $this->autoscaling_targets = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ClusterAutoscalingConfig::class, \Google\Cloud\Bigtable\Admin\V2\Cluster_ClusterAutoscalingConfig::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/ClusterConfig.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/ClusterConfig.php new file mode 100644 index 000000000000..b8856b291e62 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/ClusterConfig.php @@ -0,0 +1,80 @@ +google.bigtable.admin.v2.Cluster.ClusterConfig + */ +class ClusterConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Autoscaling configuration for this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + */ + protected $cluster_autoscaling_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Cluster\ClusterAutoscalingConfig $cluster_autoscaling_config + * Autoscaling configuration for this cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Autoscaling configuration for this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Cluster\ClusterAutoscalingConfig|null + */ + public function getClusterAutoscalingConfig() + { + return $this->cluster_autoscaling_config; + } + + public function hasClusterAutoscalingConfig() + { + return isset($this->cluster_autoscaling_config); + } + + public function clearClusterAutoscalingConfig() + { + unset($this->cluster_autoscaling_config); + } + + /** + * Autoscaling configuration for this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Cluster\ClusterAutoscalingConfig $var + * @return $this + */ + public function setClusterAutoscalingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Cluster\ClusterAutoscalingConfig::class); + $this->cluster_autoscaling_config = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ClusterConfig::class, \Google\Cloud\Bigtable\Admin\V2\Cluster_ClusterConfig::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/EncryptionConfig.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/EncryptionConfig.php new file mode 100644 index 000000000000..3294a44ba562 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/EncryptionConfig.php @@ -0,0 +1,107 @@ +google.bigtable.admin.v2.Cluster.EncryptionConfig + */ +class EncryptionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Describes the Cloud KMS encryption key that will be used to protect the + * destination Bigtable cluster. The requirements for this key are: + * 1) The Cloud Bigtable service account associated with the project that + * contains this cluster must be granted the + * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. + * 2) Only regional keys can be used and the region of the CMEK key must + * match the region of the cluster. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { + */ + protected $kms_key_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kms_key_name + * Describes the Cloud KMS encryption key that will be used to protect the + * destination Bigtable cluster. The requirements for this key are: + * 1) The Cloud Bigtable service account associated with the project that + * contains this cluster must be granted the + * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. + * 2) Only regional keys can be used and the region of the CMEK key must + * match the region of the cluster. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * Describes the Cloud KMS encryption key that will be used to protect the + * destination Bigtable cluster. The requirements for this key are: + * 1) The Cloud Bigtable service account associated with the project that + * contains this cluster must be granted the + * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. + * 2) Only regional keys can be used and the region of the CMEK key must + * match the region of the cluster. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getKmsKeyName() + { + return $this->kms_key_name; + } + + /** + * Describes the Cloud KMS encryption key that will be used to protect the + * destination Bigtable cluster. The requirements for this key are: + * 1) The Cloud Bigtable service account associated with the project that + * contains this cluster must be granted the + * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. + * 2) Only regional keys can be used and the region of the CMEK key must + * match the region of the cluster. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EncryptionConfig::class, \Google\Cloud\Bigtable\Admin\V2\Cluster_EncryptionConfig::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/NodeScalingFactor.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/NodeScalingFactor.php new file mode 100644 index 000000000000..c5f625fd27e6 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/NodeScalingFactor.php @@ -0,0 +1,67 @@ +google.bigtable.admin.v2.Cluster.NodeScalingFactor + */ +class NodeScalingFactor +{ + /** + * No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X. + * + * Generated from protobuf enum NODE_SCALING_FACTOR_UNSPECIFIED = 0; + */ + const NODE_SCALING_FACTOR_UNSPECIFIED = 0; + /** + * The cluster is running with a scaling factor of 1. + * + * Generated from protobuf enum NODE_SCALING_FACTOR_1X = 1; + */ + const NODE_SCALING_FACTOR_1X = 1; + /** + * The cluster is running with a scaling factor of 2. + * All node count values must be in increments of 2 with this scaling factor + * enabled, otherwise an INVALID_ARGUMENT error will be returned. + * + * Generated from protobuf enum NODE_SCALING_FACTOR_2X = 2; + */ + const NODE_SCALING_FACTOR_2X = 2; + + private static $valueToName = [ + self::NODE_SCALING_FACTOR_UNSPECIFIED => 'NODE_SCALING_FACTOR_UNSPECIFIED', + self::NODE_SCALING_FACTOR_1X => 'NODE_SCALING_FACTOR_1X', + self::NODE_SCALING_FACTOR_2X => 'NODE_SCALING_FACTOR_2X', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NodeScalingFactor::class, \Google\Cloud\Bigtable\Admin\V2\Cluster_NodeScalingFactor::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/State.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/State.php new file mode 100644 index 000000000000..fc392006912f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Cluster/State.php @@ -0,0 +1,85 @@ +google.bigtable.admin.v2.Cluster.State + */ +class State +{ + /** + * The state of the cluster could not be determined. + * + * Generated from protobuf enum STATE_NOT_KNOWN = 0; + */ + const STATE_NOT_KNOWN = 0; + /** + * The cluster has been successfully created and is ready to serve requests. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The cluster is currently being created, and may be destroyed + * if the creation process encounters an error. + * A cluster may not be able to serve requests while being created. + * + * Generated from protobuf enum CREATING = 2; + */ + const CREATING = 2; + /** + * The cluster is currently being resized, and may revert to its previous + * node count if the process encounters an error. + * A cluster is still capable of serving requests while being resized, + * but may exhibit performance as if its number of allocated nodes is + * between the starting and requested states. + * + * Generated from protobuf enum RESIZING = 3; + */ + const RESIZING = 3; + /** + * The cluster has no backing nodes. The data (tables) still + * exist, but no operations can be performed on the cluster. + * + * Generated from protobuf enum DISABLED = 4; + */ + const DISABLED = 4; + + private static $valueToName = [ + self::STATE_NOT_KNOWN => 'STATE_NOT_KNOWN', + self::READY => 'READY', + self::CREATING => 'CREATING', + self::RESIZING => 'RESIZING', + self::DISABLED => 'DISABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Bigtable\Admin\V2\Cluster_State::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ColumnFamily.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ColumnFamily.php new file mode 100644 index 000000000000..12959e605d65 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ColumnFamily.php @@ -0,0 +1,157 @@ +google.bigtable.admin.v2.ColumnFamily + */ +class ColumnFamily extends \Google\Protobuf\Internal\Message +{ + /** + * Garbage collection rule specified as a protobuf. + * Must serialize to at most 500 bytes. + * NOTE: Garbage collection executes opportunistically in the background, and + * so it's possible for reads to return a cell even if it matches the active + * GC expression for its family. + * + * Generated from protobuf field .google.bigtable.admin.v2.GcRule gc_rule = 1; + */ + protected $gc_rule = null; + /** + * The type of data stored in each of this family's cell values, including its + * full encoding. If omitted, the family only serves raw untyped bytes. + * For now, only the `Aggregate` type is supported. + * `Aggregate` can only be set at family creation and is immutable afterwards. + * If `value_type` is `Aggregate`, written data must be compatible with: + * * `value_type.input_type` for `AddInput` mutations + * + * Generated from protobuf field .google.bigtable.admin.v2.Type value_type = 3; + */ + protected $value_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\GcRule $gc_rule + * Garbage collection rule specified as a protobuf. + * Must serialize to at most 500 bytes. + * NOTE: Garbage collection executes opportunistically in the background, and + * so it's possible for reads to return a cell even if it matches the active + * GC expression for its family. + * @type \Google\Cloud\Bigtable\Admin\V2\Type $value_type + * The type of data stored in each of this family's cell values, including its + * full encoding. If omitted, the family only serves raw untyped bytes. + * For now, only the `Aggregate` type is supported. + * `Aggregate` can only be set at family creation and is immutable afterwards. + * If `value_type` is `Aggregate`, written data must be compatible with: + * * `value_type.input_type` for `AddInput` mutations + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Garbage collection rule specified as a protobuf. + * Must serialize to at most 500 bytes. + * NOTE: Garbage collection executes opportunistically in the background, and + * so it's possible for reads to return a cell even if it matches the active + * GC expression for its family. + * + * Generated from protobuf field .google.bigtable.admin.v2.GcRule gc_rule = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\GcRule|null + */ + public function getGcRule() + { + return $this->gc_rule; + } + + public function hasGcRule() + { + return isset($this->gc_rule); + } + + public function clearGcRule() + { + unset($this->gc_rule); + } + + /** + * Garbage collection rule specified as a protobuf. + * Must serialize to at most 500 bytes. + * NOTE: Garbage collection executes opportunistically in the background, and + * so it's possible for reads to return a cell even if it matches the active + * GC expression for its family. + * + * Generated from protobuf field .google.bigtable.admin.v2.GcRule gc_rule = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\GcRule $var + * @return $this + */ + public function setGcRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\GcRule::class); + $this->gc_rule = $var; + + return $this; + } + + /** + * The type of data stored in each of this family's cell values, including its + * full encoding. If omitted, the family only serves raw untyped bytes. + * For now, only the `Aggregate` type is supported. + * `Aggregate` can only be set at family creation and is immutable afterwards. + * If `value_type` is `Aggregate`, written data must be compatible with: + * * `value_type.input_type` for `AddInput` mutations + * + * Generated from protobuf field .google.bigtable.admin.v2.Type value_type = 3; + * @return \Google\Cloud\Bigtable\Admin\V2\Type|null + */ + public function getValueType() + { + return $this->value_type; + } + + public function hasValueType() + { + return isset($this->value_type); + } + + public function clearValueType() + { + unset($this->value_type); + } + + /** + * The type of data stored in each of this family's cell values, including its + * full encoding. If omitted, the family only serves raw untyped bytes. + * For now, only the `Aggregate` type is supported. + * `Aggregate` can only be set at family creation and is immutable afterwards. + * If `value_type` is `Aggregate`, written data must be compatible with: + * * `value_type.input_type` for `AddInput` mutations + * + * Generated from protobuf field .google.bigtable.admin.v2.Type value_type = 3; + * @param \Google\Cloud\Bigtable\Admin\V2\Type $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type::class); + $this->value_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CopyBackupMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CopyBackupMetadata.php new file mode 100644 index 000000000000..0efc355bd7d8 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CopyBackupMetadata.php @@ -0,0 +1,172 @@ +google.bigtable.admin.v2.CopyBackupMetadata + */ +class CopyBackupMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the backup being created through the copy operation. + * Values are of the form + * `projects//instances//clusters//backups/`. + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Information about the source backup that is being copied from. + * + * Generated from protobuf field .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + */ + protected $source_backup_info = null; + /** + * The progress of the + * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup] + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 3; + */ + protected $progress = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the backup being created through the copy operation. + * Values are of the form + * `projects//instances//clusters//backups/`. + * @type \Google\Cloud\Bigtable\Admin\V2\BackupInfo $source_backup_info + * Information about the source backup that is being copied from. + * @type \Google\Cloud\Bigtable\Admin\V2\OperationProgress $progress + * The progress of the + * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup] + * operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The name of the backup being created through the copy operation. + * Values are of the form + * `projects//instances//clusters//backups/`. + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the backup being created through the copy operation. + * Values are of the form + * `projects//instances//clusters//backups/`. + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Information about the source backup that is being copied from. + * + * Generated from protobuf field .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + * @return \Google\Cloud\Bigtable\Admin\V2\BackupInfo|null + */ + public function getSourceBackupInfo() + { + return $this->source_backup_info; + } + + public function hasSourceBackupInfo() + { + return isset($this->source_backup_info); + } + + public function clearSourceBackupInfo() + { + unset($this->source_backup_info); + } + + /** + * Information about the source backup that is being copied from. + * + * Generated from protobuf field .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + * @param \Google\Cloud\Bigtable\Admin\V2\BackupInfo $var + * @return $this + */ + public function setSourceBackupInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\BackupInfo::class); + $this->source_backup_info = $var; + + return $this; + } + + /** + * The progress of the + * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup] + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 3; + * @return \Google\Cloud\Bigtable\Admin\V2\OperationProgress|null + */ + public function getProgress() + { + return $this->progress; + } + + public function hasProgress() + { + return isset($this->progress); + } + + public function clearProgress() + { + unset($this->progress); + } + + /** + * The progress of the + * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup] + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 3; + * @param \Google\Cloud\Bigtable\Admin\V2\OperationProgress $var + * @return $this + */ + public function setProgress($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\OperationProgress::class); + $this->progress = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CopyBackupRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CopyBackupRequest.php new file mode 100644 index 000000000000..8f004b2b6ee0 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CopyBackupRequest.php @@ -0,0 +1,286 @@ +google.bigtable.admin.v2.CopyBackupRequest + */ +class CopyBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the destination cluster that will contain the backup + * copy. The cluster must already exist. Values are of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The id of the new backup. The `backup_id` along with `parent` + * are combined as {parent}/backups/{backup_id} to create the full backup + * name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_id = ''; + /** + * Required. The source backup to be copied from. + * The source backup needs to be in READY state for it to be copied. + * Copying a copied backup is not allowed. + * Once CopyBackup is in progress, the source backup cannot be deleted or + * cleaned up on expiration until CopyBackup is finished. + * Values are of the form: + * `projects//instances//clusters//backups/`. + * + * Generated from protobuf field string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $source_backup = ''; + /** + * Required. Required. The expiration time of the copied backup with + * microsecond granularity that must be at least 6 hours and at most 30 days + * from the time the request is received. Once the `expire_time` has + * passed, Cloud Bigtable will delete the backup and free the resources used + * by the backup. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $expire_time = null; + + /** + * @param string $parent Required. The name of the destination cluster that will contain the backup + * copy. The cluster must already exist. Values are of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. Please see + * {@see BigtableTableAdminClient::clusterName()} for help formatting this field. + * @param string $backupId Required. The id of the new backup. The `backup_id` along with `parent` + * are combined as {parent}/backups/{backup_id} to create the full backup + * name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * @param string $sourceBackup Required. The source backup to be copied from. + * The source backup needs to be in READY state for it to be copied. + * Copying a copied backup is not allowed. + * Once CopyBackup is in progress, the source backup cannot be deleted or + * cleaned up on expiration until CopyBackup is finished. + * Values are of the form: + * `projects//instances//clusters//backups/`. Please see + * {@see BigtableTableAdminClient::backupName()} for help formatting this field. + * @param \Google\Protobuf\Timestamp $expireTime Required. Required. The expiration time of the copied backup with + * microsecond granularity that must be at least 6 hours and at most 30 days + * from the time the request is received. Once the `expire_time` has + * passed, Cloud Bigtable will delete the backup and free the resources used + * by the backup. + * + * @return \Google\Cloud\Bigtable\Admin\V2\CopyBackupRequest + * + * @experimental + */ + public static function build(string $parent, string $backupId, string $sourceBackup, \Google\Protobuf\Timestamp $expireTime): self + { + return (new self()) + ->setParent($parent) + ->setBackupId($backupId) + ->setSourceBackup($sourceBackup) + ->setExpireTime($expireTime); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the destination cluster that will contain the backup + * copy. The cluster must already exist. Values are of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @type string $backup_id + * Required. The id of the new backup. The `backup_id` along with `parent` + * are combined as {parent}/backups/{backup_id} to create the full backup + * name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * @type string $source_backup + * Required. The source backup to be copied from. + * The source backup needs to be in READY state for it to be copied. + * Copying a copied backup is not allowed. + * Once CopyBackup is in progress, the source backup cannot be deleted or + * cleaned up on expiration until CopyBackup is finished. + * Values are of the form: + * `projects//instances//clusters//backups/`. + * @type \Google\Protobuf\Timestamp $expire_time + * Required. Required. The expiration time of the copied backup with + * microsecond granularity that must be at least 6 hours and at most 30 days + * from the time the request is received. Once the `expire_time` has + * passed, Cloud Bigtable will delete the backup and free the resources used + * by the backup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the destination cluster that will contain the backup + * copy. The cluster must already exist. Values are of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the destination cluster that will contain the backup + * copy. The cluster must already exist. Values are of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The id of the new backup. The `backup_id` along with `parent` + * are combined as {parent}/backups/{backup_id} to create the full backup + * name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupId() + { + return $this->backup_id; + } + + /** + * Required. The id of the new backup. The `backup_id` along with `parent` + * are combined as {parent}/backups/{backup_id} to create the full backup + * name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupId($var) + { + GPBUtil::checkString($var, True); + $this->backup_id = $var; + + return $this; + } + + /** + * Required. The source backup to be copied from. + * The source backup needs to be in READY state for it to be copied. + * Copying a copied backup is not allowed. + * Once CopyBackup is in progress, the source backup cannot be deleted or + * cleaned up on expiration until CopyBackup is finished. + * Values are of the form: + * `projects//instances//clusters//backups/`. + * + * Generated from protobuf field string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSourceBackup() + { + return $this->source_backup; + } + + /** + * Required. The source backup to be copied from. + * The source backup needs to be in READY state for it to be copied. + * Copying a copied backup is not allowed. + * Once CopyBackup is in progress, the source backup cannot be deleted or + * cleaned up on expiration until CopyBackup is finished. + * Values are of the form: + * `projects//instances//clusters//backups/`. + * + * Generated from protobuf field string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSourceBackup($var) + { + GPBUtil::checkString($var, True); + $this->source_backup = $var; + + return $this; + } + + /** + * Required. Required. The expiration time of the copied backup with + * microsecond granularity that must be at least 6 hours and at most 30 days + * from the time the request is received. Once the `expire_time` has + * passed, Cloud Bigtable will delete the backup and free the resources used + * by the backup. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Required. Required. The expiration time of the copied backup with + * microsecond granularity that must be at least 6 hours and at most 30 days + * from the time the request is received. Once the `expire_time` has + * passed, Cloud Bigtable will delete the backup and free the resources used + * by the backup. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateAppProfileRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateAppProfileRequest.php new file mode 100644 index 000000000000..12b67e4093aa --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateAppProfileRequest.php @@ -0,0 +1,217 @@ +google.bigtable.admin.v2.CreateAppProfileRequest + */ +class CreateAppProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the instance in which to create the new app + * profile. Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ID to be used when referring to the new app profile within + * its instance, e.g., just `myprofile` rather than + * `projects/myproject/instances/myinstance/appProfiles/myprofile`. + * + * Generated from protobuf field string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $app_profile_id = ''; + /** + * Required. The app profile to be created. + * Fields marked `OutputOnly` will be ignored. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $app_profile = null; + /** + * If true, ignore safety checks when creating the app profile. + * + * Generated from protobuf field bool ignore_warnings = 4; + */ + protected $ignore_warnings = false; + + /** + * @param string $parent Required. The unique name of the instance in which to create the new app + * profile. Values are of the form `projects/{project}/instances/{instance}`. Please see + * {@see BigtableInstanceAdminClient::instanceName()} for help formatting this field. + * @param string $appProfileId Required. The ID to be used when referring to the new app profile within + * its instance, e.g., just `myprofile` rather than + * `projects/myproject/instances/myinstance/appProfiles/myprofile`. + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile $appProfile Required. The app profile to be created. + * Fields marked `OutputOnly` will be ignored. + * + * @return \Google\Cloud\Bigtable\Admin\V2\CreateAppProfileRequest + * + * @experimental + */ + public static function build(string $parent, string $appProfileId, \Google\Cloud\Bigtable\Admin\V2\AppProfile $appProfile): self + { + return (new self()) + ->setParent($parent) + ->setAppProfileId($appProfileId) + ->setAppProfile($appProfile); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The unique name of the instance in which to create the new app + * profile. Values are of the form `projects/{project}/instances/{instance}`. + * @type string $app_profile_id + * Required. The ID to be used when referring to the new app profile within + * its instance, e.g., just `myprofile` rather than + * `projects/myproject/instances/myinstance/appProfiles/myprofile`. + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile $app_profile + * Required. The app profile to be created. + * Fields marked `OutputOnly` will be ignored. + * @type bool $ignore_warnings + * If true, ignore safety checks when creating the app profile. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the instance in which to create the new app + * profile. Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The unique name of the instance in which to create the new app + * profile. Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The ID to be used when referring to the new app profile within + * its instance, e.g., just `myprofile` rather than + * `projects/myproject/instances/myinstance/appProfiles/myprofile`. + * + * Generated from protobuf field string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * Required. The ID to be used when referring to the new app profile within + * its instance, e.g., just `myprofile` rather than + * `projects/myproject/instances/myinstance/appProfiles/myprofile`. + * + * Generated from protobuf field string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + + /** + * Required. The app profile to be created. + * Fields marked `OutputOnly` will be ignored. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile|null + */ + public function getAppProfile() + { + return $this->app_profile; + } + + public function hasAppProfile() + { + return isset($this->app_profile); + } + + public function clearAppProfile() + { + unset($this->app_profile); + } + + /** + * Required. The app profile to be created. + * Fields marked `OutputOnly` will be ignored. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile $var + * @return $this + */ + public function setAppProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AppProfile::class); + $this->app_profile = $var; + + return $this; + } + + /** + * If true, ignore safety checks when creating the app profile. + * + * Generated from protobuf field bool ignore_warnings = 4; + * @return bool + */ + public function getIgnoreWarnings() + { + return $this->ignore_warnings; + } + + /** + * If true, ignore safety checks when creating the app profile. + * + * Generated from protobuf field bool ignore_warnings = 4; + * @param bool $var + * @return $this + */ + public function setIgnoreWarnings($var) + { + GPBUtil::checkBool($var); + $this->ignore_warnings = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateAuthorizedViewMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateAuthorizedViewMetadata.php new file mode 100644 index 000000000000..e2172d832ac3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateAuthorizedViewMetadata.php @@ -0,0 +1,165 @@ +google.bigtable.admin.v2.CreateAuthorizedViewMetadata + */ +class CreateAuthorizedViewMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The request that prompted the initiation of this CreateInstance operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + protected $original_request = null; + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + */ + protected $request_time = null; + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + */ + protected $finish_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\CreateAuthorizedViewRequest $original_request + * The request that prompted the initiation of this CreateInstance operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The request that prompted the initiation of this CreateInstance operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\CreateAuthorizedViewRequest|null + */ + public function getOriginalRequest() + { + return $this->original_request; + } + + public function hasOriginalRequest() + { + return isset($this->original_request); + } + + public function clearOriginalRequest() + { + unset($this->original_request); + } + + /** + * The request that prompted the initiation of this CreateInstance operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\CreateAuthorizedViewRequest $var + * @return $this + */ + public function setOriginalRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\CreateAuthorizedViewRequest::class); + $this->original_request = $var; + + return $this; + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRequestTime() + { + return $this->request_time; + } + + public function hasRequestTime() + { + return isset($this->request_time); + } + + public function clearRequestTime() + { + unset($this->request_time); + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRequestTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->request_time = $var; + + return $this; + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFinishTime() + { + return $this->finish_time; + } + + public function hasFinishTime() + { + return isset($this->finish_time); + } + + public function clearFinishTime() + { + unset($this->finish_time); + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFinishTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->finish_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateAuthorizedViewRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateAuthorizedViewRequest.php new file mode 100644 index 000000000000..0329adcb6e04 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateAuthorizedViewRequest.php @@ -0,0 +1,189 @@ +google.bigtable.admin.v2.CreateAuthorizedViewRequest + */ +class CreateAuthorizedViewRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. This is the name of the table the AuthorizedView belongs to. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The id of the AuthorizedView to create. This AuthorizedView must + * not already exist. The `authorized_view_id` appended to `parent` forms the + * full AuthorizedView name of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. + * + * Generated from protobuf field string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $authorized_view_id = ''; + /** + * Required. The AuthorizedView to create. + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $authorized_view = null; + + /** + * @param string $parent Required. This is the name of the table the AuthorizedView belongs to. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. Please see + * {@see BigtableTableAdminClient::tableName()} for help formatting this field. + * @param \Google\Cloud\Bigtable\Admin\V2\AuthorizedView $authorizedView Required. The AuthorizedView to create. + * @param string $authorizedViewId Required. The id of the AuthorizedView to create. This AuthorizedView must + * not already exist. The `authorized_view_id` appended to `parent` forms the + * full AuthorizedView name of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. + * + * @return \Google\Cloud\Bigtable\Admin\V2\CreateAuthorizedViewRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Bigtable\Admin\V2\AuthorizedView $authorizedView, string $authorizedViewId): self + { + return (new self()) + ->setParent($parent) + ->setAuthorizedView($authorizedView) + ->setAuthorizedViewId($authorizedViewId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. This is the name of the table the AuthorizedView belongs to. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @type string $authorized_view_id + * Required. The id of the AuthorizedView to create. This AuthorizedView must + * not already exist. The `authorized_view_id` appended to `parent` forms the + * full AuthorizedView name of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. + * @type \Google\Cloud\Bigtable\Admin\V2\AuthorizedView $authorized_view + * Required. The AuthorizedView to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. This is the name of the table the AuthorizedView belongs to. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. This is the name of the table the AuthorizedView belongs to. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The id of the AuthorizedView to create. This AuthorizedView must + * not already exist. The `authorized_view_id` appended to `parent` forms the + * full AuthorizedView name of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. + * + * Generated from protobuf field string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAuthorizedViewId() + { + return $this->authorized_view_id; + } + + /** + * Required. The id of the AuthorizedView to create. This AuthorizedView must + * not already exist. The `authorized_view_id` appended to `parent` forms the + * full AuthorizedView name of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. + * + * Generated from protobuf field string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAuthorizedViewId($var) + { + GPBUtil::checkString($var, True); + $this->authorized_view_id = $var; + + return $this; + } + + /** + * Required. The AuthorizedView to create. + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\AuthorizedView|null + */ + public function getAuthorizedView() + { + return $this->authorized_view; + } + + public function hasAuthorizedView() + { + return isset($this->authorized_view); + } + + public function clearAuthorizedView() + { + unset($this->authorized_view); + } + + /** + * Required. The AuthorizedView to create. + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\AuthorizedView $var + * @return $this + */ + public function setAuthorizedView($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AuthorizedView::class); + $this->authorized_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateBackupMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateBackupMetadata.php new file mode 100644 index 000000000000..557de786e6de --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateBackupMetadata.php @@ -0,0 +1,190 @@ +google.bigtable.admin.v2.CreateBackupMetadata + */ +class CreateBackupMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the backup being created. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The name of the table the backup is created from. + * + * Generated from protobuf field string source_table = 2; + */ + protected $source_table = ''; + /** + * The time at which this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + */ + protected $start_time = null; + /** + * If set, the time at which this operation finished or was cancelled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 4; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the backup being created. + * @type string $source_table + * The name of the table the backup is created from. + * @type \Google\Protobuf\Timestamp $start_time + * The time at which this operation started. + * @type \Google\Protobuf\Timestamp $end_time + * If set, the time at which this operation finished or was cancelled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The name of the backup being created. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the backup being created. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The name of the table the backup is created from. + * + * Generated from protobuf field string source_table = 2; + * @return string + */ + public function getSourceTable() + { + return $this->source_table; + } + + /** + * The name of the table the backup is created from. + * + * Generated from protobuf field string source_table = 2; + * @param string $var + * @return $this + */ + public function setSourceTable($var) + { + GPBUtil::checkString($var, True); + $this->source_table = $var; + + return $this; + } + + /** + * The time at which this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The time at which this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * If set, the time at which this operation finished or was cancelled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * If set, the time at which this operation finished or was cancelled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateBackupRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateBackupRequest.php new file mode 100644 index 000000000000..8022a0ae61ec --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateBackupRequest.php @@ -0,0 +1,199 @@ +google.bigtable.admin.v2.CreateBackupRequest + */ +class CreateBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. This must be one of the clusters in the instance in which this + * table is located. The backup will be stored in this cluster. Values are + * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The id of the backup to be created. The `backup_id` along with + * the parent `parent` are combined as {parent}/backups/{backup_id} to create + * the full backup name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_id = ''; + /** + * Required. The backup to create. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup = null; + + /** + * @param string $parent Required. This must be one of the clusters in the instance in which this + * table is located. The backup will be stored in this cluster. Values are + * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. Please see + * {@see BigtableTableAdminClient::clusterName()} for help formatting this field. + * @param string $backupId Required. The id of the backup to be created. The `backup_id` along with + * the parent `parent` are combined as {parent}/backups/{backup_id} to create + * the full backup name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * @param \Google\Cloud\Bigtable\Admin\V2\Backup $backup Required. The backup to create. + * + * @return \Google\Cloud\Bigtable\Admin\V2\CreateBackupRequest + * + * @experimental + */ + public static function build(string $parent, string $backupId, \Google\Cloud\Bigtable\Admin\V2\Backup $backup): self + { + return (new self()) + ->setParent($parent) + ->setBackupId($backupId) + ->setBackup($backup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. This must be one of the clusters in the instance in which this + * table is located. The backup will be stored in this cluster. Values are + * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @type string $backup_id + * Required. The id of the backup to be created. The `backup_id` along with + * the parent `parent` are combined as {parent}/backups/{backup_id} to create + * the full backup name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * @type \Google\Cloud\Bigtable\Admin\V2\Backup $backup + * Required. The backup to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. This must be one of the clusters in the instance in which this + * table is located. The backup will be stored in this cluster. Values are + * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. This must be one of the clusters in the instance in which this + * table is located. The backup will be stored in this cluster. Values are + * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The id of the backup to be created. The `backup_id` along with + * the parent `parent` are combined as {parent}/backups/{backup_id} to create + * the full backup name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupId() + { + return $this->backup_id; + } + + /** + * Required. The id of the backup to be created. The `backup_id` along with + * the parent `parent` are combined as {parent}/backups/{backup_id} to create + * the full backup name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupId($var) + { + GPBUtil::checkString($var, True); + $this->backup_id = $var; + + return $this; + } + + /** + * Required. The backup to create. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\Backup|null + */ + public function getBackup() + { + return $this->backup; + } + + public function hasBackup() + { + return isset($this->backup); + } + + public function clearBackup() + { + unset($this->backup); + } + + /** + * Required. The backup to create. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\Backup $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Backup::class); + $this->backup = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterMetadata.php new file mode 100644 index 000000000000..c752a40618c5 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterMetadata.php @@ -0,0 +1,223 @@ +google.bigtable.admin.v2.CreateClusterMetadata + */ +class CreateClusterMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The request that prompted the initiation of this CreateCluster operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + */ + protected $original_request = null; + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + */ + protected $request_time = null; + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + */ + protected $finish_time = null; + /** + * Keys: the full `name` of each table that existed in the instance when + * CreateCluster was first called, i.e. + * `projects//instances//tables/`. Any table added + * to the instance by a later API call will be created in the new cluster by + * that API call, not this one. + * Values: information on how much of a table's data has been copied to the + * newly-created cluster so far. + * + * Generated from protobuf field map tables = 4; + */ + private $tables; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\CreateClusterRequest $original_request + * The request that prompted the initiation of this CreateCluster operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * @type array|\Google\Protobuf\Internal\MapField $tables + * Keys: the full `name` of each table that existed in the instance when + * CreateCluster was first called, i.e. + * `projects//instances//tables/
`. Any table added + * to the instance by a later API call will be created in the new cluster by + * that API call, not this one. + * Values: information on how much of a table's data has been copied to the + * newly-created cluster so far. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The request that prompted the initiation of this CreateCluster operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\CreateClusterRequest|null + */ + public function getOriginalRequest() + { + return $this->original_request; + } + + public function hasOriginalRequest() + { + return isset($this->original_request); + } + + public function clearOriginalRequest() + { + unset($this->original_request); + } + + /** + * The request that prompted the initiation of this CreateCluster operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\CreateClusterRequest $var + * @return $this + */ + public function setOriginalRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\CreateClusterRequest::class); + $this->original_request = $var; + + return $this; + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRequestTime() + { + return $this->request_time; + } + + public function hasRequestTime() + { + return isset($this->request_time); + } + + public function clearRequestTime() + { + unset($this->request_time); + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRequestTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->request_time = $var; + + return $this; + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFinishTime() + { + return $this->finish_time; + } + + public function hasFinishTime() + { + return isset($this->finish_time); + } + + public function clearFinishTime() + { + unset($this->finish_time); + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFinishTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->finish_time = $var; + + return $this; + } + + /** + * Keys: the full `name` of each table that existed in the instance when + * CreateCluster was first called, i.e. + * `projects//instances//tables/
`. Any table added + * to the instance by a later API call will be created in the new cluster by + * that API call, not this one. + * Values: information on how much of a table's data has been copied to the + * newly-created cluster so far. + * + * Generated from protobuf field map tables = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTables() + { + return $this->tables; + } + + /** + * Keys: the full `name` of each table that existed in the instance when + * CreateCluster was first called, i.e. + * `projects//instances//tables/
`. Any table added + * to the instance by a later API call will be created in the new cluster by + * that API call, not this one. + * Values: information on how much of a table's data has been copied to the + * newly-created cluster so far. + * + * Generated from protobuf field map tables = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTables($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata\TableProgress::class); + $this->tables = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterMetadata/TableProgress.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterMetadata/TableProgress.php new file mode 100644 index 000000000000..6fbf11f7cc3b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterMetadata/TableProgress.php @@ -0,0 +1,139 @@ +google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + */ +class TableProgress extends \Google\Protobuf\Internal\Message +{ + /** + * Estimate of the size of the table to be copied. + * + * Generated from protobuf field int64 estimated_size_bytes = 2; + */ + protected $estimated_size_bytes = 0; + /** + * Estimate of the number of bytes copied so far for this table. + * This will eventually reach 'estimated_size_bytes' unless the table copy + * is CANCELLED. + * + * Generated from protobuf field int64 estimated_copied_bytes = 3; + */ + protected $estimated_copied_bytes = 0; + /** + * Generated from protobuf field .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $estimated_size_bytes + * Estimate of the size of the table to be copied. + * @type int|string $estimated_copied_bytes + * Estimate of the number of bytes copied so far for this table. + * This will eventually reach 'estimated_size_bytes' unless the table copy + * is CANCELLED. + * @type int $state + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Estimate of the size of the table to be copied. + * + * Generated from protobuf field int64 estimated_size_bytes = 2; + * @return int|string + */ + public function getEstimatedSizeBytes() + { + return $this->estimated_size_bytes; + } + + /** + * Estimate of the size of the table to be copied. + * + * Generated from protobuf field int64 estimated_size_bytes = 2; + * @param int|string $var + * @return $this + */ + public function setEstimatedSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->estimated_size_bytes = $var; + + return $this; + } + + /** + * Estimate of the number of bytes copied so far for this table. + * This will eventually reach 'estimated_size_bytes' unless the table copy + * is CANCELLED. + * + * Generated from protobuf field int64 estimated_copied_bytes = 3; + * @return int|string + */ + public function getEstimatedCopiedBytes() + { + return $this->estimated_copied_bytes; + } + + /** + * Estimate of the number of bytes copied so far for this table. + * This will eventually reach 'estimated_size_bytes' unless the table copy + * is CANCELLED. + * + * Generated from protobuf field int64 estimated_copied_bytes = 3; + * @param int|string $var + * @return $this + */ + public function setEstimatedCopiedBytes($var) + { + GPBUtil::checkInt64($var); + $this->estimated_copied_bytes = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Generated from protobuf field .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata\TableProgress\State::class); + $this->state = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TableProgress::class, \Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata_TableProgress::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterMetadata/TableProgress/State.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterMetadata/TableProgress/State.php new file mode 100644 index 000000000000..f5fc34634589 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterMetadata/TableProgress/State.php @@ -0,0 +1,76 @@ +google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State + */ +class State +{ + /** + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The table has not yet begun copying to the new cluster. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The table is actively being copied to the new cluster. + * + * Generated from protobuf enum COPYING = 2; + */ + const COPYING = 2; + /** + * The table has been fully copied to the new cluster. + * + * Generated from protobuf enum COMPLETED = 3; + */ + const COMPLETED = 3; + /** + * The table was deleted before it finished copying to the new cluster. + * Note that tables deleted after completion will stay marked as + * COMPLETED, not CANCELLED. + * + * Generated from protobuf enum CANCELLED = 4; + */ + const CANCELLED = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::COPYING => 'COPYING', + self::COMPLETED => 'COMPLETED', + self::CANCELLED => 'CANCELLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata_TableProgress_State::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterRequest.php new file mode 100644 index 000000000000..8a849b579320 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateClusterRequest.php @@ -0,0 +1,183 @@ +google.bigtable.admin.v2.CreateClusterRequest + */ +class CreateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the instance in which to create the new + * cluster. Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ID to be used when referring to the new cluster within its + * instance, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. The cluster to be created. + * Fields marked `OutputOnly` must be left blank. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = null; + + /** + * @param string $parent Required. The unique name of the instance in which to create the new + * cluster. Values are of the form `projects/{project}/instances/{instance}`. Please see + * {@see BigtableInstanceAdminClient::instanceName()} for help formatting this field. + * @param string $clusterId Required. The ID to be used when referring to the new cluster within its + * instance, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * @param \Google\Cloud\Bigtable\Admin\V2\Cluster $cluster Required. The cluster to be created. + * Fields marked `OutputOnly` must be left blank. + * + * @return \Google\Cloud\Bigtable\Admin\V2\CreateClusterRequest + * + * @experimental + */ + public static function build(string $parent, string $clusterId, \Google\Cloud\Bigtable\Admin\V2\Cluster $cluster): self + { + return (new self()) + ->setParent($parent) + ->setClusterId($clusterId) + ->setCluster($cluster); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The unique name of the instance in which to create the new + * cluster. Values are of the form `projects/{project}/instances/{instance}`. + * @type string $cluster_id + * Required. The ID to be used when referring to the new cluster within its + * instance, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * @type \Google\Cloud\Bigtable\Admin\V2\Cluster $cluster + * Required. The cluster to be created. + * Fields marked `OutputOnly` must be left blank. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the instance in which to create the new + * cluster. Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The unique name of the instance in which to create the new + * cluster. Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The ID to be used when referring to the new cluster within its + * instance, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. The ID to be used when referring to the new cluster within its + * instance, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. The cluster to be created. + * Fields marked `OutputOnly` must be left blank. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The cluster to be created. + * Fields marked `OutputOnly` must be left blank. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Cluster::class); + $this->cluster = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateInstanceMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateInstanceMetadata.php new file mode 100644 index 000000000000..dd7f505c0775 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateInstanceMetadata.php @@ -0,0 +1,165 @@ +google.bigtable.admin.v2.CreateInstanceMetadata + */ +class CreateInstanceMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The request that prompted the initiation of this CreateInstance operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + */ + protected $original_request = null; + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + */ + protected $request_time = null; + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + */ + protected $finish_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\CreateInstanceRequest $original_request + * The request that prompted the initiation of this CreateInstance operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The request that prompted the initiation of this CreateInstance operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\CreateInstanceRequest|null + */ + public function getOriginalRequest() + { + return $this->original_request; + } + + public function hasOriginalRequest() + { + return isset($this->original_request); + } + + public function clearOriginalRequest() + { + unset($this->original_request); + } + + /** + * The request that prompted the initiation of this CreateInstance operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\CreateInstanceRequest $var + * @return $this + */ + public function setOriginalRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\CreateInstanceRequest::class); + $this->original_request = $var; + + return $this; + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRequestTime() + { + return $this->request_time; + } + + public function hasRequestTime() + { + return isset($this->request_time); + } + + public function clearRequestTime() + { + unset($this->request_time); + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRequestTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->request_time = $var; + + return $this; + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFinishTime() + { + return $this->finish_time; + } + + public function hasFinishTime() + { + return isset($this->finish_time); + } + + public function clearFinishTime() + { + unset($this->finish_time); + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFinishTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->finish_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateInstanceRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateInstanceRequest.php new file mode 100644 index 000000000000..7af92a99c778 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateInstanceRequest.php @@ -0,0 +1,239 @@ +google.bigtable.admin.v2.CreateInstanceRequest + */ +class CreateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the project in which to create the new + * instance. Values are of the form `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ID to be used when referring to the new instance within its + * project, e.g., just `myinstance` rather than + * `projects/myproject/instances/myinstance`. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_id = ''; + /** + * Required. The instance to create. + * Fields marked `OutputOnly` must be left blank. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = null; + /** + * Required. The clusters to be created within the instance, mapped by desired + * cluster ID, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * Fields marked `OutputOnly` must be left blank. + * Currently, at most four clusters can be specified. + * + * Generated from protobuf field map clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $clusters; + + /** + * @param string $parent Required. The unique name of the project in which to create the new + * instance. Values are of the form `projects/{project}`. Please see + * {@see BigtableInstanceAdminClient::projectName()} for help formatting this field. + * @param string $instanceId Required. The ID to be used when referring to the new instance within its + * project, e.g., just `myinstance` rather than + * `projects/myproject/instances/myinstance`. + * @param \Google\Cloud\Bigtable\Admin\V2\Instance $instance Required. The instance to create. + * Fields marked `OutputOnly` must be left blank. + * @param array $clusters Required. The clusters to be created within the instance, mapped by desired + * cluster ID, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * Fields marked `OutputOnly` must be left blank. + * Currently, at most four clusters can be specified. + * + * @return \Google\Cloud\Bigtable\Admin\V2\CreateInstanceRequest + * + * @experimental + */ + public static function build(string $parent, string $instanceId, \Google\Cloud\Bigtable\Admin\V2\Instance $instance, array $clusters): self + { + return (new self()) + ->setParent($parent) + ->setInstanceId($instanceId) + ->setInstance($instance) + ->setClusters($clusters); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The unique name of the project in which to create the new + * instance. Values are of the form `projects/{project}`. + * @type string $instance_id + * Required. The ID to be used when referring to the new instance within its + * project, e.g., just `myinstance` rather than + * `projects/myproject/instances/myinstance`. + * @type \Google\Cloud\Bigtable\Admin\V2\Instance $instance + * Required. The instance to create. + * Fields marked `OutputOnly` must be left blank. + * @type array|\Google\Protobuf\Internal\MapField $clusters + * Required. The clusters to be created within the instance, mapped by desired + * cluster ID, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * Fields marked `OutputOnly` must be left blank. + * Currently, at most four clusters can be specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the project in which to create the new + * instance. Values are of the form `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The unique name of the project in which to create the new + * instance. Values are of the form `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The ID to be used when referring to the new instance within its + * project, e.g., just `myinstance` rather than + * `projects/myproject/instances/myinstance`. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Required. The ID to be used when referring to the new instance within its + * project, e.g., just `myinstance` rather than + * `projects/myproject/instances/myinstance`. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Required. The instance to create. + * Fields marked `OutputOnly` must be left blank. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The instance to create. + * Fields marked `OutputOnly` must be left blank. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Instance::class); + $this->instance = $var; + + return $this; + } + + /** + * Required. The clusters to be created within the instance, mapped by desired + * cluster ID, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * Fields marked `OutputOnly` must be left blank. + * Currently, at most four clusters can be specified. + * + * Generated from protobuf field map clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getClusters() + { + return $this->clusters; + } + + /** + * Required. The clusters to be created within the instance, mapped by desired + * cluster ID, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * Fields marked `OutputOnly` must be left blank. + * Currently, at most four clusters can be specified. + * + * Generated from protobuf field map clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setClusters($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Cluster::class); + $this->clusters = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableFromSnapshotMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableFromSnapshotMetadata.php new file mode 100644 index 000000000000..ad6178e78b9b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableFromSnapshotMetadata.php @@ -0,0 +1,173 @@ +google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + */ +class CreateTableFromSnapshotMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The request that prompted the initiation of this CreateTableFromSnapshot + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + */ + protected $original_request = null; + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + */ + protected $request_time = null; + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + */ + protected $finish_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\CreateTableFromSnapshotRequest $original_request + * The request that prompted the initiation of this CreateTableFromSnapshot + * operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The request that prompted the initiation of this CreateTableFromSnapshot + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\CreateTableFromSnapshotRequest|null + */ + public function getOriginalRequest() + { + return $this->original_request; + } + + public function hasOriginalRequest() + { + return isset($this->original_request); + } + + public function clearOriginalRequest() + { + unset($this->original_request); + } + + /** + * The request that prompted the initiation of this CreateTableFromSnapshot + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\CreateTableFromSnapshotRequest $var + * @return $this + */ + public function setOriginalRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\CreateTableFromSnapshotRequest::class); + $this->original_request = $var; + + return $this; + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRequestTime() + { + return $this->request_time; + } + + public function hasRequestTime() + { + return isset($this->request_time); + } + + public function clearRequestTime() + { + unset($this->request_time); + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRequestTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->request_time = $var; + + return $this; + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFinishTime() + { + return $this->finish_time; + } + + public function hasFinishTime() + { + return isset($this->finish_time); + } + + public function clearFinishTime() + { + unset($this->finish_time); + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFinishTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->finish_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableFromSnapshotRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableFromSnapshotRequest.php new file mode 100644 index 000000000000..2dfa7bc94901 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableFromSnapshotRequest.php @@ -0,0 +1,184 @@ +google.bigtable.admin.v2.CreateTableFromSnapshotRequest + */ +class CreateTableFromSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table_id = ''; + /** + * Required. The unique name of the snapshot from which to restore the table. + * The snapshot and the table must be in the same instance. Values are of the + * form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $source_snapshot = ''; + + /** + * @param string $parent Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. Please see + * {@see BigtableTableAdminClient::instanceName()} for help formatting this field. + * @param string $tableId Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * @param string $sourceSnapshot Required. The unique name of the snapshot from which to restore the table. + * The snapshot and the table must be in the same instance. Values are of the + * form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. Please see + * {@see BigtableTableAdminClient::snapshotName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\CreateTableFromSnapshotRequest + * + * @experimental + */ + public static function build(string $parent, string $tableId, string $sourceSnapshot): self + { + return (new self()) + ->setParent($parent) + ->setTableId($tableId) + ->setSourceSnapshot($sourceSnapshot); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + * @type string $table_id + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * @type string $source_snapshot + * Required. The unique name of the snapshot from which to restore the table. + * The snapshot and the table must be in the same instance. Values are of the + * form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTableId() + { + return $this->table_id; + } + + /** + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTableId($var) + { + GPBUtil::checkString($var, True); + $this->table_id = $var; + + return $this; + } + + /** + * Required. The unique name of the snapshot from which to restore the table. + * The snapshot and the table must be in the same instance. Values are of the + * form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSourceSnapshot() + { + return $this->source_snapshot; + } + + /** + * Required. The unique name of the snapshot from which to restore the table. + * The snapshot and the table must be in the same instance. Values are of the + * form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSourceSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->source_snapshot = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableRequest.php new file mode 100644 index 000000000000..06608297cf48 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableRequest.php @@ -0,0 +1,265 @@ +google.bigtable.admin.v2.CreateTableRequest + */ +class CreateTableRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * Maximum 50 characters. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table_id = ''; + /** + * Required. The Table to create. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table = null; + /** + * The optional list of row keys that will be used to initially split the + * table into several tablets (tablets are similar to HBase regions). + * Given two split keys, `s1` and `s2`, three tablets will be created, + * spanning the key ranges: `[, s1), [s1, s2), [s2, )`. + * Example: + * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` + * `"other", "zz"]` + * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` + * * Key assignment: + * - Tablet 1 `[, apple) => {"a"}.` + * - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` + * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` + * - Tablet 4 `[customer_2, other) => {"customer_2"}.` + * - Tablet 5 `[other, ) => {"other", "zz"}.` + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + private $initial_splits; + + /** + * @param string $parent Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. Please see + * {@see BigtableTableAdminClient::instanceName()} for help formatting this field. + * @param string $tableId Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * Maximum 50 characters. + * @param \Google\Cloud\Bigtable\Admin\V2\Table $table Required. The Table to create. + * + * @return \Google\Cloud\Bigtable\Admin\V2\CreateTableRequest + * + * @experimental + */ + public static function build(string $parent, string $tableId, \Google\Cloud\Bigtable\Admin\V2\Table $table): self + { + return (new self()) + ->setParent($parent) + ->setTableId($tableId) + ->setTable($table); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + * @type string $table_id + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * Maximum 50 characters. + * @type \Google\Cloud\Bigtable\Admin\V2\Table $table + * Required. The Table to create. + * @type array<\Google\Cloud\Bigtable\Admin\V2\CreateTableRequest\Split>|\Google\Protobuf\Internal\RepeatedField $initial_splits + * The optional list of row keys that will be used to initially split the + * table into several tablets (tablets are similar to HBase regions). + * Given two split keys, `s1` and `s2`, three tablets will be created, + * spanning the key ranges: `[, s1), [s1, s2), [s2, )`. + * Example: + * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` + * `"other", "zz"]` + * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` + * * Key assignment: + * - Tablet 1 `[, apple) => {"a"}.` + * - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` + * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` + * - Tablet 4 `[customer_2, other) => {"customer_2"}.` + * - Tablet 5 `[other, ) => {"other", "zz"}.` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * Maximum 50 characters. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTableId() + { + return $this->table_id; + } + + /** + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * Maximum 50 characters. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTableId($var) + { + GPBUtil::checkString($var, True); + $this->table_id = $var; + + return $this; + } + + /** + * Required. The Table to create. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\Table|null + */ + public function getTable() + { + return $this->table; + } + + public function hasTable() + { + return isset($this->table); + } + + public function clearTable() + { + unset($this->table); + } + + /** + * Required. The Table to create. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\Table $var + * @return $this + */ + public function setTable($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Table::class); + $this->table = $var; + + return $this; + } + + /** + * The optional list of row keys that will be used to initially split the + * table into several tablets (tablets are similar to HBase regions). + * Given two split keys, `s1` and `s2`, three tablets will be created, + * spanning the key ranges: `[, s1), [s1, s2), [s2, )`. + * Example: + * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` + * `"other", "zz"]` + * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` + * * Key assignment: + * - Tablet 1 `[, apple) => {"a"}.` + * - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` + * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` + * - Tablet 4 `[customer_2, other) => {"customer_2"}.` + * - Tablet 5 `[other, ) => {"other", "zz"}.` + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInitialSplits() + { + return $this->initial_splits; + } + + /** + * The optional list of row keys that will be used to initially split the + * table into several tablets (tablets are similar to HBase regions). + * Given two split keys, `s1` and `s2`, three tablets will be created, + * spanning the key ranges: `[, s1), [s1, s2), [s2, )`. + * Example: + * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` + * `"other", "zz"]` + * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` + * * Key assignment: + * - Tablet 1 `[, apple) => {"a"}.` + * - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` + * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` + * - Tablet 4 `[customer_2, other) => {"customer_2"}.` + * - Tablet 5 `[other, ) => {"other", "zz"}.` + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + * @param array<\Google\Cloud\Bigtable\Admin\V2\CreateTableRequest\Split>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInitialSplits($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\CreateTableRequest\Split::class); + $this->initial_splits = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableRequest/Split.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableRequest/Split.php new file mode 100644 index 000000000000..af1990b8531e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/CreateTableRequest/Split.php @@ -0,0 +1,70 @@ +google.bigtable.admin.v2.CreateTableRequest.Split + */ +class Split extends \Google\Protobuf\Internal\Message +{ + /** + * Row key to use as an initial tablet boundary. + * + * Generated from protobuf field bytes key = 1; + */ + protected $key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Row key to use as an initial tablet boundary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Row key to use as an initial tablet boundary. + * + * Generated from protobuf field bytes key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Row key to use as an initial tablet boundary. + * + * Generated from protobuf field bytes key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, False); + $this->key = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Split::class, \Google\Cloud\Bigtable\Admin\V2\CreateTableRequest_Split::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DataBoostReadLocalWrites.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DataBoostReadLocalWrites.php new file mode 100644 index 000000000000..6d8e2927312c --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DataBoostReadLocalWrites.php @@ -0,0 +1,34 @@ +google.bigtable.admin.v2.DataBoostReadLocalWrites + */ +class DataBoostReadLocalWrites extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteAppProfileRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteAppProfileRequest.php new file mode 100644 index 000000000000..d5e04caa49fc --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteAppProfileRequest.php @@ -0,0 +1,125 @@ +google.bigtable.admin.v2.DeleteAppProfileRequest + */ +class DeleteAppProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the app profile to be deleted. Values are of + * the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. If true, ignore safety checks when deleting the app profile. + * + * Generated from protobuf field bool ignore_warnings = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ignore_warnings = false; + + /** + * @param string $name Required. The unique name of the app profile to be deleted. Values are of + * the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. Please see + * {@see BigtableInstanceAdminClient::appProfileName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\DeleteAppProfileRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the app profile to be deleted. Values are of + * the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * @type bool $ignore_warnings + * Required. If true, ignore safety checks when deleting the app profile. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the app profile to be deleted. Values are of + * the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the app profile to be deleted. Values are of + * the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. If true, ignore safety checks when deleting the app profile. + * + * Generated from protobuf field bool ignore_warnings = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getIgnoreWarnings() + { + return $this->ignore_warnings; + } + + /** + * Required. If true, ignore safety checks when deleting the app profile. + * + * Generated from protobuf field bool ignore_warnings = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setIgnoreWarnings($var) + { + GPBUtil::checkBool($var); + $this->ignore_warnings = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteAuthorizedViewRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteAuthorizedViewRequest.php new file mode 100644 index 000000000000..e623fe8ebb9d --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteAuthorizedViewRequest.php @@ -0,0 +1,138 @@ +google.bigtable.admin.v2.DeleteAuthorizedViewRequest + */ +class DeleteAuthorizedViewRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the AuthorizedView to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The current etag of the AuthorizedView. + * If an etag is provided and does not match the current etag of the + * AuthorizedView, deletion will be blocked and an ABORTED error will be + * returned. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * @param string $name Required. The unique name of the AuthorizedView to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. Please see + * {@see BigtableTableAdminClient::authorizedViewName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\DeleteAuthorizedViewRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the AuthorizedView to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * @type string $etag + * Optional. The current etag of the AuthorizedView. + * If an etag is provided and does not match the current etag of the + * AuthorizedView, deletion will be blocked and an ABORTED error will be + * returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the AuthorizedView to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the AuthorizedView to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The current etag of the AuthorizedView. + * If an etag is provided and does not match the current etag of the + * AuthorizedView, deletion will be blocked and an ABORTED error will be + * returned. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the AuthorizedView. + * If an etag is provided and does not match the current etag of the + * AuthorizedView, deletion will be blocked and an ABORTED error will be + * returned. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteBackupRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteBackupRequest.php new file mode 100644 index 000000000000..6bd500313c94 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteBackupRequest.php @@ -0,0 +1,92 @@ +google.bigtable.admin.v2.DeleteBackupRequest + */ +class DeleteBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backup to delete. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the backup to delete. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. Please see + * {@see BigtableTableAdminClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\DeleteBackupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the backup to delete. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backup to delete. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the backup to delete. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteClusterRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteClusterRequest.php new file mode 100644 index 000000000000..690cdb21a15f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteClusterRequest.php @@ -0,0 +1,86 @@ +google.bigtable.admin.v2.DeleteClusterRequest + */ +class DeleteClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the cluster to be deleted. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique name of the cluster to be deleted. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. Please see + * {@see BigtableInstanceAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\DeleteClusterRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the cluster to be deleted. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the cluster to be deleted. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the cluster to be deleted. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteInstanceRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteInstanceRequest.php new file mode 100644 index 000000000000..bcbc1c1a1e58 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteInstanceRequest.php @@ -0,0 +1,86 @@ +google.bigtable.admin.v2.DeleteInstanceRequest + */ +class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the instance to be deleted. + * Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique name of the instance to be deleted. + * Values are of the form `projects/{project}/instances/{instance}`. Please see + * {@see BigtableInstanceAdminClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\DeleteInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the instance to be deleted. + * Values are of the form `projects/{project}/instances/{instance}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the instance to be deleted. + * Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the instance to be deleted. + * Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteSnapshotRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteSnapshotRequest.php new file mode 100644 index 000000000000..b83ec8b2043b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteSnapshotRequest.php @@ -0,0 +1,96 @@ +google.bigtable.admin.v2.DeleteSnapshotRequest + */ +class DeleteSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the snapshot to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique name of the snapshot to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. Please see + * {@see BigtableTableAdminClient::snapshotName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\DeleteSnapshotRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the snapshot to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the snapshot to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the snapshot to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteTableRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteTableRequest.php new file mode 100644 index 000000000000..3bd4eac51dc3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DeleteTableRequest.php @@ -0,0 +1,92 @@ +google.bigtable.admin.v2.DeleteTableRequest + */ +class DeleteTableRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the table to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique name of the table to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. Please see + * {@see BigtableTableAdminClient::tableName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\DeleteTableRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the table to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the table to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the table to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DropRowRangeRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DropRowRangeRequest.php new file mode 100644 index 000000000000..a005c44024c4 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/DropRowRangeRequest.php @@ -0,0 +1,154 @@ +google.bigtable.admin.v2.DropRowRangeRequest + */ +class DropRowRangeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the table on which to drop a range of rows. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + protected $target; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the table on which to drop a range of rows. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @type string $row_key_prefix + * Delete all rows that start with this row key prefix. Prefix cannot be + * zero length. + * @type bool $delete_all_data_from_table + * Delete all rows in the table. Setting this to false is a no-op. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the table on which to drop a range of rows. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the table on which to drop a range of rows. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Delete all rows that start with this row key prefix. Prefix cannot be + * zero length. + * + * Generated from protobuf field bytes row_key_prefix = 2; + * @return string + */ + public function getRowKeyPrefix() + { + return $this->readOneof(2); + } + + public function hasRowKeyPrefix() + { + return $this->hasOneof(2); + } + + /** + * Delete all rows that start with this row key prefix. Prefix cannot be + * zero length. + * + * Generated from protobuf field bytes row_key_prefix = 2; + * @param string $var + * @return $this + */ + public function setRowKeyPrefix($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Delete all rows in the table. Setting this to false is a no-op. + * + * Generated from protobuf field bool delete_all_data_from_table = 3; + * @return bool + */ + public function getDeleteAllDataFromTable() + { + return $this->readOneof(3); + } + + public function hasDeleteAllDataFromTable() + { + return $this->hasOneof(3); + } + + /** + * Delete all rows in the table. Setting this to false is a no-op. + * + * Generated from protobuf field bool delete_all_data_from_table = 3; + * @param bool $var + * @return $this + */ + public function setDeleteAllDataFromTable($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getTarget() + { + return $this->whichOneof("target"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/EncryptionInfo.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/EncryptionInfo.php new file mode 100644 index 000000000000..d13861cd38e2 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/EncryptionInfo.php @@ -0,0 +1,160 @@ +google.bigtable.admin.v2.EncryptionInfo + */ +class EncryptionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The type of encryption used to protect this resource. + * + * Generated from protobuf field .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_type = 0; + /** + * Output only. The status of encrypt/decrypt calls on underlying data for + * this resource. Regardless of status, the existing data is always encrypted + * at rest. + * + * Generated from protobuf field .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_status = null; + /** + * Output only. The version of the Cloud KMS key specified in the parent + * cluster that is in use for the data underlying this table. + * + * Generated from protobuf field string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $kms_key_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $encryption_type + * Output only. The type of encryption used to protect this resource. + * @type \Google\Rpc\Status $encryption_status + * Output only. The status of encrypt/decrypt calls on underlying data for + * this resource. Regardless of status, the existing data is always encrypted + * at rest. + * @type string $kms_key_version + * Output only. The version of the Cloud KMS key specified in the parent + * cluster that is in use for the data underlying this table. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The type of encryption used to protect this resource. + * + * Generated from protobuf field .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getEncryptionType() + { + return $this->encryption_type; + } + + /** + * Output only. The type of encryption used to protect this resource. + * + * Generated from protobuf field .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setEncryptionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\EncryptionInfo\EncryptionType::class); + $this->encryption_type = $var; + + return $this; + } + + /** + * Output only. The status of encrypt/decrypt calls on underlying data for + * this resource. Regardless of status, the existing data is always encrypted + * at rest. + * + * Generated from protobuf field .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getEncryptionStatus() + { + return $this->encryption_status; + } + + public function hasEncryptionStatus() + { + return isset($this->encryption_status); + } + + public function clearEncryptionStatus() + { + unset($this->encryption_status); + } + + /** + * Output only. The status of encrypt/decrypt calls on underlying data for + * this resource. Regardless of status, the existing data is always encrypted + * at rest. + * + * Generated from protobuf field .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setEncryptionStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->encryption_status = $var; + + return $this; + } + + /** + * Output only. The version of the Cloud KMS key specified in the parent + * cluster that is in use for the data underlying this table. + * + * Generated from protobuf field string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getKmsKeyVersion() + { + return $this->kms_key_version; + } + + /** + * Output only. The version of the Cloud KMS key specified in the parent + * cluster that is in use for the data underlying this table. + * + * Generated from protobuf field string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setKmsKeyVersion($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/EncryptionInfo/EncryptionType.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/EncryptionInfo/EncryptionType.php new file mode 100644 index 000000000000..076657b976c4 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/EncryptionInfo/EncryptionType.php @@ -0,0 +1,72 @@ +google.bigtable.admin.v2.EncryptionInfo.EncryptionType + */ +class EncryptionType +{ + /** + * Encryption type was not specified, though data at rest remains encrypted. + * + * Generated from protobuf enum ENCRYPTION_TYPE_UNSPECIFIED = 0; + */ + const ENCRYPTION_TYPE_UNSPECIFIED = 0; + /** + * The data backing this resource is encrypted at rest with a key that is + * fully managed by Google. No key version or status will be populated. + * This is the default state. + * + * Generated from protobuf enum GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + const GOOGLE_DEFAULT_ENCRYPTION = 1; + /** + * The data backing this resource is encrypted at rest with a key that is + * managed by the customer. + * The in-use version of the key and its status are populated for + * CMEK-protected tables. + * CMEK-protected backups are pinned to the key version that was in use at + * the time the backup was taken. This key version is populated but its + * status is not tracked and is reported as `UNKNOWN`. + * + * Generated from protobuf enum CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + const CUSTOMER_MANAGED_ENCRYPTION = 2; + + private static $valueToName = [ + self::ENCRYPTION_TYPE_UNSPECIFIED => 'ENCRYPTION_TYPE_UNSPECIFIED', + self::GOOGLE_DEFAULT_ENCRYPTION => 'GOOGLE_DEFAULT_ENCRYPTION', + self::CUSTOMER_MANAGED_ENCRYPTION => 'CUSTOMER_MANAGED_ENCRYPTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EncryptionType::class, \Google\Cloud\Bigtable\Admin\V2\EncryptionInfo_EncryptionType::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GcRule.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GcRule.php new file mode 100644 index 000000000000..58f3cb15f627 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GcRule.php @@ -0,0 +1,180 @@ +google.bigtable.admin.v2.GcRule + */ +class GcRule extends \Google\Protobuf\Internal\Message +{ + protected $rule; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_num_versions + * Delete all cells in a column except the most recent N. + * @type \Google\Protobuf\Duration $max_age + * Delete cells in a column older than the given age. + * Values must be at least one millisecond, and will be truncated to + * microsecond granularity. + * @type \Google\Cloud\Bigtable\Admin\V2\GcRule\Intersection $intersection + * Delete cells that would be deleted by every nested rule. + * @type \Google\Cloud\Bigtable\Admin\V2\GcRule\Union $union + * Delete cells that would be deleted by any nested rule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Delete all cells in a column except the most recent N. + * + * Generated from protobuf field int32 max_num_versions = 1; + * @return int + */ + public function getMaxNumVersions() + { + return $this->readOneof(1); + } + + public function hasMaxNumVersions() + { + return $this->hasOneof(1); + } + + /** + * Delete all cells in a column except the most recent N. + * + * Generated from protobuf field int32 max_num_versions = 1; + * @param int $var + * @return $this + */ + public function setMaxNumVersions($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Delete cells in a column older than the given age. + * Values must be at least one millisecond, and will be truncated to + * microsecond granularity. + * + * Generated from protobuf field .google.protobuf.Duration max_age = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxAge() + { + return $this->readOneof(2); + } + + public function hasMaxAge() + { + return $this->hasOneof(2); + } + + /** + * Delete cells in a column older than the given age. + * Values must be at least one millisecond, and will be truncated to + * microsecond granularity. + * + * Generated from protobuf field .google.protobuf.Duration max_age = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxAge($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Delete cells that would be deleted by every nested rule. + * + * Generated from protobuf field .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + * @return \Google\Cloud\Bigtable\Admin\V2\GcRule\Intersection|null + */ + public function getIntersection() + { + return $this->readOneof(3); + } + + public function hasIntersection() + { + return $this->hasOneof(3); + } + + /** + * Delete cells that would be deleted by every nested rule. + * + * Generated from protobuf field .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + * @param \Google\Cloud\Bigtable\Admin\V2\GcRule\Intersection $var + * @return $this + */ + public function setIntersection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\GcRule\Intersection::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Delete cells that would be deleted by any nested rule. + * + * Generated from protobuf field .google.bigtable.admin.v2.GcRule.Union union = 4; + * @return \Google\Cloud\Bigtable\Admin\V2\GcRule\Union|null + */ + public function getUnion() + { + return $this->readOneof(4); + } + + public function hasUnion() + { + return $this->hasOneof(4); + } + + /** + * Delete cells that would be deleted by any nested rule. + * + * Generated from protobuf field .google.bigtable.admin.v2.GcRule.Union union = 4; + * @param \Google\Cloud\Bigtable\Admin\V2\GcRule\Union $var + * @return $this + */ + public function setUnion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\GcRule\Union::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getRule() + { + return $this->whichOneof("rule"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GcRule/Intersection.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GcRule/Intersection.php new file mode 100644 index 000000000000..3cdcac56ac62 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GcRule/Intersection.php @@ -0,0 +1,70 @@ +google.bigtable.admin.v2.GcRule.Intersection + */ +class Intersection extends \Google\Protobuf\Internal\Message +{ + /** + * Only delete cells which would be deleted by every element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + private $rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\Admin\V2\GcRule>|\Google\Protobuf\Internal\RepeatedField $rules + * Only delete cells which would be deleted by every element of `rules`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Only delete cells which would be deleted by every element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * Only delete cells which would be deleted by every element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + * @param array<\Google\Cloud\Bigtable\Admin\V2\GcRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\GcRule::class); + $this->rules = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Intersection::class, \Google\Cloud\Bigtable\Admin\V2\GcRule_Intersection::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GcRule/Union.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GcRule/Union.php new file mode 100644 index 000000000000..0569197be3ac --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GcRule/Union.php @@ -0,0 +1,70 @@ +google.bigtable.admin.v2.GcRule.Union + */ +class Union extends \Google\Protobuf\Internal\Message +{ + /** + * Delete cells which would be deleted by any element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + private $rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\Admin\V2\GcRule>|\Google\Protobuf\Internal\RepeatedField $rules + * Delete cells which would be deleted by any element of `rules`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Delete cells which would be deleted by any element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * Delete cells which would be deleted by any element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + * @param array<\Google\Cloud\Bigtable\Admin\V2\GcRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\GcRule::class); + $this->rules = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Union::class, \Google\Cloud\Bigtable\Admin\V2\GcRule_Union::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GenerateConsistencyTokenRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GenerateConsistencyTokenRequest.php new file mode 100644 index 000000000000..de27631825e5 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GenerateConsistencyTokenRequest.php @@ -0,0 +1,92 @@ +google.bigtable.admin.v2.GenerateConsistencyTokenRequest + */ +class GenerateConsistencyTokenRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the Table for which to create a consistency + * token. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique name of the Table for which to create a consistency + * token. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. Please see + * {@see BigtableTableAdminClient::tableName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\GenerateConsistencyTokenRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the Table for which to create a consistency + * token. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the Table for which to create a consistency + * token. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the Table for which to create a consistency + * token. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GenerateConsistencyTokenResponse.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GenerateConsistencyTokenResponse.php new file mode 100644 index 000000000000..6b02098b9ffc --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GenerateConsistencyTokenResponse.php @@ -0,0 +1,68 @@ +google.bigtable.admin.v2.GenerateConsistencyTokenResponse + */ +class GenerateConsistencyTokenResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The generated consistency token. + * + * Generated from protobuf field string consistency_token = 1; + */ + protected $consistency_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $consistency_token + * The generated consistency token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The generated consistency token. + * + * Generated from protobuf field string consistency_token = 1; + * @return string + */ + public function getConsistencyToken() + { + return $this->consistency_token; + } + + /** + * The generated consistency token. + * + * Generated from protobuf field string consistency_token = 1; + * @param string $var + * @return $this + */ + public function setConsistencyToken($var) + { + GPBUtil::checkString($var, True); + $this->consistency_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetAppProfileRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetAppProfileRequest.php new file mode 100644 index 000000000000..017793bbb5ff --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetAppProfileRequest.php @@ -0,0 +1,86 @@ +google.bigtable.admin.v2.GetAppProfileRequest + */ +class GetAppProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the requested app profile. Values are of the + * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique name of the requested app profile. Values are of the + * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. Please see + * {@see BigtableInstanceAdminClient::appProfileName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\GetAppProfileRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the requested app profile. Values are of the + * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the requested app profile. Values are of the + * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the requested app profile. Values are of the + * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetAuthorizedViewRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetAuthorizedViewRequest.php new file mode 100644 index 000000000000..385c1c34c266 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetAuthorizedViewRequest.php @@ -0,0 +1,130 @@ +google.bigtable.admin.v2.GetAuthorizedViewRequest + */ +class GetAuthorizedViewRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the requested AuthorizedView. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The resource_view to be applied to the returned AuthorizedView's + * fields. Default to BASIC. + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $name Required. The unique name of the requested AuthorizedView. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. Please see + * {@see BigtableTableAdminClient::authorizedViewName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\GetAuthorizedViewRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the requested AuthorizedView. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * @type int $view + * Optional. The resource_view to be applied to the returned AuthorizedView's + * fields. Default to BASIC. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the requested AuthorizedView. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the requested AuthorizedView. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The resource_view to be applied to the returned AuthorizedView's + * fields. Default to BASIC. + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. The resource_view to be applied to the returned AuthorizedView's + * fields. Default to BASIC. + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\AuthorizedView\ResponseView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetBackupRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetBackupRequest.php new file mode 100644 index 000000000000..5f73e6f2900e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetBackupRequest.php @@ -0,0 +1,92 @@ +google.bigtable.admin.v2.GetBackupRequest + */ +class GetBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backup. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the backup. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. Please see + * {@see BigtableTableAdminClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\GetBackupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the backup. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backup. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the backup. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetClusterRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetClusterRequest.php new file mode 100644 index 000000000000..037844cc19a3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetClusterRequest.php @@ -0,0 +1,86 @@ +google.bigtable.admin.v2.GetClusterRequest + */ +class GetClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the requested cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique name of the requested cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. Please see + * {@see BigtableInstanceAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\GetClusterRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the requested cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the requested cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the requested cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetInstanceRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetInstanceRequest.php new file mode 100644 index 000000000000..28ca52c590cd --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetInstanceRequest.php @@ -0,0 +1,86 @@ +google.bigtable.admin.v2.GetInstanceRequest + */ +class GetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the requested instance. Values are of the form + * `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique name of the requested instance. Values are of the form + * `projects/{project}/instances/{instance}`. Please see + * {@see BigtableInstanceAdminClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\GetInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the requested instance. Values are of the form + * `projects/{project}/instances/{instance}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the requested instance. Values are of the form + * `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the requested instance. Values are of the form + * `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetSnapshotRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetSnapshotRequest.php new file mode 100644 index 000000000000..5b3547a68e7a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetSnapshotRequest.php @@ -0,0 +1,96 @@ +google.bigtable.admin.v2.GetSnapshotRequest + */ +class GetSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the requested snapshot. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique name of the requested snapshot. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. Please see + * {@see BigtableTableAdminClient::snapshotName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\GetSnapshotRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the requested snapshot. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the requested snapshot. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the requested snapshot. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetTableRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetTableRequest.php new file mode 100644 index 000000000000..34142b7797a5 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/GetTableRequest.php @@ -0,0 +1,130 @@ +google.bigtable.admin.v2.GetTableRequest + */ +class GetTableRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the requested table. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The view to be applied to the returned table's fields. + * Defaults to `SCHEMA_VIEW` if unspecified. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.View view = 2; + */ + protected $view = 0; + + /** + * @param string $name Required. The unique name of the requested table. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. Please see + * {@see BigtableTableAdminClient::tableName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\GetTableRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the requested table. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @type int $view + * The view to be applied to the returned table's fields. + * Defaults to `SCHEMA_VIEW` if unspecified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the requested table. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the requested table. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The view to be applied to the returned table's fields. + * Defaults to `SCHEMA_VIEW` if unspecified. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.View view = 2; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The view to be applied to the returned table's fields. + * Defaults to `SCHEMA_VIEW` if unspecified. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.View view = 2; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Table\View::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/HotTablet.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/HotTablet.php new file mode 100644 index 000000000000..4d75a90e66ee --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/HotTablet.php @@ -0,0 +1,315 @@ +google.bigtable.admin.v2.HotTablet + */ +class HotTablet extends \Google\Protobuf\Internal\Message +{ + /** + * The unique name of the hot tablet. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Name of the table that contains the tablet. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * + * Generated from protobuf field string table_name = 2 [(.google.api.resource_reference) = { + */ + protected $table_name = ''; + /** + * Output only. The start time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. The end time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Tablet Start Key (inclusive). + * + * Generated from protobuf field string start_key = 5; + */ + protected $start_key = ''; + /** + * Tablet End Key (inclusive). + * + * Generated from protobuf field string end_key = 6; + */ + protected $end_key = ''; + /** + * Output only. The average CPU usage spent by a node on this tablet over the + * start_time to end_time time range. The percentage is the amount of CPU used + * by the node to serve the tablet, from 0% (tablet was not interacted with) + * to 100% (the node spent all cycles serving the hot tablet). + * + * Generated from protobuf field float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $node_cpu_usage_percent = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the hot tablet. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`. + * @type string $table_name + * Name of the table that contains the tablet. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The start time of the hot tablet. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The end time of the hot tablet. + * @type string $start_key + * Tablet Start Key (inclusive). + * @type string $end_key + * Tablet End Key (inclusive). + * @type float $node_cpu_usage_percent + * Output only. The average CPU usage spent by a node on this tablet over the + * start_time to end_time time range. The percentage is the amount of CPU used + * by the node to serve the tablet, from 0% (tablet was not interacted with) + * to 100% (the node spent all cycles serving the hot tablet). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The unique name of the hot tablet. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique name of the hot tablet. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Name of the table that contains the tablet. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * + * Generated from protobuf field string table_name = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getTableName() + { + return $this->table_name; + } + + /** + * Name of the table that contains the tablet. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * + * Generated from protobuf field string table_name = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTableName($var) + { + GPBUtil::checkString($var, True); + $this->table_name = $var; + + return $this; + } + + /** + * Output only. The start time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The start time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. The end time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The end time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Tablet Start Key (inclusive). + * + * Generated from protobuf field string start_key = 5; + * @return string + */ + public function getStartKey() + { + return $this->start_key; + } + + /** + * Tablet Start Key (inclusive). + * + * Generated from protobuf field string start_key = 5; + * @param string $var + * @return $this + */ + public function setStartKey($var) + { + GPBUtil::checkString($var, True); + $this->start_key = $var; + + return $this; + } + + /** + * Tablet End Key (inclusive). + * + * Generated from protobuf field string end_key = 6; + * @return string + */ + public function getEndKey() + { + return $this->end_key; + } + + /** + * Tablet End Key (inclusive). + * + * Generated from protobuf field string end_key = 6; + * @param string $var + * @return $this + */ + public function setEndKey($var) + { + GPBUtil::checkString($var, True); + $this->end_key = $var; + + return $this; + } + + /** + * Output only. The average CPU usage spent by a node on this tablet over the + * start_time to end_time time range. The percentage is the amount of CPU used + * by the node to serve the tablet, from 0% (tablet was not interacted with) + * to 100% (the node spent all cycles serving the hot tablet). + * + * Generated from protobuf field float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getNodeCpuUsagePercent() + { + return $this->node_cpu_usage_percent; + } + + /** + * Output only. The average CPU usage spent by a node on this tablet over the + * start_time to end_time time range. The percentage is the amount of CPU used + * by the node to serve the tablet, from 0% (tablet was not interacted with) + * to 100% (the node spent all cycles serving the hot tablet). + * + * Generated from protobuf field float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setNodeCpuUsagePercent($var) + { + GPBUtil::checkFloat($var); + $this->node_cpu_usage_percent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Instance.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Instance.php new file mode 100644 index 000000000000..69fc8d87d690 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Instance.php @@ -0,0 +1,354 @@ +google.bigtable.admin.v2.Instance + */ +class Instance extends \Google\Protobuf\Internal\Message +{ + /** + * The unique name of the instance. Values are of the form + * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The descriptive name for this instance as it appears in UIs. + * Can be changed at any time, but should be kept globally unique + * to avoid confusion. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * (`OutputOnly`) + * The current state of the instance. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance.State state = 3; + */ + protected $state = 0; + /** + * The type of the instance. Defaults to `PRODUCTION`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance.Type type = 4; + */ + protected $type = 0; + /** + * Labels are a flexible and lightweight mechanism for organizing cloud + * resources into groups that reflect a customer's organizational needs and + * deployment strategies. They can be used to filter resources and aggregate + * metrics. + * * Label keys must be between 1 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. + * * Label values must be between 0 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. + * * No more than 64 labels can be associated with a given resource. + * * Keys and values must both be under 128 bytes. + * + * Generated from protobuf field map labels = 5; + */ + private $labels; + /** + * Output only. A server-assigned timestamp representing when this Instance + * was created. For instances created before this field was added (August + * 2021), this value is `seconds: 0, nanos: 1`. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the instance. Values are of the form + * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. + * @type string $display_name + * Required. The descriptive name for this instance as it appears in UIs. + * Can be changed at any time, but should be kept globally unique + * to avoid confusion. + * @type int $state + * (`OutputOnly`) + * The current state of the instance. + * @type int $type + * The type of the instance. Defaults to `PRODUCTION`. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels are a flexible and lightweight mechanism for organizing cloud + * resources into groups that reflect a customer's organizational needs and + * deployment strategies. They can be used to filter resources and aggregate + * metrics. + * * Label keys must be between 1 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. + * * Label values must be between 0 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. + * * No more than 64 labels can be associated with a given resource. + * * Keys and values must both be under 128 bytes. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. A server-assigned timestamp representing when this Instance + * was created. For instances created before this field was added (August + * 2021), this value is `seconds: 0, nanos: 1`. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The unique name of the instance. Values are of the form + * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique name of the instance. Values are of the form + * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The descriptive name for this instance as it appears in UIs. + * Can be changed at any time, but should be kept globally unique + * to avoid confusion. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The descriptive name for this instance as it appears in UIs. + * Can be changed at any time, but should be kept globally unique + * to avoid confusion. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * (`OutputOnly`) + * The current state of the instance. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance.State state = 3; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * (`OutputOnly`) + * The current state of the instance. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance.State state = 3; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Instance\State::class); + $this->state = $var; + + return $this; + } + + /** + * The type of the instance. Defaults to `PRODUCTION`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance.Type type = 4; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the instance. Defaults to `PRODUCTION`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance.Type type = 4; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Instance\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Labels are a flexible and lightweight mechanism for organizing cloud + * resources into groups that reflect a customer's organizational needs and + * deployment strategies. They can be used to filter resources and aggregate + * metrics. + * * Label keys must be between 1 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. + * * Label values must be between 0 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. + * * No more than 64 labels can be associated with a given resource. + * * Keys and values must both be under 128 bytes. + * + * Generated from protobuf field map labels = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels are a flexible and lightweight mechanism for organizing cloud + * resources into groups that reflect a customer's organizational needs and + * deployment strategies. They can be used to filter resources and aggregate + * metrics. + * * Label keys must be between 1 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. + * * Label values must be between 0 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. + * * No more than 64 labels can be associated with a given resource. + * * Keys and values must both be under 128 bytes. + * + * Generated from protobuf field map labels = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. A server-assigned timestamp representing when this Instance + * was created. For instances created before this field was added (August + * 2021), this value is `seconds: 0, nanos: 1`. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. A server-assigned timestamp representing when this Instance + * was created. For instances created before this field was added (August + * 2021), this value is `seconds: 0, nanos: 1`. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Instance/State.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Instance/State.php new file mode 100644 index 000000000000..8442f3728c83 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Instance/State.php @@ -0,0 +1,66 @@ +google.bigtable.admin.v2.Instance.State + */ +class State +{ + /** + * The state of the instance could not be determined. + * + * Generated from protobuf enum STATE_NOT_KNOWN = 0; + */ + const STATE_NOT_KNOWN = 0; + /** + * The instance has been successfully created and can serve requests + * to its tables. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The instance is currently being created, and may be destroyed + * if the creation process encounters an error. + * + * Generated from protobuf enum CREATING = 2; + */ + const CREATING = 2; + + private static $valueToName = [ + self::STATE_NOT_KNOWN => 'STATE_NOT_KNOWN', + self::READY => 'READY', + self::CREATING => 'CREATING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Bigtable\Admin\V2\Instance_State::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Instance/Type.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Instance/Type.php new file mode 100644 index 000000000000..8e68c47b9d0f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Instance/Type.php @@ -0,0 +1,68 @@ +google.bigtable.admin.v2.Instance.Type + */ +class Type +{ + /** + * The type of the instance is unspecified. If set when creating an + * instance, a `PRODUCTION` instance will be created. If set when updating + * an instance, the type will be left unchanged. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * An instance meant for production use. `serve_nodes` must be set + * on the cluster. + * + * Generated from protobuf enum PRODUCTION = 1; + */ + const PRODUCTION = 1; + /** + * DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces + * a higher minimum node count than DEVELOPMENT. + * + * Generated from protobuf enum DEVELOPMENT = 2; + */ + const DEVELOPMENT = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::PRODUCTION => 'PRODUCTION', + self::DEVELOPMENT => 'DEVELOPMENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Bigtable\Admin\V2\Instance_Type::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAppProfilesRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAppProfilesRequest.php new file mode 100644 index 000000000000..42d6c478cd5c --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAppProfilesRequest.php @@ -0,0 +1,193 @@ +google.bigtable.admin.v2.ListAppProfilesRequest + */ +class ListAppProfilesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the instance for which a list of app profiles + * is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 2; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The unique name of the instance for which a list of app profiles + * is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. Please see + * {@see BigtableInstanceAdminClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\ListAppProfilesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The unique name of the instance for which a list of app profiles + * is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + * @type int $page_size + * Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @type string $page_token + * The value of `next_page_token` returned by a previous call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the instance for which a list of app profiles + * is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The unique name of the instance for which a list of app profiles + * is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 2; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 2; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAppProfilesResponse.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAppProfilesResponse.php new file mode 100644 index 000000000000..c49770b40a07 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAppProfilesResponse.php @@ -0,0 +1,155 @@ +google.bigtable.admin.v2.ListAppProfilesResponse + */ +class ListAppProfilesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of requested app profiles. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + private $app_profiles; + /** + * Set if not all app profiles could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations from which AppProfile information could not be retrieved, + * due to an outage or some other transient condition. + * AppProfiles from these locations may be missing from `app_profiles`. + * Values are of the form `projects//locations/` + * + * Generated from protobuf field repeated string failed_locations = 3; + */ + private $failed_locations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\Admin\V2\AppProfile>|\Google\Protobuf\Internal\RepeatedField $app_profiles + * The list of requested app profiles. + * @type string $next_page_token + * Set if not all app profiles could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * @type array|\Google\Protobuf\Internal\RepeatedField $failed_locations + * Locations from which AppProfile information could not be retrieved, + * due to an outage or some other transient condition. + * AppProfiles from these locations may be missing from `app_profiles`. + * Values are of the form `projects//locations/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The list of requested app profiles. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppProfiles() + { + return $this->app_profiles; + } + + /** + * The list of requested app profiles. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + * @param array<\Google\Cloud\Bigtable\Admin\V2\AppProfile>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppProfiles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\AppProfile::class); + $this->app_profiles = $arr; + + return $this; + } + + /** + * Set if not all app profiles could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Set if not all app profiles could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations from which AppProfile information could not be retrieved, + * due to an outage or some other transient condition. + * AppProfiles from these locations may be missing from `app_profiles`. + * Values are of the form `projects//locations/` + * + * Generated from protobuf field repeated string failed_locations = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFailedLocations() + { + return $this->failed_locations; + } + + /** + * Locations from which AppProfile information could not be retrieved, + * due to an outage or some other transient condition. + * AppProfiles from these locations may be missing from `app_profiles`. + * Values are of the form `projects//locations/` + * + * Generated from protobuf field repeated string failed_locations = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFailedLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->failed_locations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAuthorizedViewsRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAuthorizedViewsRequest.php new file mode 100644 index 000000000000..4a02cb12c2c3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAuthorizedViewsRequest.php @@ -0,0 +1,222 @@ +google.bigtable.admin.v2.ListAuthorizedViewsRequest + */ +class ListAuthorizedViewsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the table for which AuthorizedViews should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The resource_view to be applied to the returned views' fields. + * Default to NAME_ONLY. + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $parent Required. The unique name of the table for which AuthorizedViews should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. Please see + * {@see BigtableTableAdminClient::tableName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\ListAuthorizedViewsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The unique name of the table for which AuthorizedViews should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @type int $page_size + * Optional. Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @type string $page_token + * Optional. The value of `next_page_token` returned by a previous call. + * @type int $view + * Optional. The resource_view to be applied to the returned views' fields. + * Default to NAME_ONLY. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the table for which AuthorizedViews should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The unique name of the table for which AuthorizedViews should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The resource_view to be applied to the returned views' fields. + * Default to NAME_ONLY. + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. The resource_view to be applied to the returned views' fields. + * Default to NAME_ONLY. + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\AuthorizedView\ResponseView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAuthorizedViewsResponse.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAuthorizedViewsResponse.php new file mode 100644 index 000000000000..83d26b843966 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListAuthorizedViewsResponse.php @@ -0,0 +1,110 @@ +google.bigtable.admin.v2.ListAuthorizedViewsResponse + */ +class ListAuthorizedViewsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The AuthorizedViews present in the requested table. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + private $authorized_views; + /** + * Set if not all tables could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\Admin\V2\AuthorizedView>|\Google\Protobuf\Internal\RepeatedField $authorized_views + * The AuthorizedViews present in the requested table. + * @type string $next_page_token + * Set if not all tables could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The AuthorizedViews present in the requested table. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAuthorizedViews() + { + return $this->authorized_views; + } + + /** + * The AuthorizedViews present in the requested table. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + * @param array<\Google\Cloud\Bigtable\Admin\V2\AuthorizedView>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAuthorizedViews($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\AuthorizedView::class); + $this->authorized_views = $arr; + + return $this; + } + + /** + * Set if not all tables could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Set if not all tables could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListBackupsRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListBackupsRequest.php new file mode 100644 index 000000000000..6f5666e3bdbd --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListBackupsRequest.php @@ -0,0 +1,429 @@ +google.bigtable.admin.v2.ListBackupsRequest + */ +class ListBackupsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The cluster to list backups from. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list backups for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * A filter expression that filters backups listed in the response. + * The expression must specify the field name, a comparison operator, + * and the value that you want to use for filtering. The value must be a + * string, a number, or a boolean. The comparison operator must be + * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is + * roughly synonymous with equality. Filter rules are case insensitive. + * The fields eligible for filtering are: + * * `name` + * * `source_table` + * * `state` + * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `size_bytes` + * To filter on multiple expressions, provide each separate expression within + * parentheses. By default, each expression is an AND expression. However, + * you can include AND, OR, and NOT expressions explicitly. + * Some examples of using filters are: + * * `name:"exact"` --> The backup's name is the string "exact". + * * `name:howl` --> The backup's name contains the string "howl". + * * `source_table:prod` + * --> The source_table's name contains the string "prod". + * * `state:CREATING` --> The backup is pending creation. + * * `state:READY` --> The backup is fully created and ready for use. + * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` + * --> The backup name contains the string "howl" and start_time + * of the backup is before 2018-03-28T14:50:00Z. + * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * An expression for specifying the sort order of the results of the request. + * The string value should specify one or more fields in + * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at + * https://aip.dev/132#ordering. + * Fields supported are: + * * name + * * source_table + * * expire_time + * * start_time + * * end_time + * * size_bytes + * * state + * For example, "start_time". The default sorting order is ascending. + * To specify descending order for the field, a suffix " desc" should + * be appended to the field name. For example, "start_time desc". + * Redundant space characters in the syntax are insigificant. + * If order_by is empty, results will be sorted by `start_time` in descending + * order starting from the most recently created backup. + * + * Generated from protobuf field string order_by = 3; + */ + protected $order_by = ''; + /** + * Number of backups to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * If non-empty, `page_token` should contain a + * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token] + * from a previous + * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the + * same `parent` and with the same `filter`. + * + * Generated from protobuf field string page_token = 5; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The cluster to list backups from. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list backups for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. Please see + * {@see BigtableTableAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\ListBackupsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The cluster to list backups from. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list backups for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * @type string $filter + * A filter expression that filters backups listed in the response. + * The expression must specify the field name, a comparison operator, + * and the value that you want to use for filtering. The value must be a + * string, a number, or a boolean. The comparison operator must be + * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is + * roughly synonymous with equality. Filter rules are case insensitive. + * The fields eligible for filtering are: + * * `name` + * * `source_table` + * * `state` + * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `size_bytes` + * To filter on multiple expressions, provide each separate expression within + * parentheses. By default, each expression is an AND expression. However, + * you can include AND, OR, and NOT expressions explicitly. + * Some examples of using filters are: + * * `name:"exact"` --> The backup's name is the string "exact". + * * `name:howl` --> The backup's name contains the string "howl". + * * `source_table:prod` + * --> The source_table's name contains the string "prod". + * * `state:CREATING` --> The backup is pending creation. + * * `state:READY` --> The backup is fully created and ready for use. + * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` + * --> The backup name contains the string "howl" and start_time + * of the backup is before 2018-03-28T14:50:00Z. + * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB + * @type string $order_by + * An expression for specifying the sort order of the results of the request. + * The string value should specify one or more fields in + * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at + * https://aip.dev/132#ordering. + * Fields supported are: + * * name + * * source_table + * * expire_time + * * start_time + * * end_time + * * size_bytes + * * state + * For example, "start_time". The default sorting order is ascending. + * To specify descending order for the field, a suffix " desc" should + * be appended to the field name. For example, "start_time desc". + * Redundant space characters in the syntax are insigificant. + * If order_by is empty, results will be sorted by `start_time` in descending + * order starting from the most recently created backup. + * @type int $page_size + * Number of backups to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @type string $page_token + * If non-empty, `page_token` should contain a + * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token] + * from a previous + * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the + * same `parent` and with the same `filter`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The cluster to list backups from. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list backups for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The cluster to list backups from. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list backups for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * A filter expression that filters backups listed in the response. + * The expression must specify the field name, a comparison operator, + * and the value that you want to use for filtering. The value must be a + * string, a number, or a boolean. The comparison operator must be + * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is + * roughly synonymous with equality. Filter rules are case insensitive. + * The fields eligible for filtering are: + * * `name` + * * `source_table` + * * `state` + * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `size_bytes` + * To filter on multiple expressions, provide each separate expression within + * parentheses. By default, each expression is an AND expression. However, + * you can include AND, OR, and NOT expressions explicitly. + * Some examples of using filters are: + * * `name:"exact"` --> The backup's name is the string "exact". + * * `name:howl` --> The backup's name contains the string "howl". + * * `source_table:prod` + * --> The source_table's name contains the string "prod". + * * `state:CREATING` --> The backup is pending creation. + * * `state:READY` --> The backup is fully created and ready for use. + * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` + * --> The backup name contains the string "howl" and start_time + * of the backup is before 2018-03-28T14:50:00Z. + * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * A filter expression that filters backups listed in the response. + * The expression must specify the field name, a comparison operator, + * and the value that you want to use for filtering. The value must be a + * string, a number, or a boolean. The comparison operator must be + * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is + * roughly synonymous with equality. Filter rules are case insensitive. + * The fields eligible for filtering are: + * * `name` + * * `source_table` + * * `state` + * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `size_bytes` + * To filter on multiple expressions, provide each separate expression within + * parentheses. By default, each expression is an AND expression. However, + * you can include AND, OR, and NOT expressions explicitly. + * Some examples of using filters are: + * * `name:"exact"` --> The backup's name is the string "exact". + * * `name:howl` --> The backup's name contains the string "howl". + * * `source_table:prod` + * --> The source_table's name contains the string "prod". + * * `state:CREATING` --> The backup is pending creation. + * * `state:READY` --> The backup is fully created and ready for use. + * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` + * --> The backup name contains the string "howl" and start_time + * of the backup is before 2018-03-28T14:50:00Z. + * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * An expression for specifying the sort order of the results of the request. + * The string value should specify one or more fields in + * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at + * https://aip.dev/132#ordering. + * Fields supported are: + * * name + * * source_table + * * expire_time + * * start_time + * * end_time + * * size_bytes + * * state + * For example, "start_time". The default sorting order is ascending. + * To specify descending order for the field, a suffix " desc" should + * be appended to the field name. For example, "start_time desc". + * Redundant space characters in the syntax are insigificant. + * If order_by is empty, results will be sorted by `start_time` in descending + * order starting from the most recently created backup. + * + * Generated from protobuf field string order_by = 3; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * An expression for specifying the sort order of the results of the request. + * The string value should specify one or more fields in + * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at + * https://aip.dev/132#ordering. + * Fields supported are: + * * name + * * source_table + * * expire_time + * * start_time + * * end_time + * * size_bytes + * * state + * For example, "start_time". The default sorting order is ascending. + * To specify descending order for the field, a suffix " desc" should + * be appended to the field name. For example, "start_time desc". + * Redundant space characters in the syntax are insigificant. + * If order_by is empty, results will be sorted by `start_time` in descending + * order starting from the most recently created backup. + * + * Generated from protobuf field string order_by = 3; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Number of backups to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Number of backups to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If non-empty, `page_token` should contain a + * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token] + * from a previous + * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the + * same `parent` and with the same `filter`. + * + * Generated from protobuf field string page_token = 5; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If non-empty, `page_token` should contain a + * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token] + * from a previous + * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the + * same `parent` and with the same `filter`. + * + * Generated from protobuf field string page_token = 5; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListBackupsResponse.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListBackupsResponse.php new file mode 100644 index 000000000000..c9792bd915b6 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListBackupsResponse.php @@ -0,0 +1,110 @@ +google.bigtable.admin.v2.ListBackupsResponse + */ +class ListBackupsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of matching backups. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + private $backups; + /** + * `next_page_token` can be sent in a subsequent + * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call + * to fetch more of the matching backups. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\Admin\V2\Backup>|\Google\Protobuf\Internal\RepeatedField $backups + * The list of matching backups. + * @type string $next_page_token + * `next_page_token` can be sent in a subsequent + * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call + * to fetch more of the matching backups. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The list of matching backups. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Backup backups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackups() + { + return $this->backups; + } + + /** + * The list of matching backups. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Backup backups = 1; + * @param array<\Google\Cloud\Bigtable\Admin\V2\Backup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Backup::class); + $this->backups = $arr; + + return $this; + } + + /** + * `next_page_token` can be sent in a subsequent + * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call + * to fetch more of the matching backups. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * `next_page_token` can be sent in a subsequent + * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call + * to fetch more of the matching backups. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListClustersRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListClustersRequest.php new file mode 100644 index 000000000000..00a12138e516 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListClustersRequest.php @@ -0,0 +1,135 @@ +google.bigtable.admin.v2.ListClustersRequest + */ +class ListClustersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the instance for which a list of clusters is + * requested. Values are of the form + * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list + * Clusters for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string page_token = 2; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The unique name of the instance for which a list of clusters is + * requested. Values are of the form + * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list + * Clusters for all Instances in a project, e.g., + * `projects/myproject/instances/-`. Please see + * {@see BigtableInstanceAdminClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\ListClustersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The unique name of the instance for which a list of clusters is + * requested. Values are of the form + * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list + * Clusters for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * @type string $page_token + * DEPRECATED: This field is unused and ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the instance for which a list of clusters is + * requested. Values are of the form + * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list + * Clusters for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The unique name of the instance for which a list of clusters is + * requested. Values are of the form + * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list + * Clusters for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string page_token = 2; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string page_token = 2; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListClustersResponse.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListClustersResponse.php new file mode 100644 index 000000000000..84ccf514aa70 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListClustersResponse.php @@ -0,0 +1,151 @@ +google.bigtable.admin.v2.ListClustersResponse + */ +class ListClustersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of requested clusters. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + private $clusters; + /** + * Locations from which Cluster information could not be retrieved, + * due to an outage or some other transient condition. + * Clusters from these locations may be missing from `clusters`, + * or may only have partial information returned. + * Values are of the form `projects//locations/` + * + * Generated from protobuf field repeated string failed_locations = 2; + */ + private $failed_locations; + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string next_page_token = 3; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\Admin\V2\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters + * The list of requested clusters. + * @type array|\Google\Protobuf\Internal\RepeatedField $failed_locations + * Locations from which Cluster information could not be retrieved, + * due to an outage or some other transient condition. + * Clusters from these locations may be missing from `clusters`, + * or may only have partial information returned. + * Values are of the form `projects//locations/` + * @type string $next_page_token + * DEPRECATED: This field is unused and ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The list of requested clusters. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Cluster clusters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClusters() + { + return $this->clusters; + } + + /** + * The list of requested clusters. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Cluster clusters = 1; + * @param array<\Google\Cloud\Bigtable\Admin\V2\Cluster>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClusters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Cluster::class); + $this->clusters = $arr; + + return $this; + } + + /** + * Locations from which Cluster information could not be retrieved, + * due to an outage or some other transient condition. + * Clusters from these locations may be missing from `clusters`, + * or may only have partial information returned. + * Values are of the form `projects//locations/` + * + * Generated from protobuf field repeated string failed_locations = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFailedLocations() + { + return $this->failed_locations; + } + + /** + * Locations from which Cluster information could not be retrieved, + * due to an outage or some other transient condition. + * Clusters from these locations may be missing from `clusters`, + * or may only have partial information returned. + * Values are of the form `projects//locations/` + * + * Generated from protobuf field repeated string failed_locations = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFailedLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->failed_locations = $arr; + + return $this; + } + + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string next_page_token = 3; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string next_page_token = 3; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListHotTabletsRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListHotTabletsRequest.php new file mode 100644 index 000000000000..2fcefef12c29 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListHotTabletsRequest.php @@ -0,0 +1,291 @@ +google.bigtable.admin.v2.ListHotTabletsRequest + */ +class ListHotTabletsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + */ + protected $start_time = null; + /** + * The end time to list hot tablets. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + */ + protected $end_time = null; + /** + * Maximum number of results per page. + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 5; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. Please see + * {@see BigtableInstanceAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\ListHotTabletsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @type \Google\Protobuf\Timestamp $start_time + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * @type \Google\Protobuf\Timestamp $end_time + * The end time to list hot tablets. + * @type int $page_size + * Maximum number of results per page. + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + * @type string $page_token + * The value of `next_page_token` returned by a previous call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The end time to list hot tablets. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The end time to list hot tablets. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Maximum number of results per page. + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of results per page. + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 5; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 5; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListHotTabletsResponse.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListHotTabletsResponse.php new file mode 100644 index 000000000000..39b6a733dade --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListHotTabletsResponse.php @@ -0,0 +1,125 @@ +google.bigtable.admin.v2.ListHotTabletsResponse + */ +class ListHotTabletsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of hot tablets in the tables of the requested cluster that fall + * within the requested time range. Hot tablets are ordered by node cpu usage + * percent. If there are multiple hot tablets that correspond to the same + * tablet within a 15-minute interval, only the hot tablet with the highest + * node cpu usage will be included in the response. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + private $hot_tablets; + /** + * Set if not all hot tablets could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\Admin\V2\HotTablet>|\Google\Protobuf\Internal\RepeatedField $hot_tablets + * List of hot tablets in the tables of the requested cluster that fall + * within the requested time range. Hot tablets are ordered by node cpu usage + * percent. If there are multiple hot tablets that correspond to the same + * tablet within a 15-minute interval, only the hot tablet with the highest + * node cpu usage will be included in the response. + * @type string $next_page_token + * Set if not all hot tablets could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * List of hot tablets in the tables of the requested cluster that fall + * within the requested time range. Hot tablets are ordered by node cpu usage + * percent. If there are multiple hot tablets that correspond to the same + * tablet within a 15-minute interval, only the hot tablet with the highest + * node cpu usage will be included in the response. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHotTablets() + { + return $this->hot_tablets; + } + + /** + * List of hot tablets in the tables of the requested cluster that fall + * within the requested time range. Hot tablets are ordered by node cpu usage + * percent. If there are multiple hot tablets that correspond to the same + * tablet within a 15-minute interval, only the hot tablet with the highest + * node cpu usage will be included in the response. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + * @param array<\Google\Cloud\Bigtable\Admin\V2\HotTablet>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHotTablets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\HotTablet::class); + $this->hot_tablets = $arr; + + return $this; + } + + /** + * Set if not all hot tablets could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Set if not all hot tablets could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListInstancesRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListInstancesRequest.php new file mode 100644 index 000000000000..e0d88b2803fa --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListInstancesRequest.php @@ -0,0 +1,120 @@ +google.bigtable.admin.v2.ListInstancesRequest + */ +class ListInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the project for which a list of instances is + * requested. Values are of the form `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string page_token = 2; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The unique name of the project for which a list of instances is + * requested. Values are of the form `projects/{project}`. Please see + * {@see BigtableInstanceAdminClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\ListInstancesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The unique name of the project for which a list of instances is + * requested. Values are of the form `projects/{project}`. + * @type string $page_token + * DEPRECATED: This field is unused and ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the project for which a list of instances is + * requested. Values are of the form `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The unique name of the project for which a list of instances is + * requested. Values are of the form `projects/{project}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string page_token = 2; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string page_token = 2; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListInstancesResponse.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListInstancesResponse.php new file mode 100644 index 000000000000..6e08425dbe3e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListInstancesResponse.php @@ -0,0 +1,155 @@ +google.bigtable.admin.v2.ListInstancesResponse + */ +class ListInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of requested instances. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + private $instances; + /** + * Locations from which Instance information could not be retrieved, + * due to an outage or some other transient condition. + * Instances whose Clusters are all in one of the failed locations + * may be missing from `instances`, and Instances with at least one + * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects//locations/` + * + * Generated from protobuf field repeated string failed_locations = 2; + */ + private $failed_locations; + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string next_page_token = 3; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\Admin\V2\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * The list of requested instances. + * @type array|\Google\Protobuf\Internal\RepeatedField $failed_locations + * Locations from which Instance information could not be retrieved, + * due to an outage or some other transient condition. + * Instances whose Clusters are all in one of the failed locations + * may be missing from `instances`, and Instances with at least one + * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects//locations/` + * @type string $next_page_token + * DEPRECATED: This field is unused and ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The list of requested instances. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The list of requested instances. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Instance instances = 1; + * @param array<\Google\Cloud\Bigtable\Admin\V2\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Instance::class); + $this->instances = $arr; + + return $this; + } + + /** + * Locations from which Instance information could not be retrieved, + * due to an outage or some other transient condition. + * Instances whose Clusters are all in one of the failed locations + * may be missing from `instances`, and Instances with at least one + * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects//locations/` + * + * Generated from protobuf field repeated string failed_locations = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFailedLocations() + { + return $this->failed_locations; + } + + /** + * Locations from which Instance information could not be retrieved, + * due to an outage or some other transient condition. + * Instances whose Clusters are all in one of the failed locations + * may be missing from `instances`, and Instances with at least one + * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects//locations/` + * + * Generated from protobuf field repeated string failed_locations = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFailedLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->failed_locations = $arr; + + return $this; + } + + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string next_page_token = 3; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * DEPRECATED: This field is unused and ignored. + * + * Generated from protobuf field string next_page_token = 3; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListSnapshotsRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListSnapshotsRequest.php new file mode 100644 index 000000000000..5ee84a207816 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListSnapshotsRequest.php @@ -0,0 +1,178 @@ +google.bigtable.admin.v2.ListSnapshotsRequest + */ +class ListSnapshotsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the cluster for which snapshots should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of snapshots to return per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The unique name of the cluster for which snapshots should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. Please see + * {@see BigtableTableAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\ListSnapshotsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The unique name of the cluster for which snapshots should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * @type int $page_size + * The maximum number of snapshots to return per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. + * @type string $page_token + * The value of `next_page_token` returned by a previous call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the cluster for which snapshots should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The unique name of the cluster for which snapshots should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of snapshots to return per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of snapshots to return per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListSnapshotsResponse.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListSnapshotsResponse.php new file mode 100644 index 000000000000..c3d9df13f7e0 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListSnapshotsResponse.php @@ -0,0 +1,114 @@ +google.bigtable.admin.v2.ListSnapshotsResponse + */ +class ListSnapshotsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The snapshots present in the requested cluster. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + private $snapshots; + /** + * Set if not all snapshots could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\Admin\V2\Snapshot>|\Google\Protobuf\Internal\RepeatedField $snapshots + * The snapshots present in the requested cluster. + * @type string $next_page_token + * Set if not all snapshots could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The snapshots present in the requested cluster. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSnapshots() + { + return $this->snapshots; + } + + /** + * The snapshots present in the requested cluster. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + * @param array<\Google\Cloud\Bigtable\Admin\V2\Snapshot>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSnapshots($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Snapshot::class); + $this->snapshots = $arr; + + return $this; + } + + /** + * Set if not all snapshots could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Set if not all snapshots could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListTablesRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListTablesRequest.php new file mode 100644 index 000000000000..d10580296a66 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListTablesRequest.php @@ -0,0 +1,217 @@ +google.bigtable.admin.v2.ListTablesRequest + */ +class ListTablesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the instance for which tables should be + * listed. Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The view to be applied to the returned tables' fields. + * NAME_ONLY view (default) and REPLICATION_VIEW are supported. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.View view = 2; + */ + protected $view = 0; + /** + * Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The unique name of the instance for which tables should be + * listed. Values are of the form `projects/{project}/instances/{instance}`. Please see + * {@see BigtableTableAdminClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\ListTablesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The unique name of the instance for which tables should be + * listed. Values are of the form `projects/{project}/instances/{instance}`. + * @type int $view + * The view to be applied to the returned tables' fields. + * NAME_ONLY view (default) and REPLICATION_VIEW are supported. + * @type int $page_size + * Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @type string $page_token + * The value of `next_page_token` returned by a previous call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the instance for which tables should be + * listed. Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The unique name of the instance for which tables should be + * listed. Values are of the form `projects/{project}/instances/{instance}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The view to be applied to the returned tables' fields. + * NAME_ONLY view (default) and REPLICATION_VIEW are supported. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.View view = 2; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The view to be applied to the returned tables' fields. + * NAME_ONLY view (default) and REPLICATION_VIEW are supported. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.View view = 2; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Table\View::class); + $this->view = $var; + + return $this; + } + + /** + * Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListTablesResponse.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListTablesResponse.php new file mode 100644 index 000000000000..1dac80ef82f5 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ListTablesResponse.php @@ -0,0 +1,110 @@ +google.bigtable.admin.v2.ListTablesResponse + */ +class ListTablesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The tables present in the requested instance. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Table tables = 1; + */ + private $tables; + /** + * Set if not all tables could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\Admin\V2\Table>|\Google\Protobuf\Internal\RepeatedField $tables + * The tables present in the requested instance. + * @type string $next_page_token + * Set if not all tables could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The tables present in the requested instance. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Table tables = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTables() + { + return $this->tables; + } + + /** + * The tables present in the requested instance. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Table tables = 1; + * @param array<\Google\Cloud\Bigtable\Admin\V2\Table>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Table::class); + $this->tables = $arr; + + return $this; + } + + /** + * Set if not all tables could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Set if not all tables could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ModifyColumnFamiliesRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ModifyColumnFamiliesRequest.php new file mode 100644 index 000000000000..8960e4680f7d --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ModifyColumnFamiliesRequest.php @@ -0,0 +1,177 @@ +google.bigtable.admin.v2.ModifyColumnFamiliesRequest + */ +class ModifyColumnFamiliesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the table whose families should be modified. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. Modifications to be atomically applied to the specified table's + * families. Entries are applied in order, meaning that earlier modifications + * can be masked by later ones (in the case of repeated updates to the same + * family, for example). + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $modifications; + /** + * Optional. If true, ignore safety checks when modifying the column families. + * + * Generated from protobuf field bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ignore_warnings = false; + + /** + * @param string $name Required. The unique name of the table whose families should be modified. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. Please see + * {@see BigtableTableAdminClient::tableName()} for help formatting this field. + * @param \Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification[] $modifications Required. Modifications to be atomically applied to the specified table's + * families. Entries are applied in order, meaning that earlier modifications + * can be masked by later ones (in the case of repeated updates to the same + * family, for example). + * + * @return \Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest + * + * @experimental + */ + public static function build(string $name, array $modifications): self + { + return (new self()) + ->setName($name) + ->setModifications($modifications); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the table whose families should be modified. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @type array<\Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification>|\Google\Protobuf\Internal\RepeatedField $modifications + * Required. Modifications to be atomically applied to the specified table's + * families. Entries are applied in order, meaning that earlier modifications + * can be masked by later ones (in the case of repeated updates to the same + * family, for example). + * @type bool $ignore_warnings + * Optional. If true, ignore safety checks when modifying the column families. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the table whose families should be modified. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the table whose families should be modified. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Modifications to be atomically applied to the specified table's + * families. Entries are applied in order, meaning that earlier modifications + * can be masked by later ones (in the case of repeated updates to the same + * family, for example). + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModifications() + { + return $this->modifications; + } + + /** + * Required. Modifications to be atomically applied to the specified table's + * families. Entries are applied in order, meaning that earlier modifications + * can be masked by later ones (in the case of repeated updates to the same + * family, for example). + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModifications($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification::class); + $this->modifications = $arr; + + return $this; + } + + /** + * Optional. If true, ignore safety checks when modifying the column families. + * + * Generated from protobuf field bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIgnoreWarnings() + { + return $this->ignore_warnings; + } + + /** + * Optional. If true, ignore safety checks when modifying the column families. + * + * Generated from protobuf field bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIgnoreWarnings($var) + { + GPBUtil::checkBool($var); + $this->ignore_warnings = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ModifyColumnFamiliesRequest/Modification.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ModifyColumnFamiliesRequest/Modification.php new file mode 100644 index 000000000000..0675f7d22032 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/ModifyColumnFamiliesRequest/Modification.php @@ -0,0 +1,239 @@ +google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + */ +class Modification extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the column family to be modified. + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update` + * mod should be updated, ignored for other modification types. If unset or + * empty, we treat it as updating `gc_rule` to be backward compatible. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + protected $mod; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * The ID of the column family to be modified. + * @type \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $create + * Create a new column family with the specified schema, or fail if + * one already exists with the given ID. + * @type \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $update + * Update an existing column family to the specified schema, or fail + * if no column family exists with the given ID. + * @type bool $drop + * Drop (delete) the column family with the given ID, or fail if no such + * family exists. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update` + * mod should be updated, ignored for other modification types. If unset or + * empty, we treat it as updating `gc_rule` to be backward compatible. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the column family to be modified. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The ID of the column family to be modified. + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Create a new column family with the specified schema, or fail if + * one already exists with the given ID. + * + * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily create = 2; + * @return \Google\Cloud\Bigtable\Admin\V2\ColumnFamily|null + */ + public function getCreate() + { + return $this->readOneof(2); + } + + public function hasCreate() + { + return $this->hasOneof(2); + } + + /** + * Create a new column family with the specified schema, or fail if + * one already exists with the given ID. + * + * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily create = 2; + * @param \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $var + * @return $this + */ + public function setCreate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\ColumnFamily::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Update an existing column family to the specified schema, or fail + * if no column family exists with the given ID. + * + * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily update = 3; + * @return \Google\Cloud\Bigtable\Admin\V2\ColumnFamily|null + */ + public function getUpdate() + { + return $this->readOneof(3); + } + + public function hasUpdate() + { + return $this->hasOneof(3); + } + + /** + * Update an existing column family to the specified schema, or fail + * if no column family exists with the given ID. + * + * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily update = 3; + * @param \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $var + * @return $this + */ + public function setUpdate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\ColumnFamily::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Drop (delete) the column family with the given ID, or fail if no such + * family exists. + * + * Generated from protobuf field bool drop = 4; + * @return bool + */ + public function getDrop() + { + return $this->readOneof(4); + } + + public function hasDrop() + { + return $this->hasOneof(4); + } + + /** + * Drop (delete) the column family with the given ID, or fail if no such + * family exists. + * + * Generated from protobuf field bool drop = 4; + * @param bool $var + * @return $this + */ + public function setDrop($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update` + * mod should be updated, ignored for other modification types. If unset or + * empty, we treat it as updating `gc_rule` to be backward compatible. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update` + * mod should be updated, ignored for other modification types. If unset or + * empty, we treat it as updating `gc_rule` to be backward compatible. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * @return string + */ + public function getMod() + { + return $this->whichOneof("mod"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Modification::class, \Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest_Modification::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/OperationProgress.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/OperationProgress.php new file mode 100644 index 000000000000..31e8504969ea --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/OperationProgress.php @@ -0,0 +1,164 @@ +google.bigtable.admin.v2.OperationProgress + */ +class OperationProgress extends \Google\Protobuf\Internal\Message +{ + /** + * Percent completion of the operation. + * Values are between 0 and 100 inclusive. + * + * Generated from protobuf field int32 progress_percent = 1; + */ + protected $progress_percent = 0; + /** + * Time the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + */ + protected $start_time = null; + /** + * If set, the time at which this operation failed or was completed + * successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $progress_percent + * Percent completion of the operation. + * Values are between 0 and 100 inclusive. + * @type \Google\Protobuf\Timestamp $start_time + * Time the request was received. + * @type \Google\Protobuf\Timestamp $end_time + * If set, the time at which this operation failed or was completed + * successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Percent completion of the operation. + * Values are between 0 and 100 inclusive. + * + * Generated from protobuf field int32 progress_percent = 1; + * @return int + */ + public function getProgressPercent() + { + return $this->progress_percent; + } + + /** + * Percent completion of the operation. + * Values are between 0 and 100 inclusive. + * + * Generated from protobuf field int32 progress_percent = 1; + * @param int $var + * @return $this + */ + public function setProgressPercent($var) + { + GPBUtil::checkInt32($var); + $this->progress_percent = $var; + + return $this; + } + + /** + * Time the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * If set, the time at which this operation failed or was completed + * successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * If set, the time at which this operation failed or was completed + * successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/OptimizeRestoredTableMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/OptimizeRestoredTableMetadata.php new file mode 100644 index 000000000000..6a51fb65bbe8 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/OptimizeRestoredTableMetadata.php @@ -0,0 +1,114 @@ +google.bigtable.admin.v2.OptimizeRestoredTableMetadata + */ +class OptimizeRestoredTableMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the restored table being optimized. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The progress of the post-restore optimizations. + * + * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 2; + */ + protected $progress = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the restored table being optimized. + * @type \Google\Cloud\Bigtable\Admin\V2\OperationProgress $progress + * The progress of the post-restore optimizations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Name of the restored table being optimized. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the restored table being optimized. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The progress of the post-restore optimizations. + * + * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 2; + * @return \Google\Cloud\Bigtable\Admin\V2\OperationProgress|null + */ + public function getProgress() + { + return $this->progress; + } + + public function hasProgress() + { + return isset($this->progress); + } + + public function clearProgress() + { + unset($this->progress); + } + + /** + * The progress of the post-restore optimizations. + * + * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 2; + * @param \Google\Cloud\Bigtable\Admin\V2\OperationProgress $var + * @return $this + */ + public function setProgress($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\OperationProgress::class); + $this->progress = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/PartialUpdateClusterMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/PartialUpdateClusterMetadata.php new file mode 100644 index 000000000000..60d2f7c47f64 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/PartialUpdateClusterMetadata.php @@ -0,0 +1,165 @@ +google.bigtable.admin.v2.PartialUpdateClusterMetadata + */ +class PartialUpdateClusterMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 1; + */ + protected $request_time = null; + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 2; + */ + protected $finish_time = null; + /** + * The original request for PartialUpdateCluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + */ + protected $original_request = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * @type \Google\Cloud\Bigtable\Admin\V2\PartialUpdateClusterRequest $original_request + * The original request for PartialUpdateCluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRequestTime() + { + return $this->request_time; + } + + public function hasRequestTime() + { + return isset($this->request_time); + } + + public function clearRequestTime() + { + unset($this->request_time); + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRequestTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->request_time = $var; + + return $this; + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFinishTime() + { + return $this->finish_time; + } + + public function hasFinishTime() + { + return isset($this->finish_time); + } + + public function clearFinishTime() + { + unset($this->finish_time); + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFinishTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->finish_time = $var; + + return $this; + } + + /** + * The original request for PartialUpdateCluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + * @return \Google\Cloud\Bigtable\Admin\V2\PartialUpdateClusterRequest|null + */ + public function getOriginalRequest() + { + return $this->original_request; + } + + public function hasOriginalRequest() + { + return isset($this->original_request); + } + + public function clearOriginalRequest() + { + unset($this->original_request); + } + + /** + * The original request for PartialUpdateCluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + * @param \Google\Cloud\Bigtable\Admin\V2\PartialUpdateClusterRequest $var + * @return $this + */ + public function setOriginalRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\PartialUpdateClusterRequest::class); + $this->original_request = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/PartialUpdateClusterRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/PartialUpdateClusterRequest.php new file mode 100644 index 000000000000..c5cb2b443eef --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/PartialUpdateClusterRequest.php @@ -0,0 +1,141 @@ +google.bigtable.admin.v2.PartialUpdateClusterRequest + */ +class PartialUpdateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Cluster which contains the partial updates to be applied, + * subject to the update_mask. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = null; + /** + * Required. The subset of Cluster fields which should be replaced. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Bigtable\Admin\V2\Cluster $cluster Required. The Cluster which contains the partial updates to be applied, + * subject to the update_mask. + * @param \Google\Protobuf\FieldMask $updateMask Required. The subset of Cluster fields which should be replaced. + * + * @return \Google\Cloud\Bigtable\Admin\V2\PartialUpdateClusterRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Bigtable\Admin\V2\Cluster $cluster, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCluster($cluster) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Cluster $cluster + * Required. The Cluster which contains the partial updates to be applied, + * subject to the update_mask. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The subset of Cluster fields which should be replaced. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Cluster which contains the partial updates to be applied, + * subject to the update_mask. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The Cluster which contains the partial updates to be applied, + * subject to the update_mask. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Cluster::class); + $this->cluster = $var; + + return $this; + } + + /** + * Required. The subset of Cluster fields which should be replaced. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The subset of Cluster fields which should be replaced. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/PartialUpdateInstanceRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/PartialUpdateInstanceRequest.php new file mode 100644 index 000000000000..91e4ac7d79eb --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/PartialUpdateInstanceRequest.php @@ -0,0 +1,141 @@ +google.bigtable.admin.v2.PartialUpdateInstanceRequest + */ +class PartialUpdateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Instance which will (partially) replace the current value. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = null; + /** + * Required. The subset of Instance fields which should be replaced. + * Must be explicitly set. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Bigtable\Admin\V2\Instance $instance Required. The Instance which will (partially) replace the current value. + * @param \Google\Protobuf\FieldMask $updateMask Required. The subset of Instance fields which should be replaced. + * Must be explicitly set. + * + * @return \Google\Cloud\Bigtable\Admin\V2\PartialUpdateInstanceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Bigtable\Admin\V2\Instance $instance, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setInstance($instance) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Instance $instance + * Required. The Instance which will (partially) replace the current value. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The subset of Instance fields which should be replaced. + * Must be explicitly set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Instance which will (partially) replace the current value. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The Instance which will (partially) replace the current value. + * + * Generated from protobuf field .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Instance::class); + $this->instance = $var; + + return $this; + } + + /** + * Required. The subset of Instance fields which should be replaced. + * Must be explicitly set. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The subset of Instance fields which should be replaced. + * Must be explicitly set. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreInfo.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreInfo.php new file mode 100644 index 000000000000..d470c27dc7b8 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreInfo.php @@ -0,0 +1,112 @@ +google.bigtable.admin.v2.RestoreInfo + */ +class RestoreInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The type of the restore source. + * + * Generated from protobuf field .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + */ + protected $source_type = 0; + protected $source_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $source_type + * The type of the restore source. + * @type \Google\Cloud\Bigtable\Admin\V2\BackupInfo $backup_info + * Information about the backup used to restore the table. The backup + * may no longer exist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * The type of the restore source. + * + * Generated from protobuf field .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + * @return int + */ + public function getSourceType() + { + return $this->source_type; + } + + /** + * The type of the restore source. + * + * Generated from protobuf field .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + * @param int $var + * @return $this + */ + public function setSourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\RestoreSourceType::class); + $this->source_type = $var; + + return $this; + } + + /** + * Information about the backup used to restore the table. The backup + * may no longer exist. + * + * Generated from protobuf field .google.bigtable.admin.v2.BackupInfo backup_info = 2; + * @return \Google\Cloud\Bigtable\Admin\V2\BackupInfo|null + */ + public function getBackupInfo() + { + return $this->readOneof(2); + } + + public function hasBackupInfo() + { + return $this->hasOneof(2); + } + + /** + * Information about the backup used to restore the table. The backup + * may no longer exist. + * + * Generated from protobuf field .google.bigtable.admin.v2.BackupInfo backup_info = 2; + * @param \Google\Cloud\Bigtable\Admin\V2\BackupInfo $var + * @return $this + */ + public function setBackupInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\BackupInfo::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getSourceInfo() + { + return $this->whichOneof("source_info"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreSourceType.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreSourceType.php new file mode 100644 index 000000000000..f69bc82f8d8a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreSourceType.php @@ -0,0 +1,54 @@ +google.bigtable.admin.v2.RestoreSourceType + */ +class RestoreSourceType +{ + /** + * No restore associated. + * + * Generated from protobuf enum RESTORE_SOURCE_TYPE_UNSPECIFIED = 0; + */ + const RESTORE_SOURCE_TYPE_UNSPECIFIED = 0; + /** + * A backup was used as the source of the restore. + * + * Generated from protobuf enum BACKUP = 1; + */ + const BACKUP = 1; + + private static $valueToName = [ + self::RESTORE_SOURCE_TYPE_UNSPECIFIED => 'RESTORE_SOURCE_TYPE_UNSPECIFIED', + self::BACKUP => 'BACKUP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreTableMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreTableMetadata.php new file mode 100644 index 000000000000..c487dd2c61b1 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreTableMetadata.php @@ -0,0 +1,257 @@ +google.bigtable.admin.v2.RestoreTableMetadata + */ +class RestoreTableMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the table being created and restored to. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The type of the restore source. + * + * Generated from protobuf field .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + */ + protected $source_type = 0; + /** + * If exists, the name of the long-running operation that will be used to + * track the post-restore optimization process to optimize the performance of + * the restored table. The metadata type of the long-running operation is + * [OptimizeRestoreTableMetadata][]. The response type is + * [Empty][google.protobuf.Empty]. This long-running operation may be + * automatically created by the system if applicable after the + * RestoreTable long-running operation completes successfully. This operation + * may not be created if the table is already optimized or the restore was + * not successful. + * + * Generated from protobuf field string optimize_table_operation_name = 4; + */ + protected $optimize_table_operation_name = ''; + /** + * The progress of the + * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 5; + */ + protected $progress = null; + protected $source_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the table being created and restored to. + * @type int $source_type + * The type of the restore source. + * @type \Google\Cloud\Bigtable\Admin\V2\BackupInfo $backup_info + * @type string $optimize_table_operation_name + * If exists, the name of the long-running operation that will be used to + * track the post-restore optimization process to optimize the performance of + * the restored table. The metadata type of the long-running operation is + * [OptimizeRestoreTableMetadata][]. The response type is + * [Empty][google.protobuf.Empty]. This long-running operation may be + * automatically created by the system if applicable after the + * RestoreTable long-running operation completes successfully. This operation + * may not be created if the table is already optimized or the restore was + * not successful. + * @type \Google\Cloud\Bigtable\Admin\V2\OperationProgress $progress + * The progress of the + * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] + * operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Name of the table being created and restored to. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the table being created and restored to. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The type of the restore source. + * + * Generated from protobuf field .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + * @return int + */ + public function getSourceType() + { + return $this->source_type; + } + + /** + * The type of the restore source. + * + * Generated from protobuf field .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + * @param int $var + * @return $this + */ + public function setSourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\RestoreSourceType::class); + $this->source_type = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.bigtable.admin.v2.BackupInfo backup_info = 3; + * @return \Google\Cloud\Bigtable\Admin\V2\BackupInfo|null + */ + public function getBackupInfo() + { + return $this->readOneof(3); + } + + public function hasBackupInfo() + { + return $this->hasOneof(3); + } + + /** + * Generated from protobuf field .google.bigtable.admin.v2.BackupInfo backup_info = 3; + * @param \Google\Cloud\Bigtable\Admin\V2\BackupInfo $var + * @return $this + */ + public function setBackupInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\BackupInfo::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * If exists, the name of the long-running operation that will be used to + * track the post-restore optimization process to optimize the performance of + * the restored table. The metadata type of the long-running operation is + * [OptimizeRestoreTableMetadata][]. The response type is + * [Empty][google.protobuf.Empty]. This long-running operation may be + * automatically created by the system if applicable after the + * RestoreTable long-running operation completes successfully. This operation + * may not be created if the table is already optimized or the restore was + * not successful. + * + * Generated from protobuf field string optimize_table_operation_name = 4; + * @return string + */ + public function getOptimizeTableOperationName() + { + return $this->optimize_table_operation_name; + } + + /** + * If exists, the name of the long-running operation that will be used to + * track the post-restore optimization process to optimize the performance of + * the restored table. The metadata type of the long-running operation is + * [OptimizeRestoreTableMetadata][]. The response type is + * [Empty][google.protobuf.Empty]. This long-running operation may be + * automatically created by the system if applicable after the + * RestoreTable long-running operation completes successfully. This operation + * may not be created if the table is already optimized or the restore was + * not successful. + * + * Generated from protobuf field string optimize_table_operation_name = 4; + * @param string $var + * @return $this + */ + public function setOptimizeTableOperationName($var) + { + GPBUtil::checkString($var, True); + $this->optimize_table_operation_name = $var; + + return $this; + } + + /** + * The progress of the + * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 5; + * @return \Google\Cloud\Bigtable\Admin\V2\OperationProgress|null + */ + public function getProgress() + { + return $this->progress; + } + + public function hasProgress() + { + return isset($this->progress); + } + + public function clearProgress() + { + unset($this->progress); + } + + /** + * The progress of the + * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 5; + * @param \Google\Cloud\Bigtable\Admin\V2\OperationProgress $var + * @return $this + */ + public function setProgress($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\OperationProgress::class); + $this->progress = $var; + + return $this; + } + + /** + * @return string + */ + public function getSourceInfo() + { + return $this->whichOneof("source_info"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreTableRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreTableRequest.php new file mode 100644 index 000000000000..abdc023aa9c7 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/RestoreTableRequest.php @@ -0,0 +1,163 @@ +google.bigtable.admin.v2.RestoreTableRequest + */ +class RestoreTableRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the instance in which to create the restored + * table. Values are of the form `projects//instances/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The id of the table to create and restore to. This + * table must not already exist. The `table_id` appended to + * `parent` forms the full table name of the form + * `projects//instances//tables/`. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table_id = ''; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the instance in which to create the restored + * table. Values are of the form `projects//instances/`. + * @type string $table_id + * Required. The id of the table to create and restore to. This + * table must not already exist. The `table_id` appended to + * `parent` forms the full table name of the form + * `projects//instances//tables/`. + * @type string $backup + * Name of the backup from which to restore. Values are of the form + * `projects//instances//clusters//backups/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the instance in which to create the restored + * table. Values are of the form `projects//instances/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the instance in which to create the restored + * table. Values are of the form `projects//instances/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The id of the table to create and restore to. This + * table must not already exist. The `table_id` appended to + * `parent` forms the full table name of the form + * `projects//instances//tables/`. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTableId() + { + return $this->table_id; + } + + /** + * Required. The id of the table to create and restore to. This + * table must not already exist. The `table_id` appended to + * `parent` forms the full table name of the form + * `projects//instances//tables/`. + * + * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTableId($var) + { + GPBUtil::checkString($var, True); + $this->table_id = $var; + + return $this; + } + + /** + * Name of the backup from which to restore. Values are of the form + * `projects//instances//clusters//backups/`. + * + * Generated from protobuf field string backup = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getBackup() + { + return $this->readOneof(3); + } + + public function hasBackup() + { + return $this->hasOneof(3); + } + + /** + * Name of the backup from which to restore. Values are of the form + * `projects//instances//clusters//backups/`. + * + * Generated from protobuf field string backup = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Snapshot.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Snapshot.php new file mode 100644 index 000000000000..ed150a235f5b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Snapshot.php @@ -0,0 +1,334 @@ +google.bigtable.admin.v2.Snapshot + */ +class Snapshot extends \Google\Protobuf\Internal\Message +{ + /** + * The unique name of the snapshot. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The source table at the time the snapshot was taken. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $source_table = null; + /** + * Output only. The size of the data in the source table at the time the + * snapshot was taken. In some cases, this value may be computed + * asynchronously via a background process and a placeholder of 0 will be used + * in the meantime. + * + * Generated from protobuf field int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $data_size_bytes = 0; + /** + * Output only. The time when the snapshot is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * The time when the snapshot will be deleted. The maximum amount of time a + * snapshot can stay active is 365 days. If 'ttl' is not specified, + * the default maximum of 365 days will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; + */ + protected $delete_time = null; + /** + * Output only. The current state of the snapshot. + * + * Generated from protobuf field .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Description of the snapshot. + * + * Generated from protobuf field string description = 7; + */ + protected $description = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the snapshot. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @type \Google\Cloud\Bigtable\Admin\V2\Table $source_table + * Output only. The source table at the time the snapshot was taken. + * @type int|string $data_size_bytes + * Output only. The size of the data in the source table at the time the + * snapshot was taken. In some cases, this value may be computed + * asynchronously via a background process and a placeholder of 0 will be used + * in the meantime. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the snapshot is created. + * @type \Google\Protobuf\Timestamp $delete_time + * The time when the snapshot will be deleted. The maximum amount of time a + * snapshot can stay active is 365 days. If 'ttl' is not specified, + * the default maximum of 365 days will be used. + * @type int $state + * Output only. The current state of the snapshot. + * @type string $description + * Description of the snapshot. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * The unique name of the snapshot. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique name of the snapshot. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The source table at the time the snapshot was taken. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Bigtable\Admin\V2\Table|null + */ + public function getSourceTable() + { + return $this->source_table; + } + + public function hasSourceTable() + { + return isset($this->source_table); + } + + public function clearSourceTable() + { + unset($this->source_table); + } + + /** + * Output only. The source table at the time the snapshot was taken. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Bigtable\Admin\V2\Table $var + * @return $this + */ + public function setSourceTable($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Table::class); + $this->source_table = $var; + + return $this; + } + + /** + * Output only. The size of the data in the source table at the time the + * snapshot was taken. In some cases, this value may be computed + * asynchronously via a background process and a placeholder of 0 will be used + * in the meantime. + * + * Generated from protobuf field int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getDataSizeBytes() + { + return $this->data_size_bytes; + } + + /** + * Output only. The size of the data in the source table at the time the + * snapshot was taken. In some cases, this value may be computed + * asynchronously via a background process and a placeholder of 0 will be used + * in the meantime. + * + * Generated from protobuf field int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setDataSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->data_size_bytes = $var; + + return $this; + } + + /** + * Output only. The time when the snapshot is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the snapshot is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The time when the snapshot will be deleted. The maximum amount of time a + * snapshot can stay active is 365 days. If 'ttl' is not specified, + * the default maximum of 365 days will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * The time when the snapshot will be deleted. The maximum amount of time a + * snapshot can stay active is 365 days. If 'ttl' is not specified, + * the default maximum of 365 days will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. The current state of the snapshot. + * + * Generated from protobuf field .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the snapshot. + * + * Generated from protobuf field .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Snapshot\State::class); + $this->state = $var; + + return $this; + } + + /** + * Description of the snapshot. + * + * Generated from protobuf field string description = 7; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Description of the snapshot. + * + * Generated from protobuf field string description = 7; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Snapshot/State.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Snapshot/State.php new file mode 100644 index 000000000000..07c31a2775e2 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Snapshot/State.php @@ -0,0 +1,66 @@ +google.bigtable.admin.v2.Snapshot.State + */ +class State +{ + /** + * The state of the snapshot could not be determined. + * + * Generated from protobuf enum STATE_NOT_KNOWN = 0; + */ + const STATE_NOT_KNOWN = 0; + /** + * The snapshot has been successfully created and can serve all requests. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The snapshot is currently being created, and may be destroyed if the + * creation process encounters an error. A snapshot may not be restored to a + * table while it is being created. + * + * Generated from protobuf enum CREATING = 2; + */ + const CREATING = 2; + + private static $valueToName = [ + self::STATE_NOT_KNOWN => 'STATE_NOT_KNOWN', + self::READY => 'READY', + self::CREATING => 'CREATING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Bigtable\Admin\V2\Snapshot_State::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/SnapshotTableMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/SnapshotTableMetadata.php new file mode 100644 index 000000000000..62d29e1d1bfa --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/SnapshotTableMetadata.php @@ -0,0 +1,169 @@ +google.bigtable.admin.v2.SnapshotTableMetadata + */ +class SnapshotTableMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The request that prompted the initiation of this SnapshotTable operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + */ + protected $original_request = null; + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + */ + protected $request_time = null; + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + */ + protected $finish_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\SnapshotTableRequest $original_request + * The request that prompted the initiation of this SnapshotTable operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The request that prompted the initiation of this SnapshotTable operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\SnapshotTableRequest|null + */ + public function getOriginalRequest() + { + return $this->original_request; + } + + public function hasOriginalRequest() + { + return isset($this->original_request); + } + + public function clearOriginalRequest() + { + unset($this->original_request); + } + + /** + * The request that prompted the initiation of this SnapshotTable operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\SnapshotTableRequest $var + * @return $this + */ + public function setOriginalRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\SnapshotTableRequest::class); + $this->original_request = $var; + + return $this; + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRequestTime() + { + return $this->request_time; + } + + public function hasRequestTime() + { + return isset($this->request_time); + } + + public function clearRequestTime() + { + unset($this->request_time); + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRequestTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->request_time = $var; + + return $this; + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFinishTime() + { + return $this->finish_time; + } + + public function hasFinishTime() + { + return isset($this->finish_time); + } + + public function clearFinishTime() + { + unset($this->finish_time); + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFinishTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->finish_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/SnapshotTableRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/SnapshotTableRequest.php new file mode 100644 index 000000000000..007e4b8c67ae --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/SnapshotTableRequest.php @@ -0,0 +1,286 @@ +google.bigtable.admin.v2.SnapshotTableRequest + */ +class SnapshotTableRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the table to have the snapshot taken. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The name of the cluster where the snapshot will be created in. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $cluster = ''; + /** + * Required. The ID by which the new snapshot should be referred to within the + * parent cluster, e.g., `mysnapshot` of the form: + * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + * + * Generated from protobuf field string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snapshot_id = ''; + /** + * The amount of time that the new snapshot can stay active after it is + * created. Once 'ttl' expires, the snapshot will get deleted. The maximum + * amount of time a snapshot can stay active is 7 days. If 'ttl' is not + * specified, the default value of 24 hours will be used. + * + * Generated from protobuf field .google.protobuf.Duration ttl = 4; + */ + protected $ttl = null; + /** + * Description of the snapshot. + * + * Generated from protobuf field string description = 5; + */ + protected $description = ''; + + /** + * @param string $name Required. The unique name of the table to have the snapshot taken. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. Please see + * {@see BigtableTableAdminClient::tableName()} for help formatting this field. + * @param string $cluster Required. The name of the cluster where the snapshot will be created in. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. Please see + * {@see BigtableTableAdminClient::clusterName()} for help formatting this field. + * @param string $snapshotId Required. The ID by which the new snapshot should be referred to within the + * parent cluster, e.g., `mysnapshot` of the form: + * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + * @param string $description Description of the snapshot. + * + * @return \Google\Cloud\Bigtable\Admin\V2\SnapshotTableRequest + * + * @experimental + */ + public static function build(string $name, string $cluster, string $snapshotId, string $description): self + { + return (new self()) + ->setName($name) + ->setCluster($cluster) + ->setSnapshotId($snapshotId) + ->setDescription($description); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the table to have the snapshot taken. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @type string $cluster + * Required. The name of the cluster where the snapshot will be created in. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @type string $snapshot_id + * Required. The ID by which the new snapshot should be referred to within the + * parent cluster, e.g., `mysnapshot` of the form: + * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + * @type \Google\Protobuf\Duration $ttl + * The amount of time that the new snapshot can stay active after it is + * created. Once 'ttl' expires, the snapshot will get deleted. The maximum + * amount of time a snapshot can stay active is 7 days. If 'ttl' is not + * specified, the default value of 24 hours will be used. + * @type string $description + * Description of the snapshot. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the table to have the snapshot taken. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the table to have the snapshot taken. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of the cluster where the snapshot will be created in. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getCluster() + { + return $this->cluster; + } + + /** + * Required. The name of the cluster where the snapshot will be created in. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkString($var, True); + $this->cluster = $var; + + return $this; + } + + /** + * Required. The ID by which the new snapshot should be referred to within the + * parent cluster, e.g., `mysnapshot` of the form: + * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + * + * Generated from protobuf field string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSnapshotId() + { + return $this->snapshot_id; + } + + /** + * Required. The ID by which the new snapshot should be referred to within the + * parent cluster, e.g., `mysnapshot` of the form: + * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + * + * Generated from protobuf field string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSnapshotId($var) + { + GPBUtil::checkString($var, True); + $this->snapshot_id = $var; + + return $this; + } + + /** + * The amount of time that the new snapshot can stay active after it is + * created. Once 'ttl' expires, the snapshot will get deleted. The maximum + * amount of time a snapshot can stay active is 7 days. If 'ttl' is not + * specified, the default value of 24 hours will be used. + * + * Generated from protobuf field .google.protobuf.Duration ttl = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getTtl() + { + return $this->ttl; + } + + public function hasTtl() + { + return isset($this->ttl); + } + + public function clearTtl() + { + unset($this->ttl); + } + + /** + * The amount of time that the new snapshot can stay active after it is + * created. Once 'ttl' expires, the snapshot will get deleted. The maximum + * amount of time a snapshot can stay active is 7 days. If 'ttl' is not + * specified, the default value of 24 hours will be used. + * + * Generated from protobuf field .google.protobuf.Duration ttl = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTtl($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->ttl = $var; + + return $this; + } + + /** + * Description of the snapshot. + * + * Generated from protobuf field string description = 5; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Description of the snapshot. + * + * Generated from protobuf field string description = 5; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/StandardReadRemoteWrites.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/StandardReadRemoteWrites.php new file mode 100644 index 000000000000..bc59f6b84f19 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/StandardReadRemoteWrites.php @@ -0,0 +1,34 @@ +google.bigtable.admin.v2.StandardReadRemoteWrites + */ +class StandardReadRemoteWrites extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/StorageType.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/StorageType.php new file mode 100644 index 000000000000..9bc95b2df390 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/StorageType.php @@ -0,0 +1,61 @@ +google.bigtable.admin.v2.StorageType + */ +class StorageType +{ + /** + * The user did not specify a storage type. + * + * Generated from protobuf enum STORAGE_TYPE_UNSPECIFIED = 0; + */ + const STORAGE_TYPE_UNSPECIFIED = 0; + /** + * Flash (SSD) storage should be used. + * + * Generated from protobuf enum SSD = 1; + */ + const SSD = 1; + /** + * Magnetic drive (HDD) storage should be used. + * + * Generated from protobuf enum HDD = 2; + */ + const HDD = 2; + + private static $valueToName = [ + self::STORAGE_TYPE_UNSPECIFIED => 'STORAGE_TYPE_UNSPECIFIED', + self::SSD => 'SSD', + self::HDD => 'HDD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table.php new file mode 100644 index 000000000000..046130e31c1a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table.php @@ -0,0 +1,409 @@ +google.bigtable.admin.v2.Table + */ +class Table extends \Google\Protobuf\Internal\Message +{ + /** + * The unique name of the table. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. Map from cluster ID to per-cluster table state. + * If it could not be determined whether or not the table has data in a + * particular cluster (for example, if its zone is unavailable), then + * there will be an entry for the cluster with UNKNOWN `replication_status`. + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` + * + * Generated from protobuf field map cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $cluster_states; + /** + * The column families configured for this table, mapped by column family ID. + * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL` + * + * Generated from protobuf field map column_families = 3; + */ + private $column_families; + /** + * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored + * in this table. Timestamps not matching the granularity will be rejected. If + * unspecified at creation time, the value will be set to `MILLIS`. Views: + * `SCHEMA_VIEW`, `FULL`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $granularity = 0; + /** + * Output only. If this table was restored from another data source (e.g. a + * backup), this field will be populated with information about the restore. + * + * Generated from protobuf field .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $restore_info = null; + /** + * If specified, enable the change stream on this table. + * Otherwise, the change stream is disabled and the change stream is not + * retained. + * + * Generated from protobuf field .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + protected $change_stream_config = null; + /** + * Set to true to make the table protected against data loss. i.e. deleting + * the following resources through Admin APIs are prohibited: + * * The table. + * * The column families in the table. + * * The instance containing the table. + * Note one can still delete the data stored in the table through Data APIs. + * + * Generated from protobuf field bool deletion_protection = 9; + */ + protected $deletion_protection = false; + protected $automated_backup_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the table. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` + * @type array|\Google\Protobuf\Internal\MapField $cluster_states + * Output only. Map from cluster ID to per-cluster table state. + * If it could not be determined whether or not the table has data in a + * particular cluster (for example, if its zone is unavailable), then + * there will be an entry for the cluster with UNKNOWN `replication_status`. + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` + * @type array|\Google\Protobuf\Internal\MapField $column_families + * The column families configured for this table, mapped by column family ID. + * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL` + * @type int $granularity + * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored + * in this table. Timestamps not matching the granularity will be rejected. If + * unspecified at creation time, the value will be set to `MILLIS`. Views: + * `SCHEMA_VIEW`, `FULL`. + * @type \Google\Cloud\Bigtable\Admin\V2\RestoreInfo $restore_info + * Output only. If this table was restored from another data source (e.g. a + * backup), this field will be populated with information about the restore. + * @type \Google\Cloud\Bigtable\Admin\V2\ChangeStreamConfig $change_stream_config + * If specified, enable the change stream on this table. + * Otherwise, the change stream is disabled and the change stream is not + * retained. + * @type bool $deletion_protection + * Set to true to make the table protected against data loss. i.e. deleting + * the following resources through Admin APIs are prohibited: + * * The table. + * * The column families in the table. + * * The instance containing the table. + * Note one can still delete the data stored in the table through Data APIs. + * @type \Google\Cloud\Bigtable\Admin\V2\Table\AutomatedBackupPolicy $automated_backup_policy + * If specified, automated backups are enabled for this table. + * Otherwise, automated backups are disabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * The unique name of the table. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique name of the table. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Map from cluster ID to per-cluster table state. + * If it could not be determined whether or not the table has data in a + * particular cluster (for example, if its zone is unavailable), then + * there will be an entry for the cluster with UNKNOWN `replication_status`. + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` + * + * Generated from protobuf field map cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getClusterStates() + { + return $this->cluster_states; + } + + /** + * Output only. Map from cluster ID to per-cluster table state. + * If it could not be determined whether or not the table has data in a + * particular cluster (for example, if its zone is unavailable), then + * there will be an entry for the cluster with UNKNOWN `replication_status`. + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` + * + * Generated from protobuf field map cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setClusterStates($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Table\ClusterState::class); + $this->cluster_states = $arr; + + return $this; + } + + /** + * The column families configured for this table, mapped by column family ID. + * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL` + * + * Generated from protobuf field map column_families = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getColumnFamilies() + { + return $this->column_families; + } + + /** + * The column families configured for this table, mapped by column family ID. + * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL` + * + * Generated from protobuf field map column_families = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setColumnFamilies($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\ColumnFamily::class); + $this->column_families = $arr; + + return $this; + } + + /** + * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored + * in this table. Timestamps not matching the granularity will be rejected. If + * unspecified at creation time, the value will be set to `MILLIS`. Views: + * `SCHEMA_VIEW`, `FULL`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getGranularity() + { + return $this->granularity; + } + + /** + * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored + * in this table. Timestamps not matching the granularity will be rejected. If + * unspecified at creation time, the value will be set to `MILLIS`. Views: + * `SCHEMA_VIEW`, `FULL`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setGranularity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Table\TimestampGranularity::class); + $this->granularity = $var; + + return $this; + } + + /** + * Output only. If this table was restored from another data source (e.g. a + * backup), this field will be populated with information about the restore. + * + * Generated from protobuf field .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Bigtable\Admin\V2\RestoreInfo|null + */ + public function getRestoreInfo() + { + return $this->restore_info; + } + + public function hasRestoreInfo() + { + return isset($this->restore_info); + } + + public function clearRestoreInfo() + { + unset($this->restore_info); + } + + /** + * Output only. If this table was restored from another data source (e.g. a + * backup), this field will be populated with information about the restore. + * + * Generated from protobuf field .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Bigtable\Admin\V2\RestoreInfo $var + * @return $this + */ + public function setRestoreInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\RestoreInfo::class); + $this->restore_info = $var; + + return $this; + } + + /** + * If specified, enable the change stream on this table. + * Otherwise, the change stream is disabled and the change stream is not + * retained. + * + * Generated from protobuf field .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * @return \Google\Cloud\Bigtable\Admin\V2\ChangeStreamConfig|null + */ + public function getChangeStreamConfig() + { + return $this->change_stream_config; + } + + public function hasChangeStreamConfig() + { + return isset($this->change_stream_config); + } + + public function clearChangeStreamConfig() + { + unset($this->change_stream_config); + } + + /** + * If specified, enable the change stream on this table. + * Otherwise, the change stream is disabled and the change stream is not + * retained. + * + * Generated from protobuf field .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * @param \Google\Cloud\Bigtable\Admin\V2\ChangeStreamConfig $var + * @return $this + */ + public function setChangeStreamConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\ChangeStreamConfig::class); + $this->change_stream_config = $var; + + return $this; + } + + /** + * Set to true to make the table protected against data loss. i.e. deleting + * the following resources through Admin APIs are prohibited: + * * The table. + * * The column families in the table. + * * The instance containing the table. + * Note one can still delete the data stored in the table through Data APIs. + * + * Generated from protobuf field bool deletion_protection = 9; + * @return bool + */ + public function getDeletionProtection() + { + return $this->deletion_protection; + } + + /** + * Set to true to make the table protected against data loss. i.e. deleting + * the following resources through Admin APIs are prohibited: + * * The table. + * * The column families in the table. + * * The instance containing the table. + * Note one can still delete the data stored in the table through Data APIs. + * + * Generated from protobuf field bool deletion_protection = 9; + * @param bool $var + * @return $this + */ + public function setDeletionProtection($var) + { + GPBUtil::checkBool($var); + $this->deletion_protection = $var; + + return $this; + } + + /** + * If specified, automated backups are enabled for this table. + * Otherwise, automated backups are disabled. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * @return \Google\Cloud\Bigtable\Admin\V2\Table\AutomatedBackupPolicy|null + */ + public function getAutomatedBackupPolicy() + { + return $this->readOneof(13); + } + + public function hasAutomatedBackupPolicy() + { + return $this->hasOneof(13); + } + + /** + * If specified, automated backups are enabled for this table. + * Otherwise, automated backups are disabled. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * @param \Google\Cloud\Bigtable\Admin\V2\Table\AutomatedBackupPolicy $var + * @return $this + */ + public function setAutomatedBackupPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Table\AutomatedBackupPolicy::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * @return string + */ + public function getAutomatedBackupConfig() + { + return $this->whichOneof("automated_backup_config"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/AutomatedBackupPolicy.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/AutomatedBackupPolicy.php new file mode 100644 index 000000000000..4befbef5a7dd --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/AutomatedBackupPolicy.php @@ -0,0 +1,132 @@ +google.bigtable.admin.v2.Table.AutomatedBackupPolicy + */ +class AutomatedBackupPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Required. How long the automated backups should be retained. The only + * supported value at this time is 3 days. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $retention_period = null; + /** + * Required. How frequently automated backups should occur. The only + * supported value at this time is 24 hours. + * + * Generated from protobuf field .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $frequency = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $retention_period + * Required. How long the automated backups should be retained. The only + * supported value at this time is 3 days. + * @type \Google\Protobuf\Duration $frequency + * Required. How frequently automated backups should occur. The only + * supported value at this time is 24 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Required. How long the automated backups should be retained. The only + * supported value at this time is 3 days. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getRetentionPeriod() + { + return $this->retention_period; + } + + public function hasRetentionPeriod() + { + return isset($this->retention_period); + } + + public function clearRetentionPeriod() + { + unset($this->retention_period); + } + + /** + * Required. How long the automated backups should be retained. The only + * supported value at this time is 3 days. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRetentionPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->retention_period = $var; + + return $this; + } + + /** + * Required. How frequently automated backups should occur. The only + * supported value at this time is 24 hours. + * + * Generated from protobuf field .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getFrequency() + { + return $this->frequency; + } + + public function hasFrequency() + { + return isset($this->frequency); + } + + public function clearFrequency() + { + unset($this->frequency); + } + + /** + * Required. How frequently automated backups should occur. The only + * supported value at this time is 24 hours. + * + * Generated from protobuf field .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setFrequency($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->frequency = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AutomatedBackupPolicy::class, \Google\Cloud\Bigtable\Admin\V2\Table_AutomatedBackupPolicy::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/ClusterState.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/ClusterState.php new file mode 100644 index 000000000000..73802c4ea588 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/ClusterState.php @@ -0,0 +1,120 @@ +google.bigtable.admin.v2.Table.ClusterState + */ +class ClusterState extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The state of replication for the table in this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $replication_state = 0; + /** + * Output only. The encryption information for the table in this cluster. + * If the encryption key protecting this resource is customer managed, then + * its version can be rotated in Cloud Key Management Service (Cloud KMS). + * The primary version of the key and its status will be reflected here when + * changes propagate from Cloud KMS. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $encryption_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $replication_state + * Output only. The state of replication for the table in this cluster. + * @type array<\Google\Cloud\Bigtable\Admin\V2\EncryptionInfo>|\Google\Protobuf\Internal\RepeatedField $encryption_info + * Output only. The encryption information for the table in this cluster. + * If the encryption key protecting this resource is customer managed, then + * its version can be rotated in Cloud Key Management Service (Cloud KMS). + * The primary version of the key and its status will be reflected here when + * changes propagate from Cloud KMS. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The state of replication for the table in this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getReplicationState() + { + return $this->replication_state; + } + + /** + * Output only. The state of replication for the table in this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setReplicationState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Table\ClusterState\ReplicationState::class); + $this->replication_state = $var; + + return $this; + } + + /** + * Output only. The encryption information for the table in this cluster. + * If the encryption key protecting this resource is customer managed, then + * its version can be rotated in Cloud Key Management Service (Cloud KMS). + * The primary version of the key and its status will be reflected here when + * changes propagate from Cloud KMS. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEncryptionInfo() + { + return $this->encryption_info; + } + + /** + * Output only. The encryption information for the table in this cluster. + * If the encryption key protecting this resource is customer managed, then + * its version can be rotated in Cloud Key Management Service (Cloud KMS). + * The primary version of the key and its status will be reflected here when + * changes propagate from Cloud KMS. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Bigtable\Admin\V2\EncryptionInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEncryptionInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\EncryptionInfo::class); + $this->encryption_info = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ClusterState::class, \Google\Cloud\Bigtable\Admin\V2\Table_ClusterState::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/ClusterState/ReplicationState.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/ClusterState/ReplicationState.php new file mode 100644 index 000000000000..483a7181036d --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/ClusterState/ReplicationState.php @@ -0,0 +1,93 @@ +google.bigtable.admin.v2.Table.ClusterState.ReplicationState + */ +class ReplicationState +{ + /** + * The replication state of the table is unknown in this cluster. + * + * Generated from protobuf enum STATE_NOT_KNOWN = 0; + */ + const STATE_NOT_KNOWN = 0; + /** + * The cluster was recently created, and the table must finish copying + * over pre-existing data from other clusters before it can begin + * receiving live replication updates and serving Data API requests. + * + * Generated from protobuf enum INITIALIZING = 1; + */ + const INITIALIZING = 1; + /** + * The table is temporarily unable to serve Data API requests from this + * cluster due to planned internal maintenance. + * + * Generated from protobuf enum PLANNED_MAINTENANCE = 2; + */ + const PLANNED_MAINTENANCE = 2; + /** + * The table is temporarily unable to serve Data API requests from this + * cluster due to unplanned or emergency maintenance. + * + * Generated from protobuf enum UNPLANNED_MAINTENANCE = 3; + */ + const UNPLANNED_MAINTENANCE = 3; + /** + * The table can serve Data API requests from this cluster. Depending on + * replication delay, reads may not immediately reflect the state of the + * table in other clusters. + * + * Generated from protobuf enum READY = 4; + */ + const READY = 4; + /** + * The table is fully created and ready for use after a restore, and is + * being optimized for performance. When optimizations are complete, the + * table will transition to `READY` state. + * + * Generated from protobuf enum READY_OPTIMIZING = 5; + */ + const READY_OPTIMIZING = 5; + + private static $valueToName = [ + self::STATE_NOT_KNOWN => 'STATE_NOT_KNOWN', + self::INITIALIZING => 'INITIALIZING', + self::PLANNED_MAINTENANCE => 'PLANNED_MAINTENANCE', + self::UNPLANNED_MAINTENANCE => 'UNPLANNED_MAINTENANCE', + self::READY => 'READY', + self::READY_OPTIMIZING => 'READY_OPTIMIZING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReplicationState::class, \Google\Cloud\Bigtable\Admin\V2\Table_ClusterState_ReplicationState::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/TimestampGranularity.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/TimestampGranularity.php new file mode 100644 index 000000000000..67b1b6d1f95f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/TimestampGranularity.php @@ -0,0 +1,59 @@ +google.bigtable.admin.v2.Table.TimestampGranularity + */ +class TimestampGranularity +{ + /** + * The user did not specify a granularity. Should not be returned. + * When specified during table creation, MILLIS will be used. + * + * Generated from protobuf enum TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; + */ + const TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; + /** + * The table keeps data versioned at a granularity of 1ms. + * + * Generated from protobuf enum MILLIS = 1; + */ + const MILLIS = 1; + + private static $valueToName = [ + self::TIMESTAMP_GRANULARITY_UNSPECIFIED => 'TIMESTAMP_GRANULARITY_UNSPECIFIED', + self::MILLIS => 'MILLIS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TimestampGranularity::class, \Google\Cloud\Bigtable\Admin\V2\Table_TimestampGranularity::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/View.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/View.php new file mode 100644 index 000000000000..f2355cc4aa83 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Table/View.php @@ -0,0 +1,86 @@ +google.bigtable.admin.v2.Table.View + */ +class View +{ + /** + * Uses the default view for each method as documented in its request. + * + * Generated from protobuf enum VIEW_UNSPECIFIED = 0; + */ + const VIEW_UNSPECIFIED = 0; + /** + * Only populates `name`. + * + * Generated from protobuf enum NAME_ONLY = 1; + */ + const NAME_ONLY = 1; + /** + * Only populates `name` and fields related to the table's schema. + * + * Generated from protobuf enum SCHEMA_VIEW = 2; + */ + const SCHEMA_VIEW = 2; + /** + * Only populates `name` and fields related to the table's replication + * state. + * + * Generated from protobuf enum REPLICATION_VIEW = 3; + */ + const REPLICATION_VIEW = 3; + /** + * Only populates `name` and fields related to the table's encryption state. + * + * Generated from protobuf enum ENCRYPTION_VIEW = 5; + */ + const ENCRYPTION_VIEW = 5; + /** + * Populates all fields. + * + * Generated from protobuf enum FULL = 4; + */ + const FULL = 4; + + private static $valueToName = [ + self::VIEW_UNSPECIFIED => 'VIEW_UNSPECIFIED', + self::NAME_ONLY => 'NAME_ONLY', + self::SCHEMA_VIEW => 'SCHEMA_VIEW', + self::REPLICATION_VIEW => 'REPLICATION_VIEW', + self::ENCRYPTION_VIEW => 'ENCRYPTION_VIEW', + self::FULL => 'FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(View::class, \Google\Cloud\Bigtable\Admin\V2\Table_View::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type.php new file mode 100644 index 000000000000..f1625dfd8270 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type.php @@ -0,0 +1,458 @@ + INT64(-1)`, but `STRING("-00001") > STRING("00001)`. + * * Self-delimiting: If we concatenate two encoded values, can we always tell + * where the first one ends and the second one begins? + * - Example: If we encode INT64s to fixed-width STRINGs, the first value + * will always contain exactly N digits, possibly preceded by a sign. + * - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have + * no way to tell where the first one ends. + * * Compatibility: Which other systems have matching encoding schemes? For + * example, does this encoding have a GoogleSQL equivalent? HBase? Java? + * + * Generated from protobuf message google.bigtable.admin.v2.Type + */ +class Type extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Bytes $bytes_type + * Bytes + * @type \Google\Cloud\Bigtable\Admin\V2\Type\PBString $string_type + * String + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Int64 $int64_type + * Int64 + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Float32 $float32_type + * Float32 + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Float64 $float64_type + * Float64 + * @type \Google\Cloud\Bigtable\Admin\V2\Type\PBBool $bool_type + * Bool + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Timestamp $timestamp_type + * Timestamp + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Date $date_type + * Date + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate $aggregate_type + * Aggregate + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Struct $struct_type + * Struct + * @type \Google\Cloud\Bigtable\Admin\V2\Type\PBArray $array_type + * Array + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Map $map_type + * Map + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Bytes + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Bytes|null + */ + public function getBytesType() + { + return $this->readOneof(1); + } + + public function hasBytesType() + { + return $this->hasOneof(1); + } + + /** + * Bytes + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Bytes $var + * @return $this + */ + public function setBytesType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Bytes::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * String + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String string_type = 2; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\PBString|null + */ + public function getStringType() + { + return $this->readOneof(2); + } + + public function hasStringType() + { + return $this->hasOneof(2); + } + + /** + * String + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String string_type = 2; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\PBString $var + * @return $this + */ + public function setStringType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\PBString::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Int64 + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Int64|null + */ + public function getInt64Type() + { + return $this->readOneof(5); + } + + public function hasInt64Type() + { + return $this->hasOneof(5); + } + + /** + * Int64 + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Int64 $var + * @return $this + */ + public function setInt64Type($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Int64::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Float32 + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Float32|null + */ + public function getFloat32Type() + { + return $this->readOneof(12); + } + + public function hasFloat32Type() + { + return $this->hasOneof(12); + } + + /** + * Float32 + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Float32 $var + * @return $this + */ + public function setFloat32Type($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Float32::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Float64 + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Float64|null + */ + public function getFloat64Type() + { + return $this->readOneof(9); + } + + public function hasFloat64Type() + { + return $this->hasOneof(9); + } + + /** + * Float64 + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Float64 $var + * @return $this + */ + public function setFloat64Type($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Float64::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Bool + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bool bool_type = 8; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\PBBool|null + */ + public function getBoolType() + { + return $this->readOneof(8); + } + + public function hasBoolType() + { + return $this->hasOneof(8); + } + + /** + * Bool + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bool bool_type = 8; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\PBBool $var + * @return $this + */ + public function setBoolType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\PBBool::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Timestamp + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Timestamp|null + */ + public function getTimestampType() + { + return $this->readOneof(10); + } + + public function hasTimestampType() + { + return $this->hasOneof(10); + } + + /** + * Timestamp + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Timestamp $var + * @return $this + */ + public function setTimestampType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Timestamp::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Date + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Date date_type = 11; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Date|null + */ + public function getDateType() + { + return $this->readOneof(11); + } + + public function hasDateType() + { + return $this->hasOneof(11); + } + + /** + * Date + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Date date_type = 11; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Date $var + * @return $this + */ + public function setDateType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Date::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Aggregate + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate|null + */ + public function getAggregateType() + { + return $this->readOneof(6); + } + + public function hasAggregateType() + { + return $this->hasOneof(6); + } + + /** + * Aggregate + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate $var + * @return $this + */ + public function setAggregateType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Struct + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Struct struct_type = 7; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Struct|null + */ + public function getStructType() + { + return $this->readOneof(7); + } + + public function hasStructType() + { + return $this->hasOneof(7); + } + + /** + * Struct + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Struct struct_type = 7; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Struct $var + * @return $this + */ + public function setStructType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Struct::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Array + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Array array_type = 3; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\PBArray|null + */ + public function getArrayType() + { + return $this->readOneof(3); + } + + public function hasArrayType() + { + return $this->hasOneof(3); + } + + /** + * Array + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Array array_type = 3; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\PBArray $var + * @return $this + */ + public function setArrayType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\PBArray::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Map + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Map map_type = 4; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Map|null + */ + public function getMapType() + { + return $this->readOneof(4); + } + + public function hasMapType() + { + return $this->hasOneof(4); + } + + /** + * Map + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Map map_type = 4; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Map $var + * @return $this + */ + public function setMapType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Map::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate.php new file mode 100644 index 000000000000..9c28110eabb3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate.php @@ -0,0 +1,284 @@ +google.bigtable.admin.v2.Type.Aggregate + */ +class Aggregate extends \Google\Protobuf\Internal\Message +{ + /** + * Type of the inputs that are accumulated by this `Aggregate`, which must + * specify a full encoding. + * Use `AddInput` mutations to accumulate new inputs. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type input_type = 1; + */ + protected $input_type = null; + /** + * Output only. Type that holds the internal accumulator state for the + * `Aggregate`. This is a function of the `input_type` and `aggregator` + * chosen, and will always specify a full encoding. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state_type = null; + protected $aggregator; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type $input_type + * Type of the inputs that are accumulated by this `Aggregate`, which must + * specify a full encoding. + * Use `AddInput` mutations to accumulate new inputs. + * @type \Google\Cloud\Bigtable\Admin\V2\Type $state_type + * Output only. Type that holds the internal accumulator state for the + * `Aggregate`. This is a function of the `input_type` and `aggregator` + * chosen, and will always specify a full encoding. + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Sum $sum + * Sum aggregator. + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount $hllpp_unique_count + * HyperLogLogPlusPlusUniqueCount aggregator. + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Max $max + * Max aggregator. + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Min $min + * Min aggregator. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Type of the inputs that are accumulated by this `Aggregate`, which must + * specify a full encoding. + * Use `AddInput` mutations to accumulate new inputs. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type input_type = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type|null + */ + public function getInputType() + { + return $this->input_type; + } + + public function hasInputType() + { + return isset($this->input_type); + } + + public function clearInputType() + { + unset($this->input_type); + } + + /** + * Type of the inputs that are accumulated by this `Aggregate`, which must + * specify a full encoding. + * Use `AddInput` mutations to accumulate new inputs. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type input_type = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type $var + * @return $this + */ + public function setInputType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type::class); + $this->input_type = $var; + + return $this; + } + + /** + * Output only. Type that holds the internal accumulator state for the + * `Aggregate`. This is a function of the `input_type` and `aggregator` + * chosen, and will always specify a full encoding. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Bigtable\Admin\V2\Type|null + */ + public function getStateType() + { + return $this->state_type; + } + + public function hasStateType() + { + return isset($this->state_type); + } + + public function clearStateType() + { + unset($this->state_type); + } + + /** + * Output only. Type that holds the internal accumulator state for the + * `Aggregate`. This is a function of the `input_type` and `aggregator` + * chosen, and will always specify a full encoding. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Bigtable\Admin\V2\Type $var + * @return $this + */ + public function setStateType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type::class); + $this->state_type = $var; + + return $this; + } + + /** + * Sum aggregator. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Sum|null + */ + public function getSum() + { + return $this->readOneof(4); + } + + public function hasSum() + { + return $this->hasOneof(4); + } + + /** + * Sum aggregator. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Sum $var + * @return $this + */ + public function setSum($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Sum::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * HyperLogLogPlusPlusUniqueCount aggregator. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount|null + */ + public function getHllppUniqueCount() + { + return $this->readOneof(5); + } + + public function hasHllppUniqueCount() + { + return $this->hasOneof(5); + } + + /** + * HyperLogLogPlusPlusUniqueCount aggregator. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount $var + * @return $this + */ + public function setHllppUniqueCount($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Max aggregator. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Max|null + */ + public function getMax() + { + return $this->readOneof(6); + } + + public function hasMax() + { + return $this->hasOneof(6); + } + + /** + * Max aggregator. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Max $var + * @return $this + */ + public function setMax($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Max::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Min aggregator. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Min|null + */ + public function getMin() + { + return $this->readOneof(7); + } + + public function hasMin() + { + return $this->hasOneof(7); + } + + /** + * Min aggregator. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Min $var + * @return $this + */ + public function setMin($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate\Min::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getAggregator() + { + return $this->whichOneof("aggregator"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Aggregate::class, \Google\Cloud\Bigtable\Admin\V2\Type_Aggregate::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/HyperLogLogPlusPlusUniqueCount.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/HyperLogLogPlusPlusUniqueCount.php new file mode 100644 index 000000000000..1c9423fe762e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/HyperLogLogPlusPlusUniqueCount.php @@ -0,0 +1,42 @@ +google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + */ +class HyperLogLogPlusPlusUniqueCount extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HyperLogLogPlusPlusUniqueCount::class, \Google\Cloud\Bigtable\Admin\V2\Type_Aggregate_HyperLogLogPlusPlusUniqueCount::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/Max.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/Max.php new file mode 100644 index 000000000000..a1ebe235ad1e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/Max.php @@ -0,0 +1,38 @@ +google.bigtable.admin.v2.Type.Aggregate.Max + */ +class Max extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Max::class, \Google\Cloud\Bigtable\Admin\V2\Type_Aggregate_Max::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/Min.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/Min.php new file mode 100644 index 000000000000..a9adbf1cddd1 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/Min.php @@ -0,0 +1,38 @@ +google.bigtable.admin.v2.Type.Aggregate.Min + */ +class Min extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Min::class, \Google\Cloud\Bigtable\Admin\V2\Type_Aggregate_Min::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/Sum.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/Sum.php new file mode 100644 index 000000000000..209569e18bcc --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Aggregate/Sum.php @@ -0,0 +1,38 @@ +google.bigtable.admin.v2.Type.Aggregate.Sum + */ +class Sum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Sum::class, \Google\Cloud\Bigtable\Admin\V2\Type_Aggregate_Sum::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Bytes.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Bytes.php new file mode 100644 index 000000000000..8bd21135affc --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Bytes.php @@ -0,0 +1,81 @@ +google.bigtable.admin.v2.Type.Bytes + */ +class Bytes extends \Google\Protobuf\Internal\Message +{ + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + */ + protected $encoding = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Bytes\Encoding $encoding + * The encoding to use when converting to/from lower level types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Bytes\Encoding|null + */ + public function getEncoding() + { + return $this->encoding; + } + + public function hasEncoding() + { + return isset($this->encoding); + } + + public function clearEncoding() + { + unset($this->encoding); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Bytes\Encoding $var + * @return $this + */ + public function setEncoding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Bytes\Encoding::class); + $this->encoding = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Bytes::class, \Google\Cloud\Bigtable\Admin\V2\Type_Bytes::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Bytes/Encoding.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Bytes/Encoding.php new file mode 100644 index 000000000000..4f4ea68391c9 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Bytes/Encoding.php @@ -0,0 +1,78 @@ +google.bigtable.admin.v2.Type.Bytes.Encoding + */ +class Encoding extends \Google\Protobuf\Internal\Message +{ + protected $encoding; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Bytes\Encoding\Raw $raw + * Use `Raw` encoding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Use `Raw` encoding. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Bytes\Encoding\Raw|null + */ + public function getRaw() + { + return $this->readOneof(1); + } + + public function hasRaw() + { + return $this->hasOneof(1); + } + + /** + * Use `Raw` encoding. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Bytes\Encoding\Raw $var + * @return $this + */ + public function setRaw($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Bytes\Encoding\Raw::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getEncoding() + { + return $this->whichOneof("encoding"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Encoding::class, \Google\Cloud\Bigtable\Admin\V2\Type_Bytes_Encoding::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Bytes/Encoding/Raw.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Bytes/Encoding/Raw.php new file mode 100644 index 000000000000..11d29486138a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Bytes/Encoding/Raw.php @@ -0,0 +1,39 @@ +google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + */ +class Raw extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Raw::class, \Google\Cloud\Bigtable\Admin\V2\Type_Bytes_Encoding_Raw::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Date.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Date.php new file mode 100644 index 000000000000..45c6dfa345e8 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Date.php @@ -0,0 +1,37 @@ +google.bigtable.admin.v2.Type.Date + */ +class Date extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Date::class, \Google\Cloud\Bigtable\Admin\V2\Type_Date::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Float32.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Float32.php new file mode 100644 index 000000000000..adedacc80961 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Float32.php @@ -0,0 +1,37 @@ +google.bigtable.admin.v2.Type.Float32 + */ +class Float32 extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Float32::class, \Google\Cloud\Bigtable\Admin\V2\Type_Float32::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Float64.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Float64.php new file mode 100644 index 000000000000..d28be7adc3a9 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Float64.php @@ -0,0 +1,37 @@ +google.bigtable.admin.v2.Type.Float64 + */ +class Float64 extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Float64::class, \Google\Cloud\Bigtable\Admin\V2\Type_Float64::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Int64.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Int64.php new file mode 100644 index 000000000000..90641966f566 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Int64.php @@ -0,0 +1,81 @@ +google.bigtable.admin.v2.Type.Int64 + */ +class Int64 extends \Google\Protobuf\Internal\Message +{ + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + */ + protected $encoding = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Int64\Encoding $encoding + * The encoding to use when converting to/from lower level types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Int64\Encoding|null + */ + public function getEncoding() + { + return $this->encoding; + } + + public function hasEncoding() + { + return isset($this->encoding); + } + + public function clearEncoding() + { + unset($this->encoding); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Int64\Encoding $var + * @return $this + */ + public function setEncoding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Int64\Encoding::class); + $this->encoding = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Int64::class, \Google\Cloud\Bigtable\Admin\V2\Type_Int64::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Int64/Encoding.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Int64/Encoding.php new file mode 100644 index 000000000000..6a18aa7783f8 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Int64/Encoding.php @@ -0,0 +1,78 @@ +google.bigtable.admin.v2.Type.Int64.Encoding + */ +class Encoding extends \Google\Protobuf\Internal\Message +{ + protected $encoding; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Int64\Encoding\BigEndianBytes $big_endian_bytes + * Use `BigEndianBytes` encoding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Use `BigEndianBytes` encoding. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Int64\Encoding\BigEndianBytes|null + */ + public function getBigEndianBytes() + { + return $this->readOneof(1); + } + + public function hasBigEndianBytes() + { + return $this->hasOneof(1); + } + + /** + * Use `BigEndianBytes` encoding. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Int64\Encoding\BigEndianBytes $var + * @return $this + */ + public function setBigEndianBytes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Int64\Encoding\BigEndianBytes::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getEncoding() + { + return $this->whichOneof("encoding"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Encoding::class, \Google\Cloud\Bigtable\Admin\V2\Type_Int64_Encoding::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Int64/Encoding/BigEndianBytes.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Int64/Encoding/BigEndianBytes.php new file mode 100644 index 000000000000..15ae9f8b2857 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Int64/Encoding/BigEndianBytes.php @@ -0,0 +1,87 @@ +google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + */ +class BigEndianBytes extends \Google\Protobuf\Internal\Message +{ + /** + * Deprecated: ignored if set. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + protected $bytes_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type\Bytes $bytes_type + * Deprecated: ignored if set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Deprecated: ignored if set. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\Bytes|null + */ + public function getBytesType() + { + return $this->bytes_type; + } + + public function hasBytesType() + { + return isset($this->bytes_type); + } + + public function clearBytesType() + { + unset($this->bytes_type); + } + + /** + * Deprecated: ignored if set. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\Bytes $var + * @return $this + */ + public function setBytesType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\Bytes::class); + $this->bytes_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BigEndianBytes::class, \Google\Cloud\Bigtable\Admin\V2\Type_Int64_Encoding_BigEndianBytes::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Map.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Map.php new file mode 100644 index 000000000000..a5090f55b29d --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Map.php @@ -0,0 +1,134 @@ +google.bigtable.admin.v2.Type.Map + */ +class Map extends \Google\Protobuf\Internal\Message +{ + /** + * The type of a map key. + * Only `Bytes`, `String`, and `Int64` are allowed as key types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type key_type = 1; + */ + protected $key_type = null; + /** + * The type of the values in a map. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type value_type = 2; + */ + protected $value_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type $key_type + * The type of a map key. + * Only `Bytes`, `String`, and `Int64` are allowed as key types. + * @type \Google\Cloud\Bigtable\Admin\V2\Type $value_type + * The type of the values in a map. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The type of a map key. + * Only `Bytes`, `String`, and `Int64` are allowed as key types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type key_type = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type|null + */ + public function getKeyType() + { + return $this->key_type; + } + + public function hasKeyType() + { + return isset($this->key_type); + } + + public function clearKeyType() + { + unset($this->key_type); + } + + /** + * The type of a map key. + * Only `Bytes`, `String`, and `Int64` are allowed as key types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type key_type = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type $var + * @return $this + */ + public function setKeyType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type::class); + $this->key_type = $var; + + return $this; + } + + /** + * The type of the values in a map. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type value_type = 2; + * @return \Google\Cloud\Bigtable\Admin\V2\Type|null + */ + public function getValueType() + { + return $this->value_type; + } + + public function hasValueType() + { + return isset($this->value_type); + } + + public function clearValueType() + { + unset($this->value_type); + } + + /** + * The type of the values in a map. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type value_type = 2; + * @param \Google\Cloud\Bigtable\Admin\V2\Type $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type::class); + $this->value_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Map::class, \Google\Cloud\Bigtable\Admin\V2\Type_Map::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBArray.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBArray.php new file mode 100644 index 000000000000..92cf7364257f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBArray.php @@ -0,0 +1,81 @@ +google.bigtable.admin.v2.Type.Array + */ +class PBArray extends \Google\Protobuf\Internal\Message +{ + /** + * The type of the elements in the array. This must not be `Array`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type element_type = 1; + */ + protected $element_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type $element_type + * The type of the elements in the array. This must not be `Array`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The type of the elements in the array. This must not be `Array`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type element_type = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type|null + */ + public function getElementType() + { + return $this->element_type; + } + + public function hasElementType() + { + return isset($this->element_type); + } + + public function clearElementType() + { + unset($this->element_type); + } + + /** + * The type of the elements in the array. This must not be `Array`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type element_type = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type $var + * @return $this + */ + public function setElementType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type::class); + $this->element_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBArray::class, \Google\Cloud\Bigtable\Admin\V2\Type_Array::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBBool.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBBool.php new file mode 100644 index 000000000000..562251784d1c --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBBool.php @@ -0,0 +1,37 @@ +google.bigtable.admin.v2.Type.Bool + */ +class PBBool extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBBool::class, \Google\Cloud\Bigtable\Admin\V2\Type_Bool::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString.php new file mode 100644 index 000000000000..dec7bacd8182 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString.php @@ -0,0 +1,81 @@ +google.bigtable.admin.v2.Type.String + */ +class PBString extends \Google\Protobuf\Internal\Message +{ + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + protected $encoding = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding $encoding + * The encoding to use when converting to/from lower level types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding|null + */ + public function getEncoding() + { + return $this->encoding; + } + + public function hasEncoding() + { + return isset($this->encoding); + } + + public function clearEncoding() + { + unset($this->encoding); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding $var + * @return $this + */ + public function setEncoding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding::class); + $this->encoding = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBString::class, \Google\Cloud\Bigtable\Admin\V2\Type_String::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString/Encoding.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString/Encoding.php new file mode 100644 index 000000000000..1206cfff3b46 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString/Encoding.php @@ -0,0 +1,116 @@ +google.bigtable.admin.v2.Type.String.Encoding + */ +class Encoding extends \Google\Protobuf\Internal\Message +{ + protected $encoding; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Raw $utf8_raw + * Deprecated: if set, converts to an empty `utf8_bytes`. + * @type \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Bytes $utf8_bytes + * Use `Utf8Bytes` encoding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Deprecated: if set, converts to an empty `utf8_bytes`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Raw|null + * @deprecated + */ + public function getUtf8Raw() + { + @trigger_error('utf8_raw is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(1); + } + + public function hasUtf8Raw() + { + @trigger_error('utf8_raw is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(1); + } + + /** + * Deprecated: if set, converts to an empty `utf8_bytes`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Raw $var + * @return $this + * @deprecated + */ + public function setUtf8Raw($var) + { + @trigger_error('utf8_raw is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Raw::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Use `Utf8Bytes` encoding. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Bytes|null + */ + public function getUtf8Bytes() + { + return $this->readOneof(2); + } + + public function hasUtf8Bytes() + { + return $this->hasOneof(2); + } + + /** + * Use `Utf8Bytes` encoding. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Bytes $var + * @return $this + */ + public function setUtf8Bytes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Bytes::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getEncoding() + { + return $this->whichOneof("encoding"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Encoding::class, \Google\Cloud\Bigtable\Admin\V2\Type_String_Encoding::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString/Encoding/Utf8Bytes.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString/Encoding/Utf8Bytes.php new file mode 100644 index 000000000000..ec44fa10181f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString/Encoding/Utf8Bytes.php @@ -0,0 +1,42 @@ +google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + */ +class Utf8Bytes extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Utf8Bytes::class, \Google\Cloud\Bigtable\Admin\V2\Type_String_Encoding_Utf8Bytes::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString/Encoding/Utf8Raw.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString/Encoding/Utf8Raw.php new file mode 100644 index 000000000000..810e88c04499 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/PBString/Encoding/Utf8Raw.php @@ -0,0 +1,37 @@ +google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + */ +class Utf8Raw extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Utf8Raw::class, \Google\Cloud\Bigtable\Admin\V2\Type_String_Encoding_Utf8Raw::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Struct.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Struct.php new file mode 100644 index 000000000000..5a3904002a62 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Struct.php @@ -0,0 +1,73 @@ +google.bigtable.admin.v2.Type.Struct + */ +class Struct extends \Google\Protobuf\Internal\Message +{ + /** + * The names and types of the fields in this struct. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + private $fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\Admin\V2\Type\Struct\Field>|\Google\Protobuf\Internal\RepeatedField $fields + * The names and types of the fields in this struct. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The names and types of the fields in this struct. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * The names and types of the fields in this struct. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + * @param array<\Google\Cloud\Bigtable\Admin\V2\Type\Struct\Field>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Type\Struct\Field::class); + $this->fields = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Struct::class, \Google\Cloud\Bigtable\Admin\V2\Type_Struct::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Struct/Field.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Struct/Field.php new file mode 100644 index 000000000000..e90bceae51ec --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Struct/Field.php @@ -0,0 +1,118 @@ +google.bigtable.admin.v2.Type.Struct.Field + */ +class Field extends \Google\Protobuf\Internal\Message +{ + /** + * The field name (optional). Fields without a `field_name` are considered + * anonymous and cannot be referenced by name. + * + * Generated from protobuf field string field_name = 1; + */ + protected $field_name = ''; + /** + * The type of values in this field. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type type = 2; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field_name + * The field name (optional). Fields without a `field_name` are considered + * anonymous and cannot be referenced by name. + * @type \Google\Cloud\Bigtable\Admin\V2\Type $type + * The type of values in this field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The field name (optional). Fields without a `field_name` are considered + * anonymous and cannot be referenced by name. + * + * Generated from protobuf field string field_name = 1; + * @return string + */ + public function getFieldName() + { + return $this->field_name; + } + + /** + * The field name (optional). Fields without a `field_name` are considered + * anonymous and cannot be referenced by name. + * + * Generated from protobuf field string field_name = 1; + * @param string $var + * @return $this + */ + public function setFieldName($var) + { + GPBUtil::checkString($var, True); + $this->field_name = $var; + + return $this; + } + + /** + * The type of values in this field. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type type = 2; + * @return \Google\Cloud\Bigtable\Admin\V2\Type|null + */ + public function getType() + { + return $this->type; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The type of values in this field. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type type = 2; + * @param \Google\Cloud\Bigtable\Admin\V2\Type $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type::class); + $this->type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Field::class, \Google\Cloud\Bigtable\Admin\V2\Type_Struct_Field::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Timestamp.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Timestamp.php new file mode 100644 index 000000000000..9f62002a7216 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/Type/Timestamp.php @@ -0,0 +1,37 @@ +google.bigtable.admin.v2.Type.Timestamp + */ +class Timestamp extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Timestamp::class, \Google\Cloud\Bigtable\Admin\V2\Type_Timestamp::class); + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UndeleteTableMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UndeleteTableMetadata.php new file mode 100644 index 000000000000..b847a234a946 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UndeleteTableMetadata.php @@ -0,0 +1,156 @@ +google.bigtable.admin.v2.UndeleteTableMetadata + */ +class UndeleteTableMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the table being restored. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The time at which this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + */ + protected $start_time = null; + /** + * If set, the time at which this operation finished or was cancelled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the table being restored. + * @type \Google\Protobuf\Timestamp $start_time + * The time at which this operation started. + * @type \Google\Protobuf\Timestamp $end_time + * If set, the time at which this operation finished or was cancelled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The name of the table being restored. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the table being restored. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The time at which this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The time at which this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * If set, the time at which this operation finished or was cancelled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * If set, the time at which this operation finished or was cancelled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UndeleteTableRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UndeleteTableRequest.php new file mode 100644 index 000000000000..d3ead7ced6a2 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UndeleteTableRequest.php @@ -0,0 +1,92 @@ +google.bigtable.admin.v2.UndeleteTableRequest + */ +class UndeleteTableRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the table to be restored. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The unique name of the table to be restored. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. Please see + * {@see BigtableTableAdminClient::tableName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\Admin\V2\UndeleteTableRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the table to be restored. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the table to be restored. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the table to be restored. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAppProfileMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAppProfileMetadata.php new file mode 100644 index 000000000000..aa4ccbf47fe0 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAppProfileMetadata.php @@ -0,0 +1,33 @@ +google.bigtable.admin.v2.UpdateAppProfileMetadata + */ +class UpdateAppProfileMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAppProfileRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAppProfileRequest.php new file mode 100644 index 000000000000..5933bed32b54 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAppProfileRequest.php @@ -0,0 +1,175 @@ +google.bigtable.admin.v2.UpdateAppProfileRequest + */ +class UpdateAppProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The app profile which will (partially) replace the current value. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $app_profile = null; + /** + * Required. The subset of app profile fields which should be replaced. + * If unset, all fields will be replaced. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * If true, ignore safety checks when updating the app profile. + * + * Generated from protobuf field bool ignore_warnings = 3; + */ + protected $ignore_warnings = false; + + /** + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile $appProfile Required. The app profile which will (partially) replace the current value. + * @param \Google\Protobuf\FieldMask $updateMask Required. The subset of app profile fields which should be replaced. + * If unset, all fields will be replaced. + * + * @return \Google\Cloud\Bigtable\Admin\V2\UpdateAppProfileRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Bigtable\Admin\V2\AppProfile $appProfile, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAppProfile($appProfile) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile $app_profile + * Required. The app profile which will (partially) replace the current value. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The subset of app profile fields which should be replaced. + * If unset, all fields will be replaced. + * @type bool $ignore_warnings + * If true, ignore safety checks when updating the app profile. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The app profile which will (partially) replace the current value. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile|null + */ + public function getAppProfile() + { + return $this->app_profile; + } + + public function hasAppProfile() + { + return isset($this->app_profile); + } + + public function clearAppProfile() + { + unset($this->app_profile); + } + + /** + * Required. The app profile which will (partially) replace the current value. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile $var + * @return $this + */ + public function setAppProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AppProfile::class); + $this->app_profile = $var; + + return $this; + } + + /** + * Required. The subset of app profile fields which should be replaced. + * If unset, all fields will be replaced. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The subset of app profile fields which should be replaced. + * If unset, all fields will be replaced. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * If true, ignore safety checks when updating the app profile. + * + * Generated from protobuf field bool ignore_warnings = 3; + * @return bool + */ + public function getIgnoreWarnings() + { + return $this->ignore_warnings; + } + + /** + * If true, ignore safety checks when updating the app profile. + * + * Generated from protobuf field bool ignore_warnings = 3; + * @param bool $var + * @return $this + */ + public function setIgnoreWarnings($var) + { + GPBUtil::checkBool($var); + $this->ignore_warnings = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAuthorizedViewMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAuthorizedViewMetadata.php new file mode 100644 index 000000000000..1457fd96929c --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAuthorizedViewMetadata.php @@ -0,0 +1,170 @@ +google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + */ +class UpdateAuthorizedViewMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The request that prompted the initiation of this UpdateAuthorizedView + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + */ + protected $original_request = null; + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + */ + protected $request_time = null; + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + */ + protected $finish_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\UpdateAuthorizedViewRequest $original_request + * The request that prompted the initiation of this UpdateAuthorizedView + * operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The request that prompted the initiation of this UpdateAuthorizedView + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\UpdateAuthorizedViewRequest|null + */ + public function getOriginalRequest() + { + return $this->original_request; + } + + public function hasOriginalRequest() + { + return isset($this->original_request); + } + + public function clearOriginalRequest() + { + unset($this->original_request); + } + + /** + * The request that prompted the initiation of this UpdateAuthorizedView + * operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\UpdateAuthorizedViewRequest $var + * @return $this + */ + public function setOriginalRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\UpdateAuthorizedViewRequest::class); + $this->original_request = $var; + + return $this; + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRequestTime() + { + return $this->request_time; + } + + public function hasRequestTime() + { + return isset($this->request_time); + } + + public function clearRequestTime() + { + unset($this->request_time); + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRequestTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->request_time = $var; + + return $this; + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFinishTime() + { + return $this->finish_time; + } + + public function hasFinishTime() + { + return isset($this->finish_time); + } + + public function clearFinishTime() + { + unset($this->finish_time); + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFinishTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->finish_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAuthorizedViewRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAuthorizedViewRequest.php new file mode 100644 index 000000000000..c5ba84b2314f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateAuthorizedViewRequest.php @@ -0,0 +1,220 @@ +google.bigtable.admin.v2.UpdateAuthorizedViewRequest + */ +class UpdateAuthorizedViewRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The AuthorizedView to update. The `name` in `authorized_view` is + * used to identify the AuthorizedView. AuthorizedView name must in this + * format + * projects//instances//tables/
/authorizedViews/ + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $authorized_view = null; + /** + * Optional. The list of fields to update. + * A mask specifying which fields in the AuthorizedView resource should be + * updated. This mask is relative to the AuthorizedView resource, not to the + * request message. A field will be overwritten if it is in the mask. If + * empty, all fields set in the request will be overwritten. A special value + * `*` means to overwrite all fields (including fields not set in the + * request). + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Optional. If true, ignore the safety checks when updating the + * AuthorizedView. + * + * Generated from protobuf field bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ignore_warnings = false; + + /** + * @param \Google\Cloud\Bigtable\Admin\V2\AuthorizedView $authorizedView Required. The AuthorizedView to update. The `name` in `authorized_view` is + * used to identify the AuthorizedView. AuthorizedView name must in this + * format + * projects//instances//tables/
/authorizedViews/ + * @param \Google\Protobuf\FieldMask $updateMask Optional. The list of fields to update. + * A mask specifying which fields in the AuthorizedView resource should be + * updated. This mask is relative to the AuthorizedView resource, not to the + * request message. A field will be overwritten if it is in the mask. If + * empty, all fields set in the request will be overwritten. A special value + * `*` means to overwrite all fields (including fields not set in the + * request). + * + * @return \Google\Cloud\Bigtable\Admin\V2\UpdateAuthorizedViewRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Bigtable\Admin\V2\AuthorizedView $authorizedView, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAuthorizedView($authorizedView) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\AuthorizedView $authorized_view + * Required. The AuthorizedView to update. The `name` in `authorized_view` is + * used to identify the AuthorizedView. AuthorizedView name must in this + * format + * projects//instances//tables/
/authorizedViews/ + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The list of fields to update. + * A mask specifying which fields in the AuthorizedView resource should be + * updated. This mask is relative to the AuthorizedView resource, not to the + * request message. A field will be overwritten if it is in the mask. If + * empty, all fields set in the request will be overwritten. A special value + * `*` means to overwrite all fields (including fields not set in the + * request). + * @type bool $ignore_warnings + * Optional. If true, ignore the safety checks when updating the + * AuthorizedView. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The AuthorizedView to update. The `name` in `authorized_view` is + * used to identify the AuthorizedView. AuthorizedView name must in this + * format + * projects//instances//tables/
/authorizedViews/ + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\AuthorizedView|null + */ + public function getAuthorizedView() + { + return $this->authorized_view; + } + + public function hasAuthorizedView() + { + return isset($this->authorized_view); + } + + public function clearAuthorizedView() + { + unset($this->authorized_view); + } + + /** + * Required. The AuthorizedView to update. The `name` in `authorized_view` is + * used to identify the AuthorizedView. AuthorizedView name must in this + * format + * projects//instances//tables/
/authorizedViews/ + * + * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\AuthorizedView $var + * @return $this + */ + public function setAuthorizedView($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AuthorizedView::class); + $this->authorized_view = $var; + + return $this; + } + + /** + * Optional. The list of fields to update. + * A mask specifying which fields in the AuthorizedView resource should be + * updated. This mask is relative to the AuthorizedView resource, not to the + * request message. A field will be overwritten if it is in the mask. If + * empty, all fields set in the request will be overwritten. A special value + * `*` means to overwrite all fields (including fields not set in the + * request). + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The list of fields to update. + * A mask specifying which fields in the AuthorizedView resource should be + * updated. This mask is relative to the AuthorizedView resource, not to the + * request message. A field will be overwritten if it is in the mask. If + * empty, all fields set in the request will be overwritten. A special value + * `*` means to overwrite all fields (including fields not set in the + * request). + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. If true, ignore the safety checks when updating the + * AuthorizedView. + * + * Generated from protobuf field bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIgnoreWarnings() + { + return $this->ignore_warnings; + } + + /** + * Optional. If true, ignore the safety checks when updating the + * AuthorizedView. + * + * Generated from protobuf field bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIgnoreWarnings($var) + { + GPBUtil::checkBool($var); + $this->ignore_warnings = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateBackupRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateBackupRequest.php new file mode 100644 index 000000000000..b450460b852b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateBackupRequest.php @@ -0,0 +1,173 @@ +google.bigtable.admin.v2.UpdateBackupRequest + */ +class UpdateBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The backup to update. `backup.name`, and the fields to be updated + * as specified by `update_mask` are required. Other fields are ignored. + * Update is only supported for the following fields: + * * `backup.expire_time`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup = null; + /** + * Required. A mask specifying which fields (e.g. `expire_time`) in the + * Backup resource should be updated. This mask is relative to the Backup + * resource, not to the request message. The field mask must always be + * specified; this prevents any future fields from being erased accidentally + * by clients that do not know about them. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Bigtable\Admin\V2\Backup $backup Required. The backup to update. `backup.name`, and the fields to be updated + * as specified by `update_mask` are required. Other fields are ignored. + * Update is only supported for the following fields: + * + * * `backup.expire_time`. + * @param \Google\Protobuf\FieldMask $updateMask Required. A mask specifying which fields (e.g. `expire_time`) in the + * Backup resource should be updated. This mask is relative to the Backup + * resource, not to the request message. The field mask must always be + * specified; this prevents any future fields from being erased accidentally + * by clients that do not know about them. + * + * @return \Google\Cloud\Bigtable\Admin\V2\UpdateBackupRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Bigtable\Admin\V2\Backup $backup, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setBackup($backup) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Backup $backup + * Required. The backup to update. `backup.name`, and the fields to be updated + * as specified by `update_mask` are required. Other fields are ignored. + * Update is only supported for the following fields: + * * `backup.expire_time`. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. A mask specifying which fields (e.g. `expire_time`) in the + * Backup resource should be updated. This mask is relative to the Backup + * resource, not to the request message. The field mask must always be + * specified; this prevents any future fields from being erased accidentally + * by clients that do not know about them. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The backup to update. `backup.name`, and the fields to be updated + * as specified by `update_mask` are required. Other fields are ignored. + * Update is only supported for the following fields: + * * `backup.expire_time`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\Backup|null + */ + public function getBackup() + { + return $this->backup; + } + + public function hasBackup() + { + return isset($this->backup); + } + + public function clearBackup() + { + unset($this->backup); + } + + /** + * Required. The backup to update. `backup.name`, and the fields to be updated + * as specified by `update_mask` are required. Other fields are ignored. + * Update is only supported for the following fields: + * * `backup.expire_time`. + * + * Generated from protobuf field .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\Backup $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Backup::class); + $this->backup = $var; + + return $this; + } + + /** + * Required. A mask specifying which fields (e.g. `expire_time`) in the + * Backup resource should be updated. This mask is relative to the Backup + * resource, not to the request message. The field mask must always be + * specified; this prevents any future fields from being erased accidentally + * by clients that do not know about them. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. A mask specifying which fields (e.g. `expire_time`) in the + * Backup resource should be updated. This mask is relative to the Backup + * resource, not to the request message. The field mask must always be + * specified; this prevents any future fields from being erased accidentally + * by clients that do not know about them. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateClusterMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateClusterMetadata.php new file mode 100644 index 000000000000..09fcde08400d --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateClusterMetadata.php @@ -0,0 +1,165 @@ +google.bigtable.admin.v2.UpdateClusterMetadata + */ +class UpdateClusterMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The request that prompted the initiation of this UpdateCluster operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster original_request = 1; + */ + protected $original_request = null; + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + */ + protected $request_time = null; + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + */ + protected $finish_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Cluster $original_request + * The request that prompted the initiation of this UpdateCluster operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The request that prompted the initiation of this UpdateCluster operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster original_request = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Cluster|null + */ + public function getOriginalRequest() + { + return $this->original_request; + } + + public function hasOriginalRequest() + { + return isset($this->original_request); + } + + public function clearOriginalRequest() + { + unset($this->original_request); + } + + /** + * The request that prompted the initiation of this UpdateCluster operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.Cluster original_request = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Cluster $var + * @return $this + */ + public function setOriginalRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Cluster::class); + $this->original_request = $var; + + return $this; + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRequestTime() + { + return $this->request_time; + } + + public function hasRequestTime() + { + return isset($this->request_time); + } + + public function clearRequestTime() + { + unset($this->request_time); + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRequestTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->request_time = $var; + + return $this; + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFinishTime() + { + return $this->finish_time; + } + + public function hasFinishTime() + { + return isset($this->finish_time); + } + + public function clearFinishTime() + { + unset($this->finish_time); + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFinishTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->finish_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateInstanceMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateInstanceMetadata.php new file mode 100644 index 000000000000..5caa3d20f2a2 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateInstanceMetadata.php @@ -0,0 +1,165 @@ +google.bigtable.admin.v2.UpdateInstanceMetadata + */ +class UpdateInstanceMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The request that prompted the initiation of this UpdateInstance operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + */ + protected $original_request = null; + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + */ + protected $request_time = null; + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + */ + protected $finish_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\PartialUpdateInstanceRequest $original_request + * The request that prompted the initiation of this UpdateInstance operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The request that prompted the initiation of this UpdateInstance operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\PartialUpdateInstanceRequest|null + */ + public function getOriginalRequest() + { + return $this->original_request; + } + + public function hasOriginalRequest() + { + return isset($this->original_request); + } + + public function clearOriginalRequest() + { + unset($this->original_request); + } + + /** + * The request that prompted the initiation of this UpdateInstance operation. + * + * Generated from protobuf field .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\PartialUpdateInstanceRequest $var + * @return $this + */ + public function setOriginalRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\PartialUpdateInstanceRequest::class); + $this->original_request = $var; + + return $this; + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRequestTime() + { + return $this->request_time; + } + + public function hasRequestTime() + { + return isset($this->request_time); + } + + public function clearRequestTime() + { + unset($this->request_time); + } + + /** + * The time at which the original request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRequestTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->request_time = $var; + + return $this; + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFinishTime() + { + return $this->finish_time; + } + + public function hasFinishTime() + { + return isset($this->finish_time); + } + + public function clearFinishTime() + { + unset($this->finish_time); + } + + /** + * The time at which the operation failed or was completed successfully. + * + * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFinishTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->finish_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateTableMetadata.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateTableMetadata.php new file mode 100644 index 000000000000..ab407c9bfd1b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateTableMetadata.php @@ -0,0 +1,156 @@ +google.bigtable.admin.v2.UpdateTableMetadata + */ +class UpdateTableMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the table being updated. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The time at which this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + */ + protected $start_time = null; + /** + * If set, the time at which this operation finished or was canceled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the table being updated. + * @type \Google\Protobuf\Timestamp $start_time + * The time at which this operation started. + * @type \Google\Protobuf\Timestamp $end_time + * If set, the time at which this operation finished or was canceled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The name of the table being updated. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the table being updated. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The time at which this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The time at which this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * If set, the time at which this operation finished or was canceled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * If set, the time at which this operation finished or was canceled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateTableRequest.php b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateTableRequest.php new file mode 100644 index 000000000000..17d6cb5e06e6 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/proto/src/Google/Cloud/Bigtable/Admin/V2/UpdateTableRequest.php @@ -0,0 +1,189 @@ +google.bigtable.admin.v2.UpdateTableRequest + */ +class UpdateTableRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The table to update. + * The table's `name` field is used to identify the table to update. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table = null; + /** + * Required. The list of fields to update. + * A mask specifying which fields (e.g. `change_stream_config`) in the `table` + * field should be updated. This mask is relative to the `table` field, not to + * the request message. The wildcard (*) path is currently not supported. + * Currently UpdateTable is only supported for the following fields: + * * `change_stream_config` + * * `change_stream_config.retention_period` + * * `deletion_protection` + * If `column_families` is set in `update_mask`, it will return an + * UNIMPLEMENTED error. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Bigtable\Admin\V2\Table $table Required. The table to update. + * The table's `name` field is used to identify the table to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to update. + * A mask specifying which fields (e.g. `change_stream_config`) in the `table` + * field should be updated. This mask is relative to the `table` field, not to + * the request message. The wildcard (*) path is currently not supported. + * Currently UpdateTable is only supported for the following fields: + * + * * `change_stream_config` + * * `change_stream_config.retention_period` + * * `deletion_protection` + * + * If `column_families` is set in `update_mask`, it will return an + * UNIMPLEMENTED error. + * + * @return \Google\Cloud\Bigtable\Admin\V2\UpdateTableRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Bigtable\Admin\V2\Table $table, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setTable($table) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Table $table + * Required. The table to update. + * The table's `name` field is used to identify the table to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to update. + * A mask specifying which fields (e.g. `change_stream_config`) in the `table` + * field should be updated. This mask is relative to the `table` field, not to + * the request message. The wildcard (*) path is currently not supported. + * Currently UpdateTable is only supported for the following fields: + * * `change_stream_config` + * * `change_stream_config.retention_period` + * * `deletion_protection` + * If `column_families` is set in `update_mask`, it will return an + * UNIMPLEMENTED error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The table to update. + * The table's `name` field is used to identify the table to update. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Bigtable\Admin\V2\Table|null + */ + public function getTable() + { + return $this->table; + } + + public function hasTable() + { + return isset($this->table); + } + + public function clearTable() + { + unset($this->table); + } + + /** + * Required. The table to update. + * The table's `name` field is used to identify the table to update. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Bigtable\Admin\V2\Table $var + * @return $this + */ + public function setTable($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Table::class); + $this->table = $var; + + return $this; + } + + /** + * Required. The list of fields to update. + * A mask specifying which fields (e.g. `change_stream_config`) in the `table` + * field should be updated. This mask is relative to the `table` field, not to + * the request message. The wildcard (*) path is currently not supported. + * Currently UpdateTable is only supported for the following fields: + * * `change_stream_config` + * * `change_stream_config.retention_period` + * * `deletion_protection` + * If `column_families` is set in `update_mask`, it will return an + * UNIMPLEMENTED error. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to update. + * A mask specifying which fields (e.g. `change_stream_config`) in the `table` + * field should be updated. This mask is relative to the `table` field, not to + * the request message. The wildcard (*) path is currently not supported. + * Currently UpdateTable is only supported for the following fields: + * * `change_stream_config` + * * `change_stream_config.retention_period` + * * `deletion_protection` + * If `column_families` is set in `update_mask`, it will return an + * UNIMPLEMENTED error. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/create_app_profile.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/create_app_profile.php new file mode 100644 index 000000000000..4cba3a4e581b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/create_app_profile.php @@ -0,0 +1,79 @@ +setParent($formattedParent) + ->setAppProfileId($appProfileId) + ->setAppProfile($appProfile); + + // Call the API and handle any network failures. + try { + /** @var AppProfile $response */ + $response = $bigtableInstanceAdminClient->createAppProfile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableInstanceAdminClient::instanceName('[PROJECT]', '[INSTANCE]'); + $appProfileId = '[APP_PROFILE_ID]'; + + create_app_profile_sample($formattedParent, $appProfileId); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/create_cluster.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/create_cluster.php new file mode 100644 index 000000000000..45ebd1a21640 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/create_cluster.php @@ -0,0 +1,97 @@ +setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableInstanceAdminClient->createCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableInstanceAdminClient::instanceName('[PROJECT]', '[INSTANCE]'); + $clusterId = '[CLUSTER_ID]'; + + create_cluster_sample($formattedParent, $clusterId); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/create_instance.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/create_instance.php new file mode 100644 index 000000000000..1abf64ae014f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/create_instance.php @@ -0,0 +1,107 @@ +setDisplayName($instanceDisplayName); + $clusters = []; + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance) + ->setClusters($clusters); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableInstanceAdminClient->createInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableInstanceAdminClient::projectName('[PROJECT]'); + $instanceId = '[INSTANCE_ID]'; + $instanceDisplayName = '[DISPLAY_NAME]'; + + create_instance_sample($formattedParent, $instanceId, $instanceDisplayName); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/delete_app_profile.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/delete_app_profile.php new file mode 100644 index 000000000000..70ac8bd03282 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/delete_app_profile.php @@ -0,0 +1,78 @@ +setName($formattedName) + ->setIgnoreWarnings($ignoreWarnings); + + // Call the API and handle any network failures. + try { + $bigtableInstanceAdminClient->deleteAppProfile($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableInstanceAdminClient::appProfileName( + '[PROJECT]', + '[INSTANCE]', + '[APP_PROFILE]' + ); + $ignoreWarnings = false; + + delete_app_profile_sample($formattedName, $ignoreWarnings); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/delete_cluster.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/delete_cluster.php new file mode 100644 index 000000000000..c4b929dbc4e9 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/delete_cluster.php @@ -0,0 +1,70 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $bigtableInstanceAdminClient->deleteCluster($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableInstanceAdminClient::clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + + delete_cluster_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/delete_instance.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/delete_instance.php new file mode 100644 index 000000000000..5b62ae7912cb --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/delete_instance.php @@ -0,0 +1,70 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $bigtableInstanceAdminClient->deleteInstance($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableInstanceAdminClient::instanceName('[PROJECT]', '[INSTANCE]'); + + delete_instance_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_app_profile.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_app_profile.php new file mode 100644 index 000000000000..506431b3c320 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_app_profile.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AppProfile $response */ + $response = $bigtableInstanceAdminClient->getAppProfile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableInstanceAdminClient::appProfileName( + '[PROJECT]', + '[INSTANCE]', + '[APP_PROFILE]' + ); + + get_app_profile_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_cluster.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_cluster.php new file mode 100644 index 000000000000..4a2a93b3f47b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_cluster.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Cluster $response */ + $response = $bigtableInstanceAdminClient->getCluster($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableInstanceAdminClient::clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + + get_cluster_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_iam_policy.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_iam_policy.php new file mode 100644 index 000000000000..a4dfa0fec4aa --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $bigtableInstanceAdminClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_instance.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_instance.php new file mode 100644 index 000000000000..52c1a06c2788 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/get_instance.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Instance $response */ + $response = $bigtableInstanceAdminClient->getInstance($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableInstanceAdminClient::instanceName('[PROJECT]', '[INSTANCE]'); + + get_instance_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_app_profiles.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_app_profiles.php new file mode 100644 index 000000000000..6270226f235f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_app_profiles.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bigtableInstanceAdminClient->listAppProfiles($request); + + /** @var AppProfile $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableInstanceAdminClient::instanceName('[PROJECT]', '[INSTANCE]'); + + list_app_profiles_sample($formattedParent); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_clusters.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_clusters.php new file mode 100644 index 000000000000..9c30512f61c7 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_clusters.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ListClustersResponse $response */ + $response = $bigtableInstanceAdminClient->listClusters($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableInstanceAdminClient::instanceName('[PROJECT]', '[INSTANCE]'); + + list_clusters_sample($formattedParent); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_hot_tablets.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_hot_tablets.php new file mode 100644 index 000000000000..bbbd046338d5 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_hot_tablets.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bigtableInstanceAdminClient->listHotTablets($request); + + /** @var HotTablet $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableInstanceAdminClient::clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + + list_hot_tablets_sample($formattedParent); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_instances.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_instances.php new file mode 100644 index 000000000000..e9130a75ef95 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/list_instances.php @@ -0,0 +1,72 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ListInstancesResponse $response */ + $response = $bigtableInstanceAdminClient->listInstances($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableInstanceAdminClient::projectName('[PROJECT]'); + + list_instances_sample($formattedParent); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/partial_update_cluster.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/partial_update_cluster.php new file mode 100644 index 000000000000..11b8850d5686 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/partial_update_cluster.php @@ -0,0 +1,85 @@ +setCluster($cluster) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableInstanceAdminClient->partialUpdateCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/partial_update_instance.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/partial_update_instance.php new file mode 100644 index 000000000000..b88c9a4ebdab --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/partial_update_instance.php @@ -0,0 +1,90 @@ +setDisplayName($instanceDisplayName); + $updateMask = new FieldMask(); + $request = (new PartialUpdateInstanceRequest()) + ->setInstance($instance) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableInstanceAdminClient->partialUpdateInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceDisplayName = '[DISPLAY_NAME]'; + + partial_update_instance_sample($instanceDisplayName); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/set_iam_policy.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/set_iam_policy.php new file mode 100644 index 000000000000..842f6943766b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/set_iam_policy.php @@ -0,0 +1,74 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $bigtableInstanceAdminClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/test_iam_permissions.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/test_iam_permissions.php new file mode 100644 index 000000000000..a312340f36f4 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $bigtableInstanceAdminClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/update_app_profile.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/update_app_profile.php new file mode 100644 index 000000000000..e20dab7c6699 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/update_app_profile.php @@ -0,0 +1,74 @@ +setAppProfile($appProfile) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableInstanceAdminClient->updateAppProfile($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AppProfile $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/update_cluster.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/update_cluster.php new file mode 100644 index 000000000000..99de20c472fd --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/update_cluster.php @@ -0,0 +1,90 @@ +setName($name) + ->setServeNodes($serveNodes); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableInstanceAdminClient->updateCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $serveNodes = 0; + + update_cluster_sample($name, $serveNodes); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/update_instance.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/update_instance.php new file mode 100644 index 000000000000..80667f033185 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableInstanceAdminClient/update_instance.php @@ -0,0 +1,83 @@ +setName($name) + ->setDisplayName($displayName) + ->setType($type) + ->setLabels($labels); + + // Call the API and handle any network failures. + try { + /** @var Instance $response */ + $response = $bigtableInstanceAdminClient->updateInstance($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $displayName = '[DISPLAY_NAME]'; + $type = Type::TYPE_UNSPECIFIED; + + update_instance_sample($name, $displayName, $type); +} +// [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/check_consistency.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/check_consistency.php new file mode 100644 index 000000000000..fc2182469283 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/check_consistency.php @@ -0,0 +1,78 @@ +setName($formattedName) + ->setConsistencyToken($consistencyToken); + + // Call the API and handle any network failures. + try { + /** @var CheckConsistencyResponse $response */ + $response = $bigtableTableAdminClient->checkConsistency($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $consistencyToken = '[CONSISTENCY_TOKEN]'; + + check_consistency_sample($formattedName, $consistencyToken); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/copy_backup.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/copy_backup.php new file mode 100644 index 000000000000..230a80427499 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/copy_backup.php @@ -0,0 +1,115 @@ +/instances//clusters//backups/`. Please see + * {@see BigtableTableAdminClient::backupName()} for help formatting this field. + */ +function copy_backup_sample( + string $formattedParent, + string $backupId, + string $formattedSourceBackup +): void { + // Create a client. + $bigtableTableAdminClient = new BigtableTableAdminClient(); + + // Prepare the request message. + $expireTime = new Timestamp(); + $request = (new CopyBackupRequest()) + ->setParent($formattedParent) + ->setBackupId($backupId) + ->setSourceBackup($formattedSourceBackup) + ->setExpireTime($expireTime); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableTableAdminClient->copyBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableTableAdminClient::clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $backupId = '[BACKUP_ID]'; + $formattedSourceBackup = BigtableTableAdminClient::backupName( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]', + '[BACKUP]' + ); + + copy_backup_sample($formattedParent, $backupId, $formattedSourceBackup); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_authorized_view.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_authorized_view.php new file mode 100644 index 000000000000..312f73588d01 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_authorized_view.php @@ -0,0 +1,93 @@ +setParent($formattedParent) + ->setAuthorizedViewId($authorizedViewId) + ->setAuthorizedView($authorizedView); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableTableAdminClient->createAuthorizedView($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AuthorizedView $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableTableAdminClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $authorizedViewId = '[AUTHORIZED_VIEW_ID]'; + + create_authorized_view_sample($formattedParent, $authorizedViewId); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_backup.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_backup.php new file mode 100644 index 000000000000..c19f78fe3afd --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_backup.php @@ -0,0 +1,113 @@ +setSourceTable($backupSourceTable) + ->setExpireTime($backupExpireTime); + $request = (new CreateBackupRequest()) + ->setParent($formattedParent) + ->setBackupId($backupId) + ->setBackup($backup); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableTableAdminClient->createBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableTableAdminClient::clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $backupId = '[BACKUP_ID]'; + $backupSourceTable = '[SOURCE_TABLE]'; + + create_backup_sample($formattedParent, $backupId, $backupSourceTable); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_table.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_table.php new file mode 100644 index 000000000000..c9e8e72ab85f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_table.php @@ -0,0 +1,81 @@ +setParent($formattedParent) + ->setTableId($tableId) + ->setTable($table); + + // Call the API and handle any network failures. + try { + /** @var Table $response */ + $response = $bigtableTableAdminClient->createTable($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableTableAdminClient::instanceName('[PROJECT]', '[INSTANCE]'); + $tableId = '[TABLE_ID]'; + + create_table_sample($formattedParent, $tableId); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_table_from_snapshot.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_table_from_snapshot.php new file mode 100644 index 000000000000..6c08c6d4ec0c --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/create_table_from_snapshot.php @@ -0,0 +1,110 @@ +setParent($formattedParent) + ->setTableId($tableId) + ->setSourceSnapshot($formattedSourceSnapshot); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableTableAdminClient->createTableFromSnapshot($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Table $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableTableAdminClient::instanceName('[PROJECT]', '[INSTANCE]'); + $tableId = '[TABLE_ID]'; + $formattedSourceSnapshot = BigtableTableAdminClient::snapshotName( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]', + '[SNAPSHOT]' + ); + + create_table_from_snapshot_sample($formattedParent, $tableId, $formattedSourceSnapshot); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_authorized_view.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_authorized_view.php new file mode 100644 index 000000000000..085616ad9754 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_authorized_view.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $bigtableTableAdminClient->deleteAuthorizedView($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::authorizedViewName( + '[PROJECT]', + '[INSTANCE]', + '[TABLE]', + '[AUTHORIZED_VIEW]' + ); + + delete_authorized_view_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteAuthorizedView_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_backup.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_backup.php new file mode 100644 index 000000000000..4cc770fe8a9a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_backup.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $bigtableTableAdminClient->deleteBackup($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::backupName( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]', + '[BACKUP]' + ); + + delete_backup_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_snapshot.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_snapshot.php new file mode 100644 index 000000000000..512babb6e5d3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_snapshot.php @@ -0,0 +1,82 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $bigtableTableAdminClient->deleteSnapshot($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::snapshotName( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]', + '[SNAPSHOT]' + ); + + delete_snapshot_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_table.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_table.php new file mode 100644 index 000000000000..a8650aa538b4 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/delete_table.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $bigtableTableAdminClient->deleteTable($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + delete_table_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/drop_row_range.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/drop_row_range.php new file mode 100644 index 000000000000..5a506dbf0a0e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/drop_row_range.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $bigtableTableAdminClient->dropRowRange($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + drop_row_range_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/generate_consistency_token.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/generate_consistency_token.php new file mode 100644 index 000000000000..13a43860b82b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/generate_consistency_token.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var GenerateConsistencyTokenResponse $response */ + $response = $bigtableTableAdminClient->generateConsistencyToken($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + generate_consistency_token_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_authorized_view.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_authorized_view.php new file mode 100644 index 000000000000..5ff1ce4a3a4b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_authorized_view.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AuthorizedView $response */ + $response = $bigtableTableAdminClient->getAuthorizedView($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::authorizedViewName( + '[PROJECT]', + '[INSTANCE]', + '[TABLE]', + '[AUTHORIZED_VIEW]' + ); + + get_authorized_view_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_GetAuthorizedView_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_backup.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_backup.php new file mode 100644 index 000000000000..5c7fc10e0993 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_backup.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Backup $response */ + $response = $bigtableTableAdminClient->getBackup($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::backupName( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]', + '[BACKUP]' + ); + + get_backup_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_iam_policy.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_iam_policy.php new file mode 100644 index 000000000000..7ff9af1261b9 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_iam_policy.php @@ -0,0 +1,73 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $bigtableTableAdminClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_snapshot.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_snapshot.php new file mode 100644 index 000000000000..61234e7fbe69 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_snapshot.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Snapshot $response */ + $response = $bigtableTableAdminClient->getSnapshot($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::snapshotName( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]', + '[SNAPSHOT]' + ); + + get_snapshot_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_table.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_table.php new file mode 100644 index 000000000000..dfda57e6a47f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/get_table.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Table $response */ + $response = $bigtableTableAdminClient->getTable($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + get_table_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_authorized_views.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_authorized_views.php new file mode 100644 index 000000000000..ef36a650e70a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_authorized_views.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bigtableTableAdminClient->listAuthorizedViews($request); + + /** @var AuthorizedView $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableTableAdminClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + list_authorized_views_sample($formattedParent); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_ListAuthorizedViews_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_backups.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_backups.php new file mode 100644 index 000000000000..94400498e37f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_backups.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bigtableTableAdminClient->listBackups($request); + + /** @var Backup $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableTableAdminClient::clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + + list_backups_sample($formattedParent); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_snapshots.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_snapshots.php new file mode 100644 index 000000000000..73c2aff1f7aa --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_snapshots.php @@ -0,0 +1,86 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bigtableTableAdminClient->listSnapshots($request); + + /** @var Snapshot $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableTableAdminClient::clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + + list_snapshots_sample($formattedParent); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_tables.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_tables.php new file mode 100644 index 000000000000..ff3b49bd0d04 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/list_tables.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $bigtableTableAdminClient->listTables($request); + + /** @var Table $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableTableAdminClient::instanceName('[PROJECT]', '[INSTANCE]'); + + list_tables_sample($formattedParent); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/modify_column_families.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/modify_column_families.php new file mode 100644 index 000000000000..e8f6e7b9b825 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/modify_column_families.php @@ -0,0 +1,79 @@ +setName($formattedName) + ->setModifications($modifications); + + // Call the API and handle any network failures. + try { + /** @var Table $response */ + $response = $bigtableTableAdminClient->modifyColumnFamilies($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + modify_column_families_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/restore_table.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/restore_table.php new file mode 100644 index 000000000000..d73f60a89edf --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/restore_table.php @@ -0,0 +1,96 @@ +/instances/`. Please see + * {@see BigtableTableAdminClient::instanceName()} for help formatting this field. + * @param string $tableId The id of the table to create and restore to. This + * table must not already exist. The `table_id` appended to + * `parent` forms the full table name of the form + * `projects//instances//tables/`. + */ +function restore_table_sample(string $formattedParent, string $tableId): void +{ + // Create a client. + $bigtableTableAdminClient = new BigtableTableAdminClient(); + + // Prepare the request message. + $request = (new RestoreTableRequest()) + ->setParent($formattedParent) + ->setTableId($tableId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableTableAdminClient->restoreTable($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Table $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BigtableTableAdminClient::instanceName('[PROJECT]', '[INSTANCE]'); + $tableId = '[TABLE_ID]'; + + restore_table_sample($formattedParent, $tableId); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/set_iam_policy.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/set_iam_policy.php new file mode 100644 index 000000000000..c51797c13213 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/set_iam_policy.php @@ -0,0 +1,74 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $bigtableTableAdminClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/snapshot_table.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/snapshot_table.php new file mode 100644 index 000000000000..7d7b542a82ef --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/snapshot_table.php @@ -0,0 +1,107 @@ +setName($formattedName) + ->setCluster($formattedCluster) + ->setSnapshotId($snapshotId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableTableAdminClient->snapshotTable($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Snapshot $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $formattedCluster = BigtableTableAdminClient::clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $snapshotId = '[SNAPSHOT_ID]'; + + snapshot_table_sample($formattedName, $formattedCluster, $snapshotId); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/test_iam_permissions.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/test_iam_permissions.php new file mode 100644 index 000000000000..042ceb981136 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $bigtableTableAdminClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/undelete_table.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/undelete_table.php new file mode 100644 index 000000000000..3448b8fedff0 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/undelete_table.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableTableAdminClient->undeleteTable($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Table $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableTableAdminClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + undelete_table_sample($formattedName); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/update_authorized_view.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/update_authorized_view.php new file mode 100644 index 000000000000..ab69b8924270 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/update_authorized_view.php @@ -0,0 +1,71 @@ +setAuthorizedView($authorizedView); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableTableAdminClient->updateAuthorizedView($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AuthorizedView $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/update_backup.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/update_backup.php new file mode 100644 index 000000000000..575ccfa3be08 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/update_backup.php @@ -0,0 +1,80 @@ +setSourceTable($backupSourceTable) + ->setExpireTime($backupExpireTime); + $updateMask = new FieldMask(); + $request = (new UpdateBackupRequest()) + ->setBackup($backup) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Backup $response */ + $response = $bigtableTableAdminClient->updateBackup($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $backupSourceTable = '[SOURCE_TABLE]'; + + update_backup_sample($backupSourceTable); +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/update_table.php b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/update_table.php new file mode 100644 index 000000000000..9d335ba140ec --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/samples/V2/BigtableTableAdminClient/update_table.php @@ -0,0 +1,74 @@ +setTable($table) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $bigtableTableAdminClient->updateTable($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Table $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_sync] diff --git a/owl-bot-staging/Bigtable/v2/Admin/src/V2/Client/BigtableInstanceAdminClient.php b/owl-bot-staging/Bigtable/v2/Admin/src/V2/Client/BigtableInstanceAdminClient.php new file mode 100644 index 000000000000..5f1747d2fe40 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/src/V2/Client/BigtableInstanceAdminClient.php @@ -0,0 +1,1024 @@ + createAppProfileAsync(CreateAppProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface createClusterAsync(CreateClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface createInstanceAsync(CreateInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAppProfileAsync(DeleteAppProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteClusterAsync(DeleteClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteInstanceAsync(DeleteInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAppProfileAsync(GetAppProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface getClusterAsync(GetClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getInstanceAsync(GetInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAppProfilesAsync(ListAppProfilesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listClustersAsync(ListClustersRequest $request, array $optionalArgs = []) + * @method PromiseInterface listHotTabletsAsync(ListHotTabletsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = []) + * @method PromiseInterface partialUpdateClusterAsync(PartialUpdateClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface partialUpdateInstanceAsync(PartialUpdateInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAppProfileAsync(UpdateAppProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateClusterAsync(Cluster $request, array $optionalArgs = []) + * @method PromiseInterface updateInstanceAsync(Instance $request, array $optionalArgs = []) + */ +final class BigtableInstanceAdminClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.bigtable.admin.v2.BigtableInstanceAdmin'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'bigtableadmin.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'bigtableadmin.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/bigtable.admin', + 'https://www.googleapis.com/auth/bigtable.admin.cluster', + 'https://www.googleapis.com/auth/bigtable.admin.instance', + 'https://www.googleapis.com/auth/cloud-bigtable.admin', + 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/bigtable_instance_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/bigtable_instance_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/bigtable_instance_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/bigtable_instance_admin_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a app_profile + * resource. + * + * @param string $project + * @param string $instance + * @param string $appProfile + * + * @return string The formatted app_profile resource. + */ + public static function appProfileName(string $project, string $instance, string $appProfile): string + { + return self::getPathTemplate('appProfile')->render([ + 'project' => $project, + 'instance' => $instance, + 'app_profile' => $appProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a cluster + * resource. + * + * @param string $project + * @param string $instance + * @param string $cluster + * + * @return string The formatted cluster resource. + */ + public static function clusterName(string $project, string $instance, string $cluster): string + { + return self::getPathTemplate('cluster')->render([ + 'project' => $project, + 'instance' => $instance, + 'cluster' => $cluster, + ]); + } + + /** + * 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 instance + * resource. + * + * @param string $project + * @param string $instance + * + * @return string The formatted instance resource. + */ + public static function instanceName(string $project, string $instance): string + { + return self::getPathTemplate('instance')->render([ + 'project' => $project, + 'instance' => $instance, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - appProfile: projects/{project}/instances/{instance}/appProfiles/{app_profile} + * - cluster: projects/{project}/instances/{instance}/clusters/{cluster} + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - instance: projects/{project}/instances/{instance} + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * Setting the "BIGTABLE_EMULATOR_HOST" environment variable will automatically set + * the API Endpoint to the value specified in the variable, as well as ensure that + * empty credentials are used in the transport layer. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'bigtableadmin.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $options = $this->setDefaultEmulatorConfig($options); + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates an app profile within an instance. + * + * The async variant is {@see BigtableInstanceAdminClient::createAppProfileAsync()} + * . + * + * @example samples/V2/BigtableInstanceAdminClient/create_app_profile.php + * + * @param CreateAppProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AppProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAppProfile(CreateAppProfileRequest $request, array $callOptions = []): AppProfile + { + return $this->startApiCall('CreateAppProfile', $request, $callOptions)->wait(); + } + + /** + * Creates a cluster within an instance. + * + * Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If + * serve_nodes is set to non-zero, then the cluster is manually scaled. If + * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is + * enabled. + * + * The async variant is {@see BigtableInstanceAdminClient::createClusterAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/create_cluster.php + * + * @param CreateClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createCluster(CreateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateCluster', $request, $callOptions)->wait(); + } + + /** + * Create an instance within a project. + * + * Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If + * serve_nodes is set to non-zero, then the cluster is manually scaled. If + * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is + * enabled. + * + * The async variant is {@see BigtableInstanceAdminClient::createInstanceAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/create_instance.php + * + * @param CreateInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createInstance(CreateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateInstance', $request, $callOptions)->wait(); + } + + /** + * Deletes an app profile from an instance. + * + * The async variant is {@see BigtableInstanceAdminClient::deleteAppProfileAsync()} + * . + * + * @example samples/V2/BigtableInstanceAdminClient/delete_app_profile.php + * + * @param DeleteAppProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAppProfile(DeleteAppProfileRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAppProfile', $request, $callOptions)->wait(); + } + + /** + * Deletes a cluster from an instance. + * + * The async variant is {@see BigtableInstanceAdminClient::deleteClusterAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/delete_cluster.php + * + * @param DeleteClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteCluster(DeleteClusterRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteCluster', $request, $callOptions)->wait(); + } + + /** + * Delete an instance from a project. + * + * The async variant is {@see BigtableInstanceAdminClient::deleteInstanceAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/delete_instance.php + * + * @param DeleteInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteInstance(DeleteInstanceRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteInstance', $request, $callOptions)->wait(); + } + + /** + * Gets information about an app profile. + * + * The async variant is {@see BigtableInstanceAdminClient::getAppProfileAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/get_app_profile.php + * + * @param GetAppProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AppProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAppProfile(GetAppProfileRequest $request, array $callOptions = []): AppProfile + { + return $this->startApiCall('GetAppProfile', $request, $callOptions)->wait(); + } + + /** + * Gets information about a cluster. + * + * The async variant is {@see BigtableInstanceAdminClient::getClusterAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/get_cluster.php + * + * @param GetClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Cluster + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCluster(GetClusterRequest $request, array $callOptions = []): Cluster + { + return $this->startApiCall('GetCluster', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for an instance resource. Returns an empty + * policy if an instance exists but does not have a policy set. + * + * The async variant is {@see BigtableInstanceAdminClient::getIamPolicyAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets information about an instance. + * + * The async variant is {@see BigtableInstanceAdminClient::getInstanceAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/get_instance.php + * + * @param GetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Instance + * + * @throws ApiException Thrown if the API call fails. + */ + public function getInstance(GetInstanceRequest $request, array $callOptions = []): Instance + { + return $this->startApiCall('GetInstance', $request, $callOptions)->wait(); + } + + /** + * Lists information about app profiles in an instance. + * + * The async variant is {@see BigtableInstanceAdminClient::listAppProfilesAsync()} + * . + * + * @example samples/V2/BigtableInstanceAdminClient/list_app_profiles.php + * + * @param ListAppProfilesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAppProfiles(ListAppProfilesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAppProfiles', $request, $callOptions); + } + + /** + * Lists information about clusters in an instance. + * + * The async variant is {@see BigtableInstanceAdminClient::listClustersAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/list_clusters.php + * + * @param ListClustersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ListClustersResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listClusters(ListClustersRequest $request, array $callOptions = []): ListClustersResponse + { + return $this->startApiCall('ListClusters', $request, $callOptions)->wait(); + } + + /** + * Lists hot tablets in a cluster, within the time range provided. Hot + * tablets are ordered based on CPU usage. + * + * The async variant is {@see BigtableInstanceAdminClient::listHotTabletsAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/list_hot_tablets.php + * + * @param ListHotTabletsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listHotTablets(ListHotTabletsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListHotTablets', $request, $callOptions); + } + + /** + * Lists information about instances in a project. + * + * The async variant is {@see BigtableInstanceAdminClient::listInstancesAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/list_instances.php + * + * @param ListInstancesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ListInstancesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listInstances(ListInstancesRequest $request, array $callOptions = []): ListInstancesResponse + { + return $this->startApiCall('ListInstances', $request, $callOptions)->wait(); + } + + /** + * Partially updates a cluster within a project. This method is the preferred + * way to update a Cluster. + * + * To enable and update autoscaling, set + * cluster_config.cluster_autoscaling_config. When autoscaling is enabled, + * serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it + * are ignored. Note that an update cannot simultaneously set serve_nodes to + * non-zero and cluster_config.cluster_autoscaling_config to non-empty, and + * also specify both in the update_mask. + * + * To disable autoscaling, clear cluster_config.cluster_autoscaling_config, + * and explicitly set a serve_node count via the update_mask. + * + * The async variant is + * {@see BigtableInstanceAdminClient::partialUpdateClusterAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/partial_update_cluster.php + * + * @param PartialUpdateClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function partialUpdateCluster(PartialUpdateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PartialUpdateCluster', $request, $callOptions)->wait(); + } + + /** + * Partially updates an instance within a project. This method can modify all + * fields of an Instance and is the preferred way to update an Instance. + * + * The async variant is + * {@see BigtableInstanceAdminClient::partialUpdateInstanceAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/partial_update_instance.php + * + * @param PartialUpdateInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function partialUpdateInstance(PartialUpdateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PartialUpdateInstance', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on an instance resource. Replaces any + * existing policy. + * + * The async variant is {@see BigtableInstanceAdminClient::setIamPolicyAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that the caller has on the specified instance resource. + * + * The async variant is + * {@see BigtableInstanceAdminClient::testIamPermissionsAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates an app profile within an instance. + * + * The async variant is {@see BigtableInstanceAdminClient::updateAppProfileAsync()} + * . + * + * @example samples/V2/BigtableInstanceAdminClient/update_app_profile.php + * + * @param UpdateAppProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAppProfile(UpdateAppProfileRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateAppProfile', $request, $callOptions)->wait(); + } + + /** + * Updates a cluster within an instance. + * + * Note that UpdateCluster does not support updating + * cluster_config.cluster_autoscaling_config. In order to update it, you + * must use PartialUpdateCluster. + * + * The async variant is {@see BigtableInstanceAdminClient::updateClusterAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/update_cluster.php + * + * @param Cluster $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCluster(Cluster $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateCluster', $request, $callOptions)->wait(); + } + + /** + * Updates an instance within a project. This method updates only the display + * name and type for an Instance. To update other Instance properties, such as + * labels, use PartialUpdateInstance. + * + * The async variant is {@see BigtableInstanceAdminClient::updateInstanceAsync()} . + * + * @example samples/V2/BigtableInstanceAdminClient/update_instance.php + * + * @param Instance $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Instance + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateInstance(Instance $request, array $callOptions = []): Instance + { + return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); + } + + /** Configure the gapic configuration to use a service emulator. */ + private function setDefaultEmulatorConfig(array $options): array + { + $emulatorHost = getenv('BIGTABLE_EMULATOR_HOST'); + if (empty($emulatorHost)) { + return $options; + } + + if ($scheme = parse_url($emulatorHost, PHP_URL_SCHEME)) { + $search = $scheme . '://'; + $emulatorHost = str_replace($search, '', $emulatorHost); + } + + $options['apiEndpoint'] ??= $emulatorHost; + $options['transportConfig']['grpc']['stubOpts']['credentials'] ??= ChannelCredentials::createInsecure(); + $options['credentials'] ??= new InsecureCredentialsWrapper(); + return $options; + } +} diff --git a/owl-bot-staging/Bigtable/v2/Admin/src/V2/Client/BigtableTableAdminClient.php b/owl-bot-staging/Bigtable/v2/Admin/src/V2/Client/BigtableTableAdminClient.php new file mode 100644 index 000000000000..cea556621cd8 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/src/V2/Client/BigtableTableAdminClient.php @@ -0,0 +1,1343 @@ + checkConsistencyAsync(CheckConsistencyRequest $request, array $optionalArgs = []) + * @method PromiseInterface copyBackupAsync(CopyBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface createAuthorizedViewAsync(CreateAuthorizedViewRequest $request, array $optionalArgs = []) + * @method PromiseInterface createBackupAsync(CreateBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface
createTableAsync(CreateTableRequest $request, array $optionalArgs = []) + * @method PromiseInterface createTableFromSnapshotAsync(CreateTableFromSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAuthorizedViewAsync(DeleteAuthorizedViewRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteBackupAsync(DeleteBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSnapshotAsync(DeleteSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteTableAsync(DeleteTableRequest $request, array $optionalArgs = []) + * @method PromiseInterface dropRowRangeAsync(DropRowRangeRequest $request, array $optionalArgs = []) + * @method PromiseInterface generateConsistencyTokenAsync(GenerateConsistencyTokenRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAuthorizedViewAsync(GetAuthorizedViewRequest $request, array $optionalArgs = []) + * @method PromiseInterface getBackupAsync(GetBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSnapshotAsync(GetSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface
getTableAsync(GetTableRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAuthorizedViewsAsync(ListAuthorizedViewsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listBackupsAsync(ListBackupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSnapshotsAsync(ListSnapshotsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTablesAsync(ListTablesRequest $request, array $optionalArgs = []) + * @method PromiseInterface
modifyColumnFamiliesAsync(ModifyColumnFamiliesRequest $request, array $optionalArgs = []) + * @method PromiseInterface restoreTableAsync(RestoreTableRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface snapshotTableAsync(SnapshotTableRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface undeleteTableAsync(UndeleteTableRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAuthorizedViewAsync(UpdateAuthorizedViewRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateBackupAsync(UpdateBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateTableAsync(UpdateTableRequest $request, array $optionalArgs = []) + */ +final class BigtableTableAdminClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.bigtable.admin.v2.BigtableTableAdmin'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'bigtableadmin.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'bigtableadmin.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/bigtable.admin', + 'https://www.googleapis.com/auth/bigtable.admin.table', + 'https://www.googleapis.com/auth/cloud-bigtable.admin', + 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/bigtable_table_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/bigtable_table_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/bigtable_table_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/bigtable_table_admin_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * authorized_view resource. + * + * @param string $project + * @param string $instance + * @param string $table + * @param string $authorizedView + * + * @return string The formatted authorized_view resource. + */ + public static function authorizedViewName(string $project, string $instance, string $table, string $authorizedView): string + { + return self::getPathTemplate('authorizedView')->render([ + 'project' => $project, + 'instance' => $instance, + 'table' => $table, + 'authorized_view' => $authorizedView, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a backup + * resource. + * + * @param string $project + * @param string $instance + * @param string $cluster + * @param string $backup + * + * @return string The formatted backup resource. + */ + public static function backupName(string $project, string $instance, string $cluster, string $backup): string + { + return self::getPathTemplate('backup')->render([ + 'project' => $project, + 'instance' => $instance, + 'cluster' => $cluster, + 'backup' => $backup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a cluster + * resource. + * + * @param string $project + * @param string $instance + * @param string $cluster + * + * @return string The formatted cluster resource. + */ + public static function clusterName(string $project, string $instance, string $cluster): string + { + return self::getPathTemplate('cluster')->render([ + 'project' => $project, + 'instance' => $instance, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * crypto_key_version resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * @param string $cryptoKeyVersion + * + * @return string The formatted crypto_key_version resource. + */ + public static function cryptoKeyVersionName(string $project, string $location, string $keyRing, string $cryptoKey, string $cryptoKeyVersion): string + { + return self::getPathTemplate('cryptoKeyVersion')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + 'crypto_key_version' => $cryptoKeyVersion, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $instance + * + * @return string The formatted instance resource. + */ + public static function instanceName(string $project, string $instance): string + { + return self::getPathTemplate('instance')->render([ + 'project' => $project, + 'instance' => $instance, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a snapshot + * resource. + * + * @param string $project + * @param string $instance + * @param string $cluster + * @param string $snapshot + * + * @return string The formatted snapshot resource. + */ + public static function snapshotName(string $project, string $instance, string $cluster, string $snapshot): string + { + return self::getPathTemplate('snapshot')->render([ + 'project' => $project, + 'instance' => $instance, + 'cluster' => $cluster, + 'snapshot' => $snapshot, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a table + * resource. + * + * @param string $project + * @param string $instance + * @param string $table + * + * @return string The formatted table resource. + */ + public static function tableName(string $project, string $instance, string $table): string + { + return self::getPathTemplate('table')->render([ + 'project' => $project, + 'instance' => $instance, + 'table' => $table, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - authorizedView: projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view} + * - backup: projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup} + * - cluster: projects/{project}/instances/{instance}/clusters/{cluster} + * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} + * - instance: projects/{project}/instances/{instance} + * - snapshot: projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot} + * - table: projects/{project}/instances/{instance}/tables/{table} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * Setting the "BIGTABLE_EMULATOR_HOST" environment variable will automatically set + * the API Endpoint to the value specified in the variable, as well as ensure that + * empty credentials are used in the transport layer. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'bigtableadmin.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $options = $this->setDefaultEmulatorConfig($options); + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Checks replication consistency based on a consistency token, that is, if + * replication has caught up based on the conditions specified in the token + * and the check request. + * + * The async variant is {@see BigtableTableAdminClient::checkConsistencyAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/check_consistency.php + * + * @param CheckConsistencyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CheckConsistencyResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function checkConsistency(CheckConsistencyRequest $request, array $callOptions = []): CheckConsistencyResponse + { + return $this->startApiCall('CheckConsistency', $request, $callOptions)->wait(); + } + + /** + * Copy a Cloud Bigtable backup to a new backup in the destination cluster + * located in the destination instance and project. + * + * The async variant is {@see BigtableTableAdminClient::copyBackupAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/copy_backup.php + * + * @param CopyBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function copyBackup(CopyBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CopyBackup', $request, $callOptions)->wait(); + } + + /** + * Creates a new AuthorizedView in a table. + * + * The async variant is + * {@see BigtableTableAdminClient::createAuthorizedViewAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/create_authorized_view.php + * + * @param CreateAuthorizedViewRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAuthorizedView(CreateAuthorizedViewRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateAuthorizedView', $request, $callOptions)->wait(); + } + + /** + * Starts creating a new Cloud Bigtable Backup. The returned backup + * [long-running operation][google.longrunning.Operation] can be used to + * track creation of the backup. The + * [metadata][google.longrunning.Operation.metadata] field type is + * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The + * [response][google.longrunning.Operation.response] field type is + * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the + * returned operation will stop the creation and delete the backup. + * + * The async variant is {@see BigtableTableAdminClient::createBackupAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/create_backup.php + * + * @param CreateBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBackup(CreateBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateBackup', $request, $callOptions)->wait(); + } + + /** + * Creates a new table in the specified instance. + * The table can be created with a full set of initial column families, + * specified in the request. + * + * The async variant is {@see BigtableTableAdminClient::createTableAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/create_table.php + * + * @param CreateTableRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Table + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTable(CreateTableRequest $request, array $callOptions = []): Table + { + return $this->startApiCall('CreateTable', $request, $callOptions)->wait(); + } + + /** + * Creates a new table from the specified snapshot. The target table must + * not exist. The snapshot and the table must be in the same instance. + * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * + * The async variant is + * {@see BigtableTableAdminClient::createTableFromSnapshotAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/create_table_from_snapshot.php + * + * @param CreateTableFromSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTableFromSnapshot(CreateTableFromSnapshotRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateTableFromSnapshot', $request, $callOptions)->wait(); + } + + /** + * Permanently deletes a specified AuthorizedView. + * + * The async variant is + * {@see BigtableTableAdminClient::deleteAuthorizedViewAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/delete_authorized_view.php + * + * @param DeleteAuthorizedViewRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAuthorizedView(DeleteAuthorizedViewRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAuthorizedView', $request, $callOptions)->wait(); + } + + /** + * Deletes a pending or completed Cloud Bigtable backup. + * + * The async variant is {@see BigtableTableAdminClient::deleteBackupAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/delete_backup.php + * + * @param DeleteBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackup(DeleteBackupRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteBackup', $request, $callOptions)->wait(); + } + + /** + * Permanently deletes the specified snapshot. + * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * + * The async variant is {@see BigtableTableAdminClient::deleteSnapshotAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/delete_snapshot.php + * + * @param DeleteSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSnapshot(DeleteSnapshotRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSnapshot', $request, $callOptions)->wait(); + } + + /** + * Permanently deletes a specified table and all of its data. + * + * The async variant is {@see BigtableTableAdminClient::deleteTableAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/delete_table.php + * + * @param DeleteTableRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteTable(DeleteTableRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteTable', $request, $callOptions)->wait(); + } + + /** + * Permanently drop/delete a row range from a specified table. The request can + * specify whether to delete all rows in a table, or only those that match a + * particular prefix. + * + * The async variant is {@see BigtableTableAdminClient::dropRowRangeAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/drop_row_range.php + * + * @param DropRowRangeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function dropRowRange(DropRowRangeRequest $request, array $callOptions = []): void + { + $this->startApiCall('DropRowRange', $request, $callOptions)->wait(); + } + + /** + * Generates a consistency token for a Table, which can be used in + * CheckConsistency to check whether mutations to the table that finished + * before this call started have been replicated. The tokens will be available + * for 90 days. + * + * The async variant is + * {@see BigtableTableAdminClient::generateConsistencyTokenAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/generate_consistency_token.php + * + * @param GenerateConsistencyTokenRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GenerateConsistencyTokenResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateConsistencyToken(GenerateConsistencyTokenRequest $request, array $callOptions = []): GenerateConsistencyTokenResponse + { + return $this->startApiCall('GenerateConsistencyToken', $request, $callOptions)->wait(); + } + + /** + * Gets information from a specified AuthorizedView. + * + * The async variant is {@see BigtableTableAdminClient::getAuthorizedViewAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/get_authorized_view.php + * + * @param GetAuthorizedViewRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AuthorizedView + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAuthorizedView(GetAuthorizedViewRequest $request, array $callOptions = []): AuthorizedView + { + return $this->startApiCall('GetAuthorizedView', $request, $callOptions)->wait(); + } + + /** + * Gets metadata on a pending or completed Cloud Bigtable Backup. + * + * The async variant is {@see BigtableTableAdminClient::getBackupAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/get_backup.php + * + * @param GetBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Backup + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackup(GetBackupRequest $request, array $callOptions = []): Backup + { + return $this->startApiCall('GetBackup', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a Table or Backup resource. + * Returns an empty policy if the resource exists but does not have a policy + * set. + * + * The async variant is {@see BigtableTableAdminClient::getIamPolicyAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets metadata information about the specified snapshot. + * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * + * The async variant is {@see BigtableTableAdminClient::getSnapshotAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/get_snapshot.php + * + * @param GetSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Snapshot + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSnapshot(GetSnapshotRequest $request, array $callOptions = []): Snapshot + { + return $this->startApiCall('GetSnapshot', $request, $callOptions)->wait(); + } + + /** + * Gets metadata information about the specified table. + * + * The async variant is {@see BigtableTableAdminClient::getTableAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/get_table.php + * + * @param GetTableRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Table + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTable(GetTableRequest $request, array $callOptions = []): Table + { + return $this->startApiCall('GetTable', $request, $callOptions)->wait(); + } + + /** + * Lists all AuthorizedViews from a specific table. + * + * The async variant is {@see BigtableTableAdminClient::listAuthorizedViewsAsync()} + * . + * + * @example samples/V2/BigtableTableAdminClient/list_authorized_views.php + * + * @param ListAuthorizedViewsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAuthorizedViews(ListAuthorizedViewsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAuthorizedViews', $request, $callOptions); + } + + /** + * Lists Cloud Bigtable backups. Returns both completed and pending + * backups. + * + * The async variant is {@see BigtableTableAdminClient::listBackupsAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/list_backups.php + * + * @param ListBackupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackups(ListBackupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBackups', $request, $callOptions); + } + + /** + * Lists all snapshots associated with the specified cluster. + * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * + * The async variant is {@see BigtableTableAdminClient::listSnapshotsAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/list_snapshots.php + * + * @param ListSnapshotsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSnapshots(ListSnapshotsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSnapshots', $request, $callOptions); + } + + /** + * Lists all tables served from a specified instance. + * + * The async variant is {@see BigtableTableAdminClient::listTablesAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/list_tables.php + * + * @param ListTablesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTables(ListTablesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTables', $request, $callOptions); + } + + /** + * Performs a series of column family modifications on the specified table. + * Either all or none of the modifications will occur before this method + * returns, but data requests received prior to that point may see a table + * where only some modifications have taken effect. + * + * The async variant is + * {@see BigtableTableAdminClient::modifyColumnFamiliesAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/modify_column_families.php + * + * @param ModifyColumnFamiliesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Table + * + * @throws ApiException Thrown if the API call fails. + */ + public function modifyColumnFamilies(ModifyColumnFamiliesRequest $request, array $callOptions = []): Table + { + return $this->startApiCall('ModifyColumnFamilies', $request, $callOptions)->wait(); + } + + /** + * Create a new table by restoring from a completed backup. The + * returned table [long-running operation][google.longrunning.Operation] can + * be used to track the progress of the operation, and to cancel it. The + * [metadata][google.longrunning.Operation.metadata] field type is + * [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata]. The + * [response][google.longrunning.Operation.response] type is + * [Table][google.bigtable.admin.v2.Table], if successful. + * + * The async variant is {@see BigtableTableAdminClient::restoreTableAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/restore_table.php + * + * @param RestoreTableRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function restoreTable(RestoreTableRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RestoreTable', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on a Table or Backup resource. + * Replaces any existing policy. + * + * The async variant is {@see BigtableTableAdminClient::setIamPolicyAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a new snapshot in the specified cluster from the specified + * source table. The cluster and the table must be in the same instance. + * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * + * The async variant is {@see BigtableTableAdminClient::snapshotTableAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/snapshot_table.php + * + * @param SnapshotTableRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function snapshotTable(SnapshotTableRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SnapshotTable', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that the caller has on the specified Table or Backup + * resource. + * + * The async variant is {@see BigtableTableAdminClient::testIamPermissionsAsync()} + * . + * + * @example samples/V2/BigtableTableAdminClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Restores a specified table which was accidentally deleted. + * + * The async variant is {@see BigtableTableAdminClient::undeleteTableAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/undelete_table.php + * + * @param UndeleteTableRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function undeleteTable(UndeleteTableRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UndeleteTable', $request, $callOptions)->wait(); + } + + /** + * Updates an AuthorizedView in a table. + * + * The async variant is + * {@see BigtableTableAdminClient::updateAuthorizedViewAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/update_authorized_view.php + * + * @param UpdateAuthorizedViewRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAuthorizedView(UpdateAuthorizedViewRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateAuthorizedView', $request, $callOptions)->wait(); + } + + /** + * Updates a pending or completed Cloud Bigtable Backup. + * + * The async variant is {@see BigtableTableAdminClient::updateBackupAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/update_backup.php + * + * @param UpdateBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Backup + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateBackup(UpdateBackupRequest $request, array $callOptions = []): Backup + { + return $this->startApiCall('UpdateBackup', $request, $callOptions)->wait(); + } + + /** + * Updates a specified table. + * + * The async variant is {@see BigtableTableAdminClient::updateTableAsync()} . + * + * @example samples/V2/BigtableTableAdminClient/update_table.php + * + * @param UpdateTableRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateTable(UpdateTableRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateTable', $request, $callOptions)->wait(); + } + + /** Configure the gapic configuration to use a service emulator. */ + private function setDefaultEmulatorConfig(array $options): array + { + $emulatorHost = getenv('BIGTABLE_EMULATOR_HOST'); + if (empty($emulatorHost)) { + return $options; + } + + if ($scheme = parse_url($emulatorHost, PHP_URL_SCHEME)) { + $search = $scheme . '://'; + $emulatorHost = str_replace($search, '', $emulatorHost); + } + + $options['apiEndpoint'] ??= $emulatorHost; + $options['transportConfig']['grpc']['stubOpts']['credentials'] ??= ChannelCredentials::createInsecure(); + $options['credentials'] ??= new InsecureCredentialsWrapper(); + return $options; + } +} diff --git a/owl-bot-staging/Bigtable/v2/Admin/src/V2/gapic_metadata.json b/owl-bot-staging/Bigtable/v2/Admin/src/V2/gapic_metadata.json new file mode 100644 index 000000000000..fecd9cc3d7ed --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/src/V2/gapic_metadata.json @@ -0,0 +1,282 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.bigtable.admin.v2", + "libraryPackage": "Google\\Cloud\\Bigtable\\Admin\\V2", + "services": { + "BigtableInstanceAdmin": { + "clients": { + "grpc": { + "libraryClient": "BigtableInstanceAdminGapicClient", + "rpcs": { + "CreateAppProfile": { + "methods": [ + "createAppProfile" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteAppProfile": { + "methods": [ + "deleteAppProfile" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "GetAppProfile": { + "methods": [ + "getAppProfile" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ListAppProfiles": { + "methods": [ + "listAppProfiles" + ] + }, + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "ListHotTablets": { + "methods": [ + "listHotTablets" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "PartialUpdateCluster": { + "methods": [ + "partialUpdateCluster" + ] + }, + "PartialUpdateInstance": { + "methods": [ + "partialUpdateInstance" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateAppProfile": { + "methods": [ + "updateAppProfile" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + } + } + } + } + }, + "BigtableTableAdmin": { + "clients": { + "grpc": { + "libraryClient": "BigtableTableAdminGapicClient", + "rpcs": { + "CheckConsistency": { + "methods": [ + "checkConsistency" + ] + }, + "CopyBackup": { + "methods": [ + "copyBackup" + ] + }, + "CreateAuthorizedView": { + "methods": [ + "createAuthorizedView" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "CreateTable": { + "methods": [ + "createTable" + ] + }, + "CreateTableFromSnapshot": { + "methods": [ + "createTableFromSnapshot" + ] + }, + "DeleteAuthorizedView": { + "methods": [ + "deleteAuthorizedView" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "DeleteSnapshot": { + "methods": [ + "deleteSnapshot" + ] + }, + "DeleteTable": { + "methods": [ + "deleteTable" + ] + }, + "DropRowRange": { + "methods": [ + "dropRowRange" + ] + }, + "GenerateConsistencyToken": { + "methods": [ + "generateConsistencyToken" + ] + }, + "GetAuthorizedView": { + "methods": [ + "getAuthorizedView" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetSnapshot": { + "methods": [ + "getSnapshot" + ] + }, + "GetTable": { + "methods": [ + "getTable" + ] + }, + "ListAuthorizedViews": { + "methods": [ + "listAuthorizedViews" + ] + }, + "ListBackups": { + "methods": [ + "listBackups" + ] + }, + "ListSnapshots": { + "methods": [ + "listSnapshots" + ] + }, + "ListTables": { + "methods": [ + "listTables" + ] + }, + "ModifyColumnFamilies": { + "methods": [ + "modifyColumnFamilies" + ] + }, + "RestoreTable": { + "methods": [ + "restoreTable" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SnapshotTable": { + "methods": [ + "snapshotTable" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UndeleteTable": { + "methods": [ + "undeleteTable" + ] + }, + "UpdateAuthorizedView": { + "methods": [ + "updateAuthorizedView" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "UpdateTable": { + "methods": [ + "updateTable" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_instance_admin_client_config.json b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_instance_admin_client_config.json new file mode 100644 index 000000000000..536c98a6fb2b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_instance_admin_client_config.json @@ -0,0 +1,131 @@ +{ + "interfaces": { + "google.bigtable.admin.v2.BigtableInstanceAdmin": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateAppProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAppProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAppProfile": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetCluster": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAppProfiles": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListClusters": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListHotTablets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "PartialUpdateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PartialUpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAppProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_instance_admin_descriptor_config.php b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_instance_admin_descriptor_config.php new file mode 100644 index 000000000000..4232256b1ba6 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_instance_admin_descriptor_config.php @@ -0,0 +1,349 @@ + [ + 'google.bigtable.admin.v2.BigtableInstanceAdmin' => [ + 'CreateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Cluster', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata', + 'initialPollDelayMillis' => '5000', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '60000', + 'totalPollTimeoutMillis' => '21600000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Instance', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\CreateInstanceMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '600000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'PartialUpdateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Cluster', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\PartialUpdateClusterMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '600000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'cluster.name', + 'fieldAccessors' => [ + 'getCluster', + 'getName', + ], + ], + ], + ], + 'PartialUpdateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Instance', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\UpdateInstanceMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '600000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'instance.name', + 'fieldAccessors' => [ + 'getInstance', + 'getName', + ], + ], + ], + ], + 'UpdateAppProfile' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\AppProfile', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\UpdateAppProfileMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '600000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'app_profile.name', + 'fieldAccessors' => [ + 'getAppProfile', + 'getName', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Cluster', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\UpdateClusterMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '600000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateAppProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\AppProfile', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAppProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteCluster' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteInstance' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetAppProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\AppProfile', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\Cluster', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetInstance' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\Instance', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAppProfiles' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAppProfiles', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\ListAppProfilesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListClusters' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\ListClustersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListHotTablets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getHotTablets', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\ListHotTabletsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListInstances' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\ListInstancesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\Instance', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'appProfile' => 'projects/{project}/instances/{instance}/appProfiles/{app_profile}', + 'cluster' => 'projects/{project}/instances/{instance}/clusters/{cluster}', + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', + 'instance' => 'projects/{project}/instances/{instance}', + 'location' => 'projects/{project}/locations/{location}', + 'project' => 'projects/{project}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_instance_admin_rest_client_config.php b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_instance_admin_rest_client_config.php new file mode 100644 index 000000000000..a92f99ec26d8 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_instance_admin_rest_client_config.php @@ -0,0 +1,338 @@ + [ + 'google.bigtable.admin.v2.BigtableInstanceAdmin' => [ + 'CreateAppProfile' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*}/appProfiles', + 'body' => 'app_profile', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'app_profile_id', + ], + ], + 'CreateCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*}/clusters', + 'body' => 'cluster', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'cluster_id', + ], + ], + 'CreateInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/instances', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAppProfile' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/appProfiles/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + 'queryParams' => [ + 'ignore_warnings', + ], + ], + 'DeleteCluster' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteInstance' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAppProfile' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/appProfiles/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/instances/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetInstance' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListAppProfiles' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*}/appProfiles', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListClusters' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*}/clusters', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListHotTablets' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*/clusters/*}/hotTablets', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListInstances' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/instances', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PartialUpdateCluster' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{cluster.name=projects/*/instances/*/clusters/*}', + 'body' => 'cluster', + 'placeholders' => [ + 'cluster.name' => [ + 'getters' => [ + 'getCluster', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'PartialUpdateInstance' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{instance.name=projects/*/instances/*}', + 'body' => 'instance', + 'placeholders' => [ + 'instance.name' => [ + 'getters' => [ + 'getInstance', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/instances/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/instances/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateAppProfile' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}', + 'body' => 'app_profile', + 'placeholders' => [ + 'app_profile.name' => [ + 'getters' => [ + 'getAppProfile', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateCluster' => [ + 'method' => 'put', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/clusters/*}', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'method' => 'put', + 'uriTemplate' => '/v2/{name=projects/*/instances/*}', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=operations/**}:cancel', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=operations/projects/**}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_table_admin_client_config.json b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_table_admin_client_config.json new file mode 100644 index 000000000000..47b0c167c97c --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_table_admin_client_config.json @@ -0,0 +1,176 @@ +{ + "interfaces": { + "google.bigtable.admin.v2.BigtableTableAdmin": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CheckConsistency": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CopyBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAuthorizedView": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTable": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTableFromSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAuthorizedView": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTable": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DropRowRange": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateConsistencyToken": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAuthorizedView": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetTable": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAuthorizedViews": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListSnapshots": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTables": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ModifyColumnFamilies": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreTable": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SnapshotTable": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeleteTable": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAuthorizedView": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTable": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_table_admin_descriptor_config.php b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_table_admin_descriptor_config.php new file mode 100644 index 000000000000..c2ada4e51105 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_table_admin_descriptor_config.php @@ -0,0 +1,495 @@ + [ + 'google.bigtable.admin.v2.BigtableTableAdmin' => [ + 'CopyBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Backup', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\CopyBackupMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateAuthorizedView' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\AuthorizedView', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\CreateAuthorizedViewMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Backup', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\CreateBackupMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '600000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateTableFromSnapshot' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Table', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\CreateTableFromSnapshotMetadata', + 'initialPollDelayMillis' => '5000', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '60000', + 'totalPollTimeoutMillis' => '3600000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RestoreTable' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Table', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\RestoreTableMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '600000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SnapshotTable' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Snapshot', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\SnapshotTableMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '600000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UndeleteTable' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Table', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\UndeleteTableMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateAuthorizedView' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\AuthorizedView', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\UpdateAuthorizedViewMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'authorized_view.name', + 'fieldAccessors' => [ + 'getAuthorizedView', + 'getName', + ], + ], + ], + ], + 'UpdateTable' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Table', + 'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\UpdateTableMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'table.name', + 'fieldAccessors' => [ + 'getTable', + 'getName', + ], + ], + ], + ], + 'CheckConsistency' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\CheckConsistencyResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateTable' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\Table', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAuthorizedView' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSnapshot' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTable' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DropRowRange' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GenerateConsistencyToken' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\GenerateConsistencyTokenResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetAuthorizedView' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\AuthorizedView', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\Backup', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetSnapshot' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\Snapshot', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetTable' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\Table', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAuthorizedViews' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAuthorizedViews', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\ListAuthorizedViewsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackups', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\ListBackupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListSnapshots' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSnapshots', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\ListSnapshotsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListTables' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTables', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\ListTablesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ModifyColumnFamilies' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\Table', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\Admin\V2\Backup', + 'headerParams' => [ + [ + 'keyName' => 'backup.name', + 'fieldAccessors' => [ + 'getBackup', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'authorizedView' => 'projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}', + 'backup' => 'projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}', + 'cluster' => 'projects/{project}/instances/{instance}/clusters/{cluster}', + 'cryptoKeyVersion' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}', + 'instance' => 'projects/{project}/instances/{instance}', + 'snapshot' => 'projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}', + 'table' => 'projects/{project}/instances/{instance}/tables/{table}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_table_admin_rest_client_config.php b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_table_admin_rest_client_config.php new file mode 100644 index 000000000000..70910ee9a916 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/src/V2/resources/bigtable_table_admin_rest_client_config.php @@ -0,0 +1,459 @@ + [ + 'google.bigtable.admin.v2.BigtableTableAdmin' => [ + 'CheckConsistency' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/tables/*}:checkConsistency', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CopyBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*/clusters/*}/backups:copy', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateAuthorizedView' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews', + 'body' => 'authorized_view', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'authorized_view_id', + ], + ], + 'CreateBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*/clusters/*}/backups', + 'body' => 'backup', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_id', + ], + ], + 'CreateTable' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*}/tables', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateTableFromSnapshot' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAuthorizedView' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/clusters/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSnapshot' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTable' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/tables/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DropRowRange' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/tables/*}:dropRowRange', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GenerateConsistencyToken' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAuthorizedView' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBackup' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/clusters/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/instances/*/tables/*}:getIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:getIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetSnapshot' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTable' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/tables/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListAuthorizedViews' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackups' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*/clusters/*}/backups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSnapshots' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*/clusters/*}/snapshots', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTables' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*}/tables', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ModifyColumnFamilies' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RestoreTable' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*}/tables:restore', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/instances/*/tables/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SnapshotTable' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/tables/*}:snapshot', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/instances/*/tables/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UndeleteTable' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/instances/*/tables/*}:undelete', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateAuthorizedView' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{authorized_view.name=projects/*/instances/*/tables/*/authorizedViews/*}', + 'body' => 'authorized_view', + 'placeholders' => [ + 'authorized_view.name' => [ + 'getters' => [ + 'getAuthorizedView', + 'getName', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{backup.name=projects/*/instances/*/clusters/*/backups/*}', + 'body' => 'backup', + 'placeholders' => [ + 'backup.name' => [ + 'getters' => [ + 'getBackup', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateTable' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{table.name=projects/*/instances/*/tables/*}', + 'body' => 'table', + 'placeholders' => [ + 'table.name' => [ + 'getters' => [ + 'getTable', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=operations/**}:cancel', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=operations/projects/**}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Bigtable/v2/Admin/tests/Unit/V2/Client/BigtableInstanceAdminClientTest.php b/owl-bot-staging/Bigtable/v2/Admin/tests/Unit/V2/Client/BigtableInstanceAdminClientTest.php new file mode 100644 index 000000000000..7b5c8c4fb05f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/tests/Unit/V2/Client/BigtableInstanceAdminClientTest.php @@ -0,0 +1,2070 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BigtableInstanceAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BigtableInstanceAdminClient($options); + } + + /** @test */ + public function createAppProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $description = 'description-1724546052'; + $expectedResponse = new AppProfile(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $appProfileId = 'appProfileId1262094415'; + $appProfile = new AppProfile(); + $request = (new CreateAppProfileRequest()) + ->setParent($formattedParent) + ->setAppProfileId($appProfileId) + ->setAppProfile($appProfile); + $response = $gapicClient->createAppProfile($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateAppProfile', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getAppProfileId(); + $this->assertProtobufEquals($appProfileId, $actualValue); + $actualValue = $actualRequestObject->getAppProfile(); + $this->assertProtobufEquals($appProfile, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createAppProfileExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $appProfileId = 'appProfileId1262094415'; + $appProfile = new AppProfile(); + $request = (new CreateAppProfileRequest()) + ->setParent($formattedParent) + ->setAppProfileId($appProfileId) + ->setAppProfile($appProfile); + try { + $gapicClient->createAppProfile($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $location = 'location1901043637'; + $serveNodes = 1288838783; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setLocation($location); + $expectedResponse->setServeNodes($serveNodes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterServeNodes = 1434304124; + $cluster->setServeNodes($clusterServeNodes); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterServeNodes = 1434304124; + $cluster->setServeNodes($clusterServeNodes); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $satisfiesPzs = false; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceName = 'instanceName-737857344'; + $instance->setName($instanceName); + $instanceDisplayName = 'instanceDisplayName1824500376'; + $instance->setDisplayName($instanceDisplayName); + $instanceType = Type::TYPE_UNSPECIFIED; + $instance->setType($instanceType); + $labelsValue = 'labelsValue950036658'; + $instanceLabels = [ + 'labelsKey' => $labelsValue, + ]; + $instance->setLabels($instanceLabels); + $clustersValue = new Cluster(); + $valueName = 'valueName-765894756'; + $clustersValue->setName($valueName); + $valueServeNodes = 370436813; + $clustersValue->setServeNodes($valueServeNodes); + $clusters = [ + 'clustersKey' => $clustersValue, + ]; + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance) + ->setClusters($clusters); + $response = $gapicClient->createInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getClusters(); + $this->assertProtobufEquals($clusters, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceName = 'instanceName-737857344'; + $instance->setName($instanceName); + $instanceDisplayName = 'instanceDisplayName1824500376'; + $instance->setDisplayName($instanceDisplayName); + $instanceType = Type::TYPE_UNSPECIFIED; + $instance->setType($instanceType); + $labelsValue = 'labelsValue950036658'; + $instanceLabels = [ + 'labelsKey' => $labelsValue, + ]; + $instance->setLabels($instanceLabels); + $clustersValue = new Cluster(); + $valueName = 'valueName-765894756'; + $clustersValue->setName($valueName); + $valueServeNodes = 370436813; + $clustersValue->setServeNodes($valueServeNodes); + $clusters = [ + 'clustersKey' => $clustersValue, + ]; + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance) + ->setClusters($clusters); + $response = $gapicClient->createInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteAppProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); + $ignoreWarnings = true; + $request = (new DeleteAppProfileRequest()) + ->setName($formattedName) + ->setIgnoreWarnings($ignoreWarnings); + $gapicClient->deleteAppProfile($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteAppProfile', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getIgnoreWarnings(); + $this->assertProtobufEquals($ignoreWarnings, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAppProfileExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); + $ignoreWarnings = true; + $request = (new DeleteAppProfileRequest()) + ->setName($formattedName) + ->setIgnoreWarnings($ignoreWarnings); + try { + $gapicClient->deleteAppProfile($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteClusterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $request = (new DeleteClusterRequest()) + ->setName($formattedName); + $gapicClient->deleteCluster($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteCluster', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteClusterExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $request = (new DeleteClusterRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteCluster($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); + $gapicClient->deleteInstance($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteInstanceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteInstance($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAppProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $description = 'description-1724546052'; + $expectedResponse = new AppProfile(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); + $request = (new GetAppProfileRequest()) + ->setName($formattedName); + $response = $gapicClient->getAppProfile($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetAppProfile', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAppProfileExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); + $request = (new GetAppProfileRequest()) + ->setName($formattedName); + try { + $gapicClient->getAppProfile($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $location = 'location1901043637'; + $serveNodes = 1288838783; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setLocation($location); + $expectedResponse->setServeNodes($serveNodes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $request = (new GetClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->getCluster($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetCluster', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $request = (new GetClusterRequest()) + ->setName($formattedName); + try { + $gapicClient->getCluster($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $satisfiesPzs = false; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->getInstance($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + try { + $gapicClient->getInstance($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAppProfilesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $appProfilesElement = new AppProfile(); + $appProfiles = [ + $appProfilesElement, + ]; + $expectedResponse = new ListAppProfilesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAppProfiles($appProfiles); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new ListAppProfilesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listAppProfiles($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAppProfiles()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListAppProfiles', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAppProfilesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new ListAppProfilesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listAppProfiles($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = 'nextPageToken-1530815211'; + $expectedResponse = new ListClustersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new ListClustersRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listClusters($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListClusters', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new ListClustersRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listClusters($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listHotTabletsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $hotTabletsElement = new HotTablet(); + $hotTablets = [ + $hotTabletsElement, + ]; + $expectedResponse = new ListHotTabletsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setHotTablets($hotTablets); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $request = (new ListHotTabletsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listHotTablets($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getHotTablets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListHotTablets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listHotTabletsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $request = (new ListHotTabletsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listHotTablets($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = 'nextPageToken-1530815211'; + $expectedResponse = new ListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listInstances($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listInstances($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function partialUpdateClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/partialUpdateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $location = 'location1901043637'; + $serveNodes = 1288838783; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setLocation($location); + $expectedResponse->setServeNodes($serveNodes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/partialUpdateClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterServeNodes = 1434304124; + $cluster->setServeNodes($clusterServeNodes); + $updateMask = new FieldMask(); + $request = (new PartialUpdateClusterRequest()) + ->setCluster($cluster) + ->setUpdateMask($updateMask); + $response = $gapicClient->partialUpdateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/PartialUpdateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/partialUpdateClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function partialUpdateClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/partialUpdateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterServeNodes = 1434304124; + $cluster->setServeNodes($clusterServeNodes); + $updateMask = new FieldMask(); + $request = (new PartialUpdateClusterRequest()) + ->setCluster($cluster) + ->setUpdateMask($updateMask); + $response = $gapicClient->partialUpdateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/partialUpdateClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function partialUpdateInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/partialUpdateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $satisfiesPzs = false; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/partialUpdateInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = new Instance(); + $instanceName = 'instanceName-737857344'; + $instance->setName($instanceName); + $instanceDisplayName = 'instanceDisplayName1824500376'; + $instance->setDisplayName($instanceDisplayName); + $instanceType = Type::TYPE_UNSPECIFIED; + $instance->setType($instanceType); + $labelsValue = 'labelsValue950036658'; + $instanceLabels = [ + 'labelsKey' => $labelsValue, + ]; + $instance->setLabels($instanceLabels); + $updateMask = new FieldMask(); + $request = (new PartialUpdateInstanceRequest()) + ->setInstance($instance) + ->setUpdateMask($updateMask); + $response = $gapicClient->partialUpdateInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/PartialUpdateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/partialUpdateInstanceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function partialUpdateInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/partialUpdateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $instance = new Instance(); + $instanceName = 'instanceName-737857344'; + $instance->setName($instanceName); + $instanceDisplayName = 'instanceDisplayName1824500376'; + $instance->setDisplayName($instanceDisplayName); + $instanceType = Type::TYPE_UNSPECIFIED; + $instance->setType($instanceType); + $labelsValue = 'labelsValue950036658'; + $instanceLabels = [ + 'labelsKey' => $labelsValue, + ]; + $instance->setLabels($instanceLabels); + $updateMask = new FieldMask(); + $request = (new PartialUpdateInstanceRequest()) + ->setInstance($instance) + ->setUpdateMask($updateMask); + $response = $gapicClient->partialUpdateInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/partialUpdateInstanceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAppProfileTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateAppProfileTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $etag = 'etag3123477'; + $description = 'description-1724546052'; + $expectedResponse = new AppProfile(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateAppProfileTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $appProfile = new AppProfile(); + $updateMask = new FieldMask(); + $request = (new UpdateAppProfileRequest()) + ->setAppProfile($appProfile) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateAppProfile($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateAppProfile', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAppProfile(); + $this->assertProtobufEquals($appProfile, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAppProfileTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateAppProfileExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateAppProfileTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $appProfile = new AppProfile(); + $updateMask = new FieldMask(); + $request = (new UpdateAppProfileRequest()) + ->setAppProfile($appProfile) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateAppProfile($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAppProfileTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $location2 = 'location21541837352'; + $serveNodes2 = 1623486220; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setLocation($location2); + $expectedResponse->setServeNodes($serveNodes2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $serveNodes = 1288838783; + $request = (new Cluster()) + ->setName($name) + ->setServeNodes($serveNodes); + $response = $gapicClient->updateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualApiRequestObject->getServeNodes(); + $this->assertProtobufEquals($serveNodes, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $serveNodes = 1288838783; + $request = (new Cluster()) + ->setName($name) + ->setServeNodes($serveNodes); + $response = $gapicClient->updateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName2 = 'displayName21615000987'; + $satisfiesPzs2 = true; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName2); + $expectedResponse->setSatisfiesPzs($satisfiesPzs2); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $type = Type::TYPE_UNSPECIFIED; + $labelsValue = 'labelsValue950036658'; + $labels = [ + 'labelsKey' => $labelsValue, + ]; + $request = (new Instance()) + ->setName($name) + ->setDisplayName($displayName) + ->setType($type) + ->setLabels($labels); + $response = $gapicClient->updateInstance($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getDisplayName(); + $this->assertProtobufEquals($displayName, $actualValue); + $actualValue = $actualRequestObject->getType(); + $this->assertProtobufEquals($type, $actualValue); + $actualValue = $actualRequestObject->getLabels(); + $this->assertProtobufEquals($labels, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateInstanceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $type = Type::TYPE_UNSPECIFIED; + $labelsValue = 'labelsValue950036658'; + $labels = [ + 'labelsKey' => $labelsValue, + ]; + $request = (new Instance()) + ->setName($name) + ->setDisplayName($displayName) + ->setType($type) + ->setLabels($labels); + try { + $gapicClient->updateInstance($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createAppProfileAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $description = 'description-1724546052'; + $expectedResponse = new AppProfile(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $appProfileId = 'appProfileId1262094415'; + $appProfile = new AppProfile(); + $request = (new CreateAppProfileRequest()) + ->setParent($formattedParent) + ->setAppProfileId($appProfileId) + ->setAppProfile($appProfile); + $response = $gapicClient->createAppProfileAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateAppProfile', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getAppProfileId(); + $this->assertProtobufEquals($appProfileId, $actualValue); + $actualValue = $actualRequestObject->getAppProfile(); + $this->assertProtobufEquals($appProfile, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Bigtable/v2/Admin/tests/Unit/V2/Client/BigtableTableAdminClientTest.php b/owl-bot-staging/Bigtable/v2/Admin/tests/Unit/V2/Client/BigtableTableAdminClientTest.php new file mode 100644 index 000000000000..f2439bbf284a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/Admin/tests/Unit/V2/Client/BigtableTableAdminClientTest.php @@ -0,0 +1,2806 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BigtableTableAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BigtableTableAdminClient($options); + } + + /** @test */ + public function checkConsistencyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $consistent = true; + $expectedResponse = new CheckConsistencyResponse(); + $expectedResponse->setConsistent($consistent); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $consistencyToken = 'consistencyToken-1090516718'; + $request = (new CheckConsistencyRequest()) + ->setName($formattedName) + ->setConsistencyToken($consistencyToken); + $response = $gapicClient->checkConsistency($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CheckConsistency', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getConsistencyToken(); + $this->assertProtobufEquals($consistencyToken, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function checkConsistencyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $consistencyToken = 'consistencyToken-1090516718'; + $request = (new CheckConsistencyRequest()) + ->setName($formattedName) + ->setConsistencyToken($consistencyToken); + try { + $gapicClient->checkConsistency($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function copyBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/copyBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $sourceTable = 'sourceTable1670858410'; + $sourceBackup2 = 'sourceBackup2889376921'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setSourceTable($sourceTable); + $expectedResponse->setSourceBackup($sourceBackup2); + $expectedResponse->setSizeBytes($sizeBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/copyBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $backupId = 'backupId1355353272'; + $formattedSourceBackup = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); + $expireTime = new Timestamp(); + $request = (new CopyBackupRequest()) + ->setParent($formattedParent) + ->setBackupId($backupId) + ->setSourceBackup($formattedSourceBackup) + ->setExpireTime($expireTime); + $response = $gapicClient->copyBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CopyBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupId(); + $this->assertProtobufEquals($backupId, $actualValue); + $actualValue = $actualApiRequestObject->getSourceBackup(); + $this->assertProtobufEquals($formattedSourceBackup, $actualValue); + $actualValue = $actualApiRequestObject->getExpireTime(); + $this->assertProtobufEquals($expireTime, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/copyBackupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function copyBackupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/copyBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $backupId = 'backupId1355353272'; + $formattedSourceBackup = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); + $expireTime = new Timestamp(); + $request = (new CopyBackupRequest()) + ->setParent($formattedParent) + ->setBackupId($backupId) + ->setSourceBackup($formattedSourceBackup) + ->setExpireTime($expireTime); + $response = $gapicClient->copyBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/copyBackupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createAuthorizedViewTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createAuthorizedViewTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $etag = 'etag3123477'; + $deletionProtection = true; + $expectedResponse = new AuthorizedView(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setDeletionProtection($deletionProtection); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAuthorizedViewTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $authorizedViewId = 'authorizedViewId1171901009'; + $authorizedView = new AuthorizedView(); + $request = (new CreateAuthorizedViewRequest()) + ->setParent($formattedParent) + ->setAuthorizedViewId($authorizedViewId) + ->setAuthorizedView($authorizedView); + $response = $gapicClient->createAuthorizedView($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CreateAuthorizedView', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAuthorizedViewId(); + $this->assertProtobufEquals($authorizedViewId, $actualValue); + $actualValue = $actualApiRequestObject->getAuthorizedView(); + $this->assertProtobufEquals($authorizedView, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAuthorizedViewTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createAuthorizedViewExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createAuthorizedViewTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $authorizedViewId = 'authorizedViewId1171901009'; + $authorizedView = new AuthorizedView(); + $request = (new CreateAuthorizedViewRequest()) + ->setParent($formattedParent) + ->setAuthorizedViewId($authorizedViewId) + ->setAuthorizedView($authorizedView); + $response = $gapicClient->createAuthorizedView($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAuthorizedViewTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $sourceTable = 'sourceTable1670858410'; + $sourceBackup = 'sourceBackup-258292122'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setSourceTable($sourceTable); + $expectedResponse->setSourceBackup($sourceBackup); + $expectedResponse->setSizeBytes($sizeBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $backupId = 'backupId1355353272'; + $backup = new Backup(); + $backupSourceTable = 'backupSourceTable1043210577'; + $backup->setSourceTable($backupSourceTable); + $backupExpireTime = new Timestamp(); + $backup->setExpireTime($backupExpireTime); + $request = (new CreateBackupRequest()) + ->setParent($formattedParent) + ->setBackupId($backupId) + ->setBackup($backup); + $response = $gapicClient->createBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CreateBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupId(); + $this->assertProtobufEquals($backupId, $actualValue); + $actualValue = $actualApiRequestObject->getBackup(); + $this->assertProtobufEquals($backup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $backupId = 'backupId1355353272'; + $backup = new Backup(); + $backupSourceTable = 'backupSourceTable1043210577'; + $backup->setSourceTable($backupSourceTable); + $backupExpireTime = new Timestamp(); + $backup->setExpireTime($backupExpireTime); + $request = (new CreateBackupRequest()) + ->setParent($formattedParent) + ->setBackupId($backupId) + ->setBackup($backup); + $response = $gapicClient->createBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createTableTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $deletionProtection = true; + $expectedResponse = new Table(); + $expectedResponse->setName($name); + $expectedResponse->setDeletionProtection($deletionProtection); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $tableId = 'tableId-895419604'; + $table = new Table(); + $request = (new CreateTableRequest()) + ->setParent($formattedParent) + ->setTableId($tableId) + ->setTable($table); + $response = $gapicClient->createTable($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CreateTable', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTableId(); + $this->assertProtobufEquals($tableId, $actualValue); + $actualValue = $actualRequestObject->getTable(); + $this->assertProtobufEquals($table, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTableExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $tableId = 'tableId-895419604'; + $table = new Table(); + $request = (new CreateTableRequest()) + ->setParent($formattedParent) + ->setTableId($tableId) + ->setTable($table); + try { + $gapicClient->createTable($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTableFromSnapshotTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTableFromSnapshotTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $deletionProtection = true; + $expectedResponse = new Table(); + $expectedResponse->setName($name); + $expectedResponse->setDeletionProtection($deletionProtection); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTableFromSnapshotTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $tableId = 'tableId-895419604'; + $formattedSourceSnapshot = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); + $request = (new CreateTableFromSnapshotRequest()) + ->setParent($formattedParent) + ->setTableId($tableId) + ->setSourceSnapshot($formattedSourceSnapshot); + $response = $gapicClient->createTableFromSnapshot($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CreateTableFromSnapshot', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getTableId(); + $this->assertProtobufEquals($tableId, $actualValue); + $actualValue = $actualApiRequestObject->getSourceSnapshot(); + $this->assertProtobufEquals($formattedSourceSnapshot, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTableFromSnapshotTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createTableFromSnapshotExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTableFromSnapshotTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $tableId = 'tableId-895419604'; + $formattedSourceSnapshot = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); + $request = (new CreateTableFromSnapshotRequest()) + ->setParent($formattedParent) + ->setTableId($tableId) + ->setSourceSnapshot($formattedSourceSnapshot); + $response = $gapicClient->createTableFromSnapshot($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTableFromSnapshotTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteAuthorizedViewTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); + $request = (new DeleteAuthorizedViewRequest()) + ->setName($formattedName); + $gapicClient->deleteAuthorizedView($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/DeleteAuthorizedView', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAuthorizedViewExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); + $request = (new DeleteAuthorizedViewRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteAuthorizedView($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteBackupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); + $request = (new DeleteBackupRequest()) + ->setName($formattedName); + $gapicClient->deleteBackup($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/DeleteBackup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteBackupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); + $request = (new DeleteBackupRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteBackup($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSnapshotTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); + $request = (new DeleteSnapshotRequest()) + ->setName($formattedName); + $gapicClient->deleteSnapshot($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/DeleteSnapshot', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSnapshotExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); + $request = (new DeleteSnapshotRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteSnapshot($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTableTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new DeleteTableRequest()) + ->setName($formattedName); + $gapicClient->deleteTable($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/DeleteTable', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTableExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new DeleteTableRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteTable($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function dropRowRangeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new DropRowRangeRequest()) + ->setName($formattedName); + $gapicClient->dropRowRange($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/DropRowRange', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function dropRowRangeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new DropRowRangeRequest()) + ->setName($formattedName); + try { + $gapicClient->dropRowRange($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateConsistencyTokenTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $consistencyToken = 'consistencyToken-1090516718'; + $expectedResponse = new GenerateConsistencyTokenResponse(); + $expectedResponse->setConsistencyToken($consistencyToken); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new GenerateConsistencyTokenRequest()) + ->setName($formattedName); + $response = $gapicClient->generateConsistencyToken($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GenerateConsistencyToken', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateConsistencyTokenExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new GenerateConsistencyTokenRequest()) + ->setName($formattedName); + try { + $gapicClient->generateConsistencyToken($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAuthorizedViewTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $deletionProtection = true; + $expectedResponse = new AuthorizedView(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $expectedResponse->setDeletionProtection($deletionProtection); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); + $request = (new GetAuthorizedViewRequest()) + ->setName($formattedName); + $response = $gapicClient->getAuthorizedView($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GetAuthorizedView', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAuthorizedViewExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); + $request = (new GetAuthorizedViewRequest()) + ->setName($formattedName); + try { + $gapicClient->getAuthorizedView($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $sourceTable = 'sourceTable1670858410'; + $sourceBackup = 'sourceBackup-258292122'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setSourceTable($sourceTable); + $expectedResponse->setSourceBackup($sourceBackup); + $expectedResponse->setSizeBytes($sizeBytes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); + $request = (new GetBackupRequest()) + ->setName($formattedName); + $response = $gapicClient->getBackup($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GetBackup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); + $request = (new GetBackupRequest()) + ->setName($formattedName); + try { + $gapicClient->getBackup($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSnapshotTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $dataSizeBytes = 2110122398; + $description = 'description-1724546052'; + $expectedResponse = new Snapshot(); + $expectedResponse->setName($name2); + $expectedResponse->setDataSizeBytes($dataSizeBytes); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); + $request = (new GetSnapshotRequest()) + ->setName($formattedName); + $response = $gapicClient->getSnapshot($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GetSnapshot', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSnapshotExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); + $request = (new GetSnapshotRequest()) + ->setName($formattedName); + try { + $gapicClient->getSnapshot($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTableTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $deletionProtection = true; + $expectedResponse = new Table(); + $expectedResponse->setName($name2); + $expectedResponse->setDeletionProtection($deletionProtection); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new GetTableRequest()) + ->setName($formattedName); + $response = $gapicClient->getTable($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GetTable', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTableExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new GetTableRequest()) + ->setName($formattedName); + try { + $gapicClient->getTable($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAuthorizedViewsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $authorizedViewsElement = new AuthorizedView(); + $authorizedViews = [ + $authorizedViewsElement, + ]; + $expectedResponse = new ListAuthorizedViewsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAuthorizedViews($authorizedViews); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new ListAuthorizedViewsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listAuthorizedViews($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAuthorizedViews()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/ListAuthorizedViews', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAuthorizedViewsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new ListAuthorizedViewsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listAuthorizedViews($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupsElement = new Backup(); + $backups = [ + $backupsElement, + ]; + $expectedResponse = new ListBackupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackups($backups); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $request = (new ListBackupsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listBackups($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/ListBackups', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $request = (new ListBackupsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listBackups($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSnapshotsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $snapshotsElement = new Snapshot(); + $snapshots = [ + $snapshotsElement, + ]; + $expectedResponse = new ListSnapshotsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSnapshots($snapshots); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $request = (new ListSnapshotsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listSnapshots($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSnapshots()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/ListSnapshots', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSnapshotsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $request = (new ListSnapshotsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listSnapshots($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTablesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tablesElement = new Table(); + $tables = [ + $tablesElement, + ]; + $expectedResponse = new ListTablesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTables($tables); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new ListTablesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listTables($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTables()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/ListTables', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTablesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new ListTablesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listTables($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function modifyColumnFamiliesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $deletionProtection = true; + $expectedResponse = new Table(); + $expectedResponse->setName($name2); + $expectedResponse->setDeletionProtection($deletionProtection); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $modifications = []; + $request = (new ModifyColumnFamiliesRequest()) + ->setName($formattedName) + ->setModifications($modifications); + $response = $gapicClient->modifyColumnFamilies($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/ModifyColumnFamilies', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getModifications(); + $this->assertProtobufEquals($modifications, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function modifyColumnFamiliesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $modifications = []; + $request = (new ModifyColumnFamiliesRequest()) + ->setName($formattedName) + ->setModifications($modifications); + try { + $gapicClient->modifyColumnFamilies($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function restoreTableTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreTableTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $deletionProtection = true; + $expectedResponse = new Table(); + $expectedResponse->setName($name); + $expectedResponse->setDeletionProtection($deletionProtection); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restoreTableTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $tableId = 'tableId-895419604'; + $request = (new RestoreTableRequest()) + ->setParent($formattedParent) + ->setTableId($tableId); + $response = $gapicClient->restoreTable($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/RestoreTable', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getTableId(); + $this->assertProtobufEquals($tableId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreTableTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function restoreTableExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreTableTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $tableId = 'tableId-895419604'; + $request = (new RestoreTableRequest()) + ->setParent($formattedParent) + ->setTableId($tableId); + $response = $gapicClient->restoreTable($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreTableTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function snapshotTableTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/snapshotTableTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $dataSizeBytes = 2110122398; + $description2 = 'description2568623279'; + $expectedResponse = new Snapshot(); + $expectedResponse->setName($name2); + $expectedResponse->setDataSizeBytes($dataSizeBytes); + $expectedResponse->setDescription($description2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/snapshotTableTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $formattedCluster = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $snapshotId = 'snapshotId-168585866'; + $request = (new SnapshotTableRequest()) + ->setName($formattedName) + ->setCluster($formattedCluster) + ->setSnapshotId($snapshotId); + $response = $gapicClient->snapshotTable($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/SnapshotTable', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($formattedCluster, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshotId(); + $this->assertProtobufEquals($snapshotId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/snapshotTableTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function snapshotTableExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/snapshotTableTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $formattedCluster = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $snapshotId = 'snapshotId-168585866'; + $request = (new SnapshotTableRequest()) + ->setName($formattedName) + ->setCluster($formattedCluster) + ->setSnapshotId($snapshotId); + $response = $gapicClient->snapshotTable($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/snapshotTableTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function undeleteTableTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeleteTableTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $deletionProtection = true; + $expectedResponse = new Table(); + $expectedResponse->setName($name2); + $expectedResponse->setDeletionProtection($deletionProtection); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeleteTableTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new UndeleteTableRequest()) + ->setName($formattedName); + $response = $gapicClient->undeleteTable($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/UndeleteTable', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeleteTableTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function undeleteTableExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeleteTableTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new UndeleteTableRequest()) + ->setName($formattedName); + $response = $gapicClient->undeleteTable($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeleteTableTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateAuthorizedViewTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateAuthorizedViewTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $etag = 'etag3123477'; + $deletionProtection = true; + $expectedResponse = new AuthorizedView(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setDeletionProtection($deletionProtection); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateAuthorizedViewTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $authorizedView = new AuthorizedView(); + $request = (new UpdateAuthorizedViewRequest()) + ->setAuthorizedView($authorizedView); + $response = $gapicClient->updateAuthorizedView($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/UpdateAuthorizedView', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAuthorizedView(); + $this->assertProtobufEquals($authorizedView, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAuthorizedViewTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateAuthorizedViewExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateAuthorizedViewTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $authorizedView = new AuthorizedView(); + $request = (new UpdateAuthorizedViewRequest()) + ->setAuthorizedView($authorizedView); + $response = $gapicClient->updateAuthorizedView($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAuthorizedViewTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateBackupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $sourceTable = 'sourceTable1670858410'; + $sourceBackup = 'sourceBackup-258292122'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setSourceTable($sourceTable); + $expectedResponse->setSourceBackup($sourceBackup); + $expectedResponse->setSizeBytes($sizeBytes); + $transport->addResponse($expectedResponse); + // Mock request + $backup = new Backup(); + $backupSourceTable = 'backupSourceTable1043210577'; + $backup->setSourceTable($backupSourceTable); + $backupExpireTime = new Timestamp(); + $backup->setExpireTime($backupExpireTime); + $updateMask = new FieldMask(); + $request = (new UpdateBackupRequest()) + ->setBackup($backup) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateBackup($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/UpdateBackup', $actualFuncCall); + $actualValue = $actualRequestObject->getBackup(); + $this->assertProtobufEquals($backup, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateBackupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $backup = new Backup(); + $backupSourceTable = 'backupSourceTable1043210577'; + $backup->setSourceTable($backupSourceTable); + $backupExpireTime = new Timestamp(); + $backup->setExpireTime($backupExpireTime); + $updateMask = new FieldMask(); + $request = (new UpdateBackupRequest()) + ->setBackup($backup) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateBackup($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTableTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTableTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $deletionProtection = true; + $expectedResponse = new Table(); + $expectedResponse->setName($name); + $expectedResponse->setDeletionProtection($deletionProtection); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateTableTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $table = new Table(); + $updateMask = new FieldMask(); + $request = (new UpdateTableRequest()) + ->setTable($table) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateTable($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/UpdateTable', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTable(); + $this->assertProtobufEquals($table, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTableTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateTableExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTableTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $table = new Table(); + $updateMask = new FieldMask(); + $request = (new UpdateTableRequest()) + ->setTable($table) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateTable($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTableTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function checkConsistencyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $consistent = true; + $expectedResponse = new CheckConsistencyResponse(); + $expectedResponse->setConsistent($consistent); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $consistencyToken = 'consistencyToken-1090516718'; + $request = (new CheckConsistencyRequest()) + ->setName($formattedName) + ->setConsistencyToken($consistencyToken); + $response = $gapicClient->checkConsistencyAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CheckConsistency', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getConsistencyToken(); + $this->assertProtobufEquals($consistencyToken, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/Bigtable.php b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/Bigtable.php new file mode 100644 index 000000000000..625f96072016 Binary files /dev/null and b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/Bigtable.php differ diff --git a/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/Data.php b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/Data.php new file mode 100644 index 000000000000..b349402a1705 Binary files /dev/null and b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/Data.php differ diff --git a/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/FeatureFlags.php b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/FeatureFlags.php new file mode 100644 index 000000000000..fd70d1524270 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/FeatureFlags.php @@ -0,0 +1,39 @@ +internalAddGeneratedFile( + ' +£ +&google/bigtable/v2/feature_flags.protogoogle.bigtable.v2"ž + FeatureFlags + reverse_scans ( +mutate_rows_rate_limit ( +mutate_rows_rate_limit2 (" +last_scanned_row_responses ( +routing_cookie ( + +retry_info (# +client_side_metrics_enabled ( +traffic_director_enabled ( +direct_access_requested + (B» +com.google.bigtable.v2BFeatureFlagsProtoPZ8cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepbªGoogle.Cloud.Bigtable.V2ÊGoogle\\Cloud\\Bigtable\\V2êGoogle::Cloud::Bigtable::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/RequestStats.php b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/RequestStats.php new file mode 100644 index 000000000000..e0ba5ca1e11e Binary files /dev/null and b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/RequestStats.php differ diff --git a/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/ResponseParams.php b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/ResponseParams.php new file mode 100644 index 000000000000..932fb13c6dee Binary files /dev/null and b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/ResponseParams.php differ diff --git a/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/Types.php b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/Types.php new file mode 100644 index 000000000000..a7a31f2675de Binary files /dev/null and b/owl-bot-staging/Bigtable/v2/proto/src/GPBMetadata/Google/Bigtable/V2/Types.php differ diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ArrayValue.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ArrayValue.php new file mode 100644 index 000000000000..cb872d55e982 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ArrayValue.php @@ -0,0 +1,67 @@ +google.bigtable.v2.ArrayValue + */ +class ArrayValue extends \Google\Protobuf\Internal\Message +{ + /** + * The ordered elements in the array. + * + * Generated from protobuf field repeated .google.bigtable.v2.Value values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\V2\Value>|\Google\Protobuf\Internal\RepeatedField $values + * The ordered elements in the array. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The ordered elements in the array. + * + * Generated from protobuf field repeated .google.bigtable.v2.Value values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * The ordered elements in the array. + * + * Generated from protobuf field repeated .google.bigtable.v2.Value values = 1; + * @param array<\Google\Cloud\Bigtable\V2\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Value::class); + $this->values = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Cell.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Cell.php new file mode 100644 index 000000000000..ae97f1e167af --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Cell.php @@ -0,0 +1,163 @@ +google.bigtable.v2.Cell + */ +class Cell extends \Google\Protobuf\Internal\Message +{ + /** + * The cell's stored timestamp, which also uniquely identifies it within + * its column. + * Values are always expressed in microseconds, but individual tables may set + * a coarser granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will only allow + * values of `timestamp_micros` which are multiples of 1000. + * + * Generated from protobuf field int64 timestamp_micros = 1; + */ + protected $timestamp_micros = 0; + /** + * The value stored in the cell. + * May contain any byte string, including the empty string, up to 100MiB in + * length. + * + * Generated from protobuf field bytes value = 2; + */ + protected $value = ''; + /** + * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter]. + * + * Generated from protobuf field repeated string labels = 3; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $timestamp_micros + * The cell's stored timestamp, which also uniquely identifies it within + * its column. + * Values are always expressed in microseconds, but individual tables may set + * a coarser granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will only allow + * values of `timestamp_micros` which are multiples of 1000. + * @type string $value + * The value stored in the cell. + * May contain any byte string, including the empty string, up to 100MiB in + * length. + * @type array|\Google\Protobuf\Internal\RepeatedField $labels + * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The cell's stored timestamp, which also uniquely identifies it within + * its column. + * Values are always expressed in microseconds, but individual tables may set + * a coarser granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will only allow + * values of `timestamp_micros` which are multiples of 1000. + * + * Generated from protobuf field int64 timestamp_micros = 1; + * @return int|string + */ + public function getTimestampMicros() + { + return $this->timestamp_micros; + } + + /** + * The cell's stored timestamp, which also uniquely identifies it within + * its column. + * Values are always expressed in microseconds, but individual tables may set + * a coarser granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will only allow + * values of `timestamp_micros` which are multiples of 1000. + * + * Generated from protobuf field int64 timestamp_micros = 1; + * @param int|string $var + * @return $this + */ + public function setTimestampMicros($var) + { + GPBUtil::checkInt64($var); + $this->timestamp_micros = $var; + + return $this; + } + + /** + * The value stored in the cell. + * May contain any byte string, including the empty string, up to 100MiB in + * length. + * + * Generated from protobuf field bytes value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value stored in the cell. + * May contain any byte string, including the empty string, up to 100MiB in + * length. + * + * Generated from protobuf field bytes value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, False); + $this->value = $var; + + return $this; + } + + /** + * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter]. + * + * Generated from protobuf field repeated string labels = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter]. + * + * Generated from protobuf field repeated string labels = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/CheckAndMutateRowRequest.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/CheckAndMutateRowRequest.php new file mode 100644 index 000000000000..71dc9e6065dd --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/CheckAndMutateRowRequest.php @@ -0,0 +1,436 @@ +google.bigtable.v2.CheckAndMutateRowRequest + */ +class CheckAndMutateRowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique name of the table to which the conditional mutation + * should be applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $table_name = ''; + /** + * Optional. The unique name of the AuthorizedView to which the conditional + * mutation should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $authorized_view_name = ''; + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 7; + */ + protected $app_profile_id = ''; + /** + * Required. The key of the row to which the conditional mutation should be + * applied. + * + * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $row_key = ''; + /** + * The filter to be applied to the contents of the specified row. Depending + * on whether or not any results are yielded, either `true_mutations` or + * `false_mutations` will be executed. If unset, checks that the row contains + * any values at all. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 6; + */ + protected $predicate_filter = null; + /** + * Changes to be atomically applied to the specified row if `predicate_filter` + * yields at least one cell when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `false_mutations` is empty, and at most + * 100000. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + private $true_mutations; + /** + * Changes to be atomically applied to the specified row if `predicate_filter` + * does not yield any cells when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `true_mutations` is empty, and at most + * 100000. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + private $false_mutations; + + /** + * @param string $tableName Optional. The unique name of the table to which the conditional mutation + * should be applied. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $rowKey Required. The key of the row to which the conditional mutation should be + * applied. + * @param \Google\Cloud\Bigtable\V2\RowFilter $predicateFilter The filter to be applied to the contents of the specified row. Depending + * on whether or not any results are yielded, either `true_mutations` or + * `false_mutations` will be executed. If unset, checks that the row contains + * any values at all. + * @param \Google\Cloud\Bigtable\V2\Mutation[] $trueMutations Changes to be atomically applied to the specified row if `predicate_filter` + * yields at least one cell when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `false_mutations` is empty, and at most + * 100000. + * @param \Google\Cloud\Bigtable\V2\Mutation[] $falseMutations Changes to be atomically applied to the specified row if `predicate_filter` + * does not yield any cells when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `true_mutations` is empty, and at most + * 100000. + * + * @return \Google\Cloud\Bigtable\V2\CheckAndMutateRowRequest + * + * @experimental + */ + public static function build(string $tableName, string $rowKey, \Google\Cloud\Bigtable\V2\RowFilter $predicateFilter, array $trueMutations, array $falseMutations): self + { + return (new self()) + ->setTableName($tableName) + ->setRowKey($rowKey) + ->setPredicateFilter($predicateFilter) + ->setTrueMutations($trueMutations) + ->setFalseMutations($falseMutations); + } + + /** + * @param string $tableName Optional. The unique name of the table to which the conditional mutation + * should be applied. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $rowKey Required. The key of the row to which the conditional mutation should be + * applied. + * @param \Google\Cloud\Bigtable\V2\RowFilter $predicateFilter The filter to be applied to the contents of the specified row. Depending + * on whether or not any results are yielded, either `true_mutations` or + * `false_mutations` will be executed. If unset, checks that the row contains + * any values at all. + * @param \Google\Cloud\Bigtable\V2\Mutation[] $trueMutations Changes to be atomically applied to the specified row if `predicate_filter` + * yields at least one cell when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `false_mutations` is empty, and at most + * 100000. + * @param \Google\Cloud\Bigtable\V2\Mutation[] $falseMutations Changes to be atomically applied to the specified row if `predicate_filter` + * does not yield any cells when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `true_mutations` is empty, and at most + * 100000. + * @param string $appProfileId This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * @return \Google\Cloud\Bigtable\V2\CheckAndMutateRowRequest + * + * @experimental + */ + public static function buildFromTableNameRowKeyPredicateFilterTrueMutationsFalseMutationsAppProfileId(string $tableName, string $rowKey, \Google\Cloud\Bigtable\V2\RowFilter $predicateFilter, array $trueMutations, array $falseMutations, string $appProfileId): self + { + return (new self()) + ->setTableName($tableName) + ->setRowKey($rowKey) + ->setPredicateFilter($predicateFilter) + ->setTrueMutations($trueMutations) + ->setFalseMutations($falseMutations) + ->setAppProfileId($appProfileId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * Optional. The unique name of the table to which the conditional mutation + * should be applied. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $authorized_view_name + * Optional. The unique name of the AuthorizedView to which the conditional + * mutation should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @type string $row_key + * Required. The key of the row to which the conditional mutation should be + * applied. + * @type \Google\Cloud\Bigtable\V2\RowFilter $predicate_filter + * The filter to be applied to the contents of the specified row. Depending + * on whether or not any results are yielded, either `true_mutations` or + * `false_mutations` will be executed. If unset, checks that the row contains + * any values at all. + * @type array<\Google\Cloud\Bigtable\V2\Mutation>|\Google\Protobuf\Internal\RepeatedField $true_mutations + * Changes to be atomically applied to the specified row if `predicate_filter` + * yields at least one cell when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `false_mutations` is empty, and at most + * 100000. + * @type array<\Google\Cloud\Bigtable\V2\Mutation>|\Google\Protobuf\Internal\RepeatedField $false_mutations + * Changes to be atomically applied to the specified row if `predicate_filter` + * does not yield any cells when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `true_mutations` is empty, and at most + * 100000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique name of the table to which the conditional mutation + * should be applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getTableName() + { + return $this->table_name; + } + + /** + * Optional. The unique name of the table to which the conditional mutation + * should be applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTableName($var) + { + GPBUtil::checkString($var, True); + $this->table_name = $var; + + return $this; + } + + /** + * Optional. The unique name of the AuthorizedView to which the conditional + * mutation should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAuthorizedViewName() + { + return $this->authorized_view_name; + } + + /** + * Optional. The unique name of the AuthorizedView to which the conditional + * mutation should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAuthorizedViewName($var) + { + GPBUtil::checkString($var, True); + $this->authorized_view_name = $var; + + return $this; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 7; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 7; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + + /** + * Required. The key of the row to which the conditional mutation should be + * applied. + * + * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRowKey() + { + return $this->row_key; + } + + /** + * Required. The key of the row to which the conditional mutation should be + * applied. + * + * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRowKey($var) + { + GPBUtil::checkString($var, False); + $this->row_key = $var; + + return $this; + } + + /** + * The filter to be applied to the contents of the specified row. Depending + * on whether or not any results are yielded, either `true_mutations` or + * `false_mutations` will be executed. If unset, checks that the row contains + * any values at all. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 6; + * @return \Google\Cloud\Bigtable\V2\RowFilter|null + */ + public function getPredicateFilter() + { + return $this->predicate_filter; + } + + public function hasPredicateFilter() + { + return isset($this->predicate_filter); + } + + public function clearPredicateFilter() + { + unset($this->predicate_filter); + } + + /** + * The filter to be applied to the contents of the specified row. Depending + * on whether or not any results are yielded, either `true_mutations` or + * `false_mutations` will be executed. If unset, checks that the row contains + * any values at all. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 6; + * @param \Google\Cloud\Bigtable\V2\RowFilter $var + * @return $this + */ + public function setPredicateFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->predicate_filter = $var; + + return $this; + } + + /** + * Changes to be atomically applied to the specified row if `predicate_filter` + * yields at least one cell when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `false_mutations` is empty, and at most + * 100000. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation true_mutations = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTrueMutations() + { + return $this->true_mutations; + } + + /** + * Changes to be atomically applied to the specified row if `predicate_filter` + * yields at least one cell when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `false_mutations` is empty, and at most + * 100000. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation true_mutations = 4; + * @param array<\Google\Cloud\Bigtable\V2\Mutation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTrueMutations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Mutation::class); + $this->true_mutations = $arr; + + return $this; + } + + /** + * Changes to be atomically applied to the specified row if `predicate_filter` + * does not yield any cells when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `true_mutations` is empty, and at most + * 100000. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation false_mutations = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFalseMutations() + { + return $this->false_mutations; + } + + /** + * Changes to be atomically applied to the specified row if `predicate_filter` + * does not yield any cells when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `true_mutations` is empty, and at most + * 100000. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation false_mutations = 5; + * @param array<\Google\Cloud\Bigtable\V2\Mutation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFalseMutations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Mutation::class); + $this->false_mutations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/CheckAndMutateRowResponse.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/CheckAndMutateRowResponse.php new file mode 100644 index 000000000000..ea562f574e70 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/CheckAndMutateRowResponse.php @@ -0,0 +1,71 @@ +google.bigtable.v2.CheckAndMutateRowResponse + */ +class CheckAndMutateRowResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Whether or not the request's `predicate_filter` yielded any results for + * the specified row. + * + * Generated from protobuf field bool predicate_matched = 1; + */ + protected $predicate_matched = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $predicate_matched + * Whether or not the request's `predicate_filter` yielded any results for + * the specified row. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Whether or not the request's `predicate_filter` yielded any results for + * the specified row. + * + * Generated from protobuf field bool predicate_matched = 1; + * @return bool + */ + public function getPredicateMatched() + { + return $this->predicate_matched; + } + + /** + * Whether or not the request's `predicate_filter` yielded any results for + * the specified row. + * + * Generated from protobuf field bool predicate_matched = 1; + * @param bool $var + * @return $this + */ + public function setPredicateMatched($var) + { + GPBUtil::checkBool($var); + $this->predicate_matched = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Column.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Column.php new file mode 100644 index 000000000000..b2f46bdf290b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Column.php @@ -0,0 +1,118 @@ +google.bigtable.v2.Column + */ +class Column extends \Google\Protobuf\Internal\Message +{ + /** + * The unique key which identifies this column within its family. This is the + * same key that's used to identify the column in, for example, a RowFilter + * which sets its `column_qualifier_regex_filter` field. + * May contain any byte string, including the empty string, up to 16kiB in + * length. + * + * Generated from protobuf field bytes qualifier = 1; + */ + protected $qualifier = ''; + /** + * Must not be empty. Sorted in order of decreasing "timestamp_micros". + * + * Generated from protobuf field repeated .google.bigtable.v2.Cell cells = 2; + */ + private $cells; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $qualifier + * The unique key which identifies this column within its family. This is the + * same key that's used to identify the column in, for example, a RowFilter + * which sets its `column_qualifier_regex_filter` field. + * May contain any byte string, including the empty string, up to 16kiB in + * length. + * @type array<\Google\Cloud\Bigtable\V2\Cell>|\Google\Protobuf\Internal\RepeatedField $cells + * Must not be empty. Sorted in order of decreasing "timestamp_micros". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The unique key which identifies this column within its family. This is the + * same key that's used to identify the column in, for example, a RowFilter + * which sets its `column_qualifier_regex_filter` field. + * May contain any byte string, including the empty string, up to 16kiB in + * length. + * + * Generated from protobuf field bytes qualifier = 1; + * @return string + */ + public function getQualifier() + { + return $this->qualifier; + } + + /** + * The unique key which identifies this column within its family. This is the + * same key that's used to identify the column in, for example, a RowFilter + * which sets its `column_qualifier_regex_filter` field. + * May contain any byte string, including the empty string, up to 16kiB in + * length. + * + * Generated from protobuf field bytes qualifier = 1; + * @param string $var + * @return $this + */ + public function setQualifier($var) + { + GPBUtil::checkString($var, False); + $this->qualifier = $var; + + return $this; + } + + /** + * Must not be empty. Sorted in order of decreasing "timestamp_micros". + * + * Generated from protobuf field repeated .google.bigtable.v2.Cell cells = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCells() + { + return $this->cells; + } + + /** + * Must not be empty. Sorted in order of decreasing "timestamp_micros". + * + * Generated from protobuf field repeated .google.bigtable.v2.Cell cells = 2; + * @param array<\Google\Cloud\Bigtable\V2\Cell>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCells($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Cell::class); + $this->cells = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ColumnMetadata.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ColumnMetadata.php new file mode 100644 index 000000000000..35f3c975b0f7 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ColumnMetadata.php @@ -0,0 +1,111 @@ +google.bigtable.v2.ColumnMetadata + */ +class ColumnMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the column. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The type of the column. + * + * Generated from protobuf field .google.bigtable.v2.Type type = 2; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the column. + * @type \Google\Cloud\Bigtable\V2\Type $type + * The type of the column. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the column. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the column. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The type of the column. + * + * Generated from protobuf field .google.bigtable.v2.Type type = 2; + * @return \Google\Cloud\Bigtable\V2\Type|null + */ + public function getType() + { + return $this->type; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The type of the column. + * + * Generated from protobuf field .google.bigtable.v2.Type type = 2; + * @param \Google\Cloud\Bigtable\V2\Type $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ColumnRange.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ColumnRange.php new file mode 100644 index 000000000000..d5ff522b00d6 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ColumnRange.php @@ -0,0 +1,220 @@ +google.bigtable.v2.ColumnRange + */ +class ColumnRange extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the column family within which this range falls. + * + * Generated from protobuf field string family_name = 1; + */ + protected $family_name = ''; + protected $start_qualifier; + protected $end_qualifier; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the column family within which this range falls. + * @type string $start_qualifier_closed + * Used when giving an inclusive lower bound for the range. + * @type string $start_qualifier_open + * Used when giving an exclusive lower bound for the range. + * @type string $end_qualifier_closed + * Used when giving an inclusive upper bound for the range. + * @type string $end_qualifier_open + * Used when giving an exclusive upper bound for the range. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the column family within which this range falls. + * + * Generated from protobuf field string family_name = 1; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * The name of the column family within which this range falls. + * + * Generated from protobuf field string family_name = 1; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + + /** + * Used when giving an inclusive lower bound for the range. + * + * Generated from protobuf field bytes start_qualifier_closed = 2; + * @return string + */ + public function getStartQualifierClosed() + { + return $this->readOneof(2); + } + + public function hasStartQualifierClosed() + { + return $this->hasOneof(2); + } + + /** + * Used when giving an inclusive lower bound for the range. + * + * Generated from protobuf field bytes start_qualifier_closed = 2; + * @param string $var + * @return $this + */ + public function setStartQualifierClosed($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Used when giving an exclusive lower bound for the range. + * + * Generated from protobuf field bytes start_qualifier_open = 3; + * @return string + */ + public function getStartQualifierOpen() + { + return $this->readOneof(3); + } + + public function hasStartQualifierOpen() + { + return $this->hasOneof(3); + } + + /** + * Used when giving an exclusive lower bound for the range. + * + * Generated from protobuf field bytes start_qualifier_open = 3; + * @param string $var + * @return $this + */ + public function setStartQualifierOpen($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Used when giving an inclusive upper bound for the range. + * + * Generated from protobuf field bytes end_qualifier_closed = 4; + * @return string + */ + public function getEndQualifierClosed() + { + return $this->readOneof(4); + } + + public function hasEndQualifierClosed() + { + return $this->hasOneof(4); + } + + /** + * Used when giving an inclusive upper bound for the range. + * + * Generated from protobuf field bytes end_qualifier_closed = 4; + * @param string $var + * @return $this + */ + public function setEndQualifierClosed($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Used when giving an exclusive upper bound for the range. + * + * Generated from protobuf field bytes end_qualifier_open = 5; + * @return string + */ + public function getEndQualifierOpen() + { + return $this->readOneof(5); + } + + public function hasEndQualifierOpen() + { + return $this->hasOneof(5); + } + + /** + * Used when giving an exclusive upper bound for the range. + * + * Generated from protobuf field bytes end_qualifier_open = 5; + * @param string $var + * @return $this + */ + public function setEndQualifierOpen($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getStartQualifier() + { + return $this->whichOneof("start_qualifier"); + } + + /** + * @return string + */ + public function getEndQualifier() + { + return $this->whichOneof("end_qualifier"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ExecuteQueryRequest.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ExecuteQueryRequest.php new file mode 100644 index 000000000000..e51a31680124 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ExecuteQueryRequest.php @@ -0,0 +1,383 @@ +google.bigtable.v2.ExecuteQueryRequest + */ +class ExecuteQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the instance against which the query should be + * executed. + * Values are of the form `projects//instances/` + * + * Generated from protobuf field string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $instance_name = ''; + /** + * Optional. This value specifies routing for replication. If not specified, + * the `default` application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $app_profile_id = ''; + /** + * Required. The query string. + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = ''; + /** + * Optional. If this request is resuming a previously interrupted query + * execution, `resume_token` should be copied from the last + * PartialResultSet yielded before the interruption. Doing this + * enables the query execution to resume where the last one left + * off. + * The rest of the request parameters must exactly match the + * request that yielded this token. Otherwise the request will fail. + * + * Generated from protobuf field bytes resume_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $resume_token = ''; + /** + * Required. params contains string type keys and Bigtable type values that + * bind to placeholders in the query string. In query string, a parameter + * placeholder consists of the + * `@` character followed by the parameter name (for example, `@firstName`) in + * the query string. + * For example, if + * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}` + * then `@firstName` will be replaced with googlesql bytes value "foo" in the + * query string during query evaluation. + * In case of Value.kind is not set, it will be set to corresponding null + * value in googlesql. + * `params["firstName"] = type {string_type {}}` + * then `@firstName` will be replaced with googlesql null string. + * Value.type should always be set and no inference of type will be made from + * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT + * error. + * + * Generated from protobuf field map params = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + private $params; + protected $data_format; + + /** + * @param string $instanceName Required. The unique name of the instance against which the query should be + * executed. + * Values are of the form `projects//instances/` + * Please see {@see BigtableClient::instanceName()} for help formatting this field. + * @param string $query Required. The query string. + * + * @return \Google\Cloud\Bigtable\V2\ExecuteQueryRequest + * + * @experimental + */ + public static function build(string $instanceName, string $query): self + { + return (new self()) + ->setInstanceName($instanceName) + ->setQuery($query); + } + + /** + * @param string $instanceName Required. The unique name of the instance against which the query should be + * executed. + * Values are of the form `projects//instances/` + * Please see {@see BigtableClient::instanceName()} for help formatting this field. + * @param string $query Required. The query string. + * @param string $appProfileId Optional. This value specifies routing for replication. If not specified, + * the `default` application profile will be used. + * + * @return \Google\Cloud\Bigtable\V2\ExecuteQueryRequest + * + * @experimental + */ + public static function buildFromInstanceNameQueryAppProfileId(string $instanceName, string $query, string $appProfileId): self + { + return (new self()) + ->setInstanceName($instanceName) + ->setQuery($query) + ->setAppProfileId($appProfileId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_name + * Required. The unique name of the instance against which the query should be + * executed. + * Values are of the form `projects//instances/` + * @type string $app_profile_id + * Optional. This value specifies routing for replication. If not specified, + * the `default` application profile will be used. + * @type string $query + * Required. The query string. + * @type \Google\Cloud\Bigtable\V2\ProtoFormat $proto_format + * Protocol buffer format as described by ProtoSchema and ProtoRows + * messages. + * @type string $resume_token + * Optional. If this request is resuming a previously interrupted query + * execution, `resume_token` should be copied from the last + * PartialResultSet yielded before the interruption. Doing this + * enables the query execution to resume where the last one left + * off. + * The rest of the request parameters must exactly match the + * request that yielded this token. Otherwise the request will fail. + * @type array|\Google\Protobuf\Internal\MapField $params + * Required. params contains string type keys and Bigtable type values that + * bind to placeholders in the query string. In query string, a parameter + * placeholder consists of the + * `@` character followed by the parameter name (for example, `@firstName`) in + * the query string. + * For example, if + * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}` + * then `@firstName` will be replaced with googlesql bytes value "foo" in the + * query string during query evaluation. + * In case of Value.kind is not set, it will be set to corresponding null + * value in googlesql. + * `params["firstName"] = type {string_type {}}` + * then `@firstName` will be replaced with googlesql null string. + * Value.type should always be set and no inference of type will be made from + * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT + * error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the instance against which the query should be + * executed. + * Values are of the form `projects//instances/` + * + * Generated from protobuf field string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getInstanceName() + { + return $this->instance_name; + } + + /** + * Required. The unique name of the instance against which the query should be + * executed. + * Values are of the form `projects//instances/` + * + * Generated from protobuf field string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setInstanceName($var) + { + GPBUtil::checkString($var, True); + $this->instance_name = $var; + + return $this; + } + + /** + * Optional. This value specifies routing for replication. If not specified, + * the `default` application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * Optional. This value specifies routing for replication. If not specified, + * the `default` application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + + /** + * Required. The query string. + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Required. The query string. + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Protocol buffer format as described by ProtoSchema and ProtoRows + * messages. + * + * Generated from protobuf field .google.bigtable.v2.ProtoFormat proto_format = 4; + * @return \Google\Cloud\Bigtable\V2\ProtoFormat|null + */ + public function getProtoFormat() + { + return $this->readOneof(4); + } + + public function hasProtoFormat() + { + return $this->hasOneof(4); + } + + /** + * Protocol buffer format as described by ProtoSchema and ProtoRows + * messages. + * + * Generated from protobuf field .google.bigtable.v2.ProtoFormat proto_format = 4; + * @param \Google\Cloud\Bigtable\V2\ProtoFormat $var + * @return $this + */ + public function setProtoFormat($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ProtoFormat::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Optional. If this request is resuming a previously interrupted query + * execution, `resume_token` should be copied from the last + * PartialResultSet yielded before the interruption. Doing this + * enables the query execution to resume where the last one left + * off. + * The rest of the request parameters must exactly match the + * request that yielded this token. Otherwise the request will fail. + * + * Generated from protobuf field bytes resume_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getResumeToken() + { + return $this->resume_token; + } + + /** + * Optional. If this request is resuming a previously interrupted query + * execution, `resume_token` should be copied from the last + * PartialResultSet yielded before the interruption. Doing this + * enables the query execution to resume where the last one left + * off. + * The rest of the request parameters must exactly match the + * request that yielded this token. Otherwise the request will fail. + * + * Generated from protobuf field bytes resume_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setResumeToken($var) + { + GPBUtil::checkString($var, False); + $this->resume_token = $var; + + return $this; + } + + /** + * Required. params contains string type keys and Bigtable type values that + * bind to placeholders in the query string. In query string, a parameter + * placeholder consists of the + * `@` character followed by the parameter name (for example, `@firstName`) in + * the query string. + * For example, if + * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}` + * then `@firstName` will be replaced with googlesql bytes value "foo" in the + * query string during query evaluation. + * In case of Value.kind is not set, it will be set to corresponding null + * value in googlesql. + * `params["firstName"] = type {string_type {}}` + * then `@firstName` will be replaced with googlesql null string. + * Value.type should always be set and no inference of type will be made from + * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT + * error. + * + * Generated from protobuf field map params = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParams() + { + return $this->params; + } + + /** + * Required. params contains string type keys and Bigtable type values that + * bind to placeholders in the query string. In query string, a parameter + * placeholder consists of the + * `@` character followed by the parameter name (for example, `@firstName`) in + * the query string. + * For example, if + * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}` + * then `@firstName` will be replaced with googlesql bytes value "foo" in the + * query string during query evaluation. + * In case of Value.kind is not set, it will be set to corresponding null + * value in googlesql. + * `params["firstName"] = type {string_type {}}` + * then `@firstName` will be replaced with googlesql null string. + * Value.type should always be set and no inference of type will be made from + * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT + * error. + * + * Generated from protobuf field map params = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setParams($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Value::class); + $this->params = $arr; + + return $this; + } + + /** + * @return string + */ + public function getDataFormat() + { + return $this->whichOneof("data_format"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ExecuteQueryResponse.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ExecuteQueryResponse.php new file mode 100644 index 000000000000..d007d3387015 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ExecuteQueryResponse.php @@ -0,0 +1,117 @@ +google.bigtable.v2.ExecuteQueryResponse + */ +class ExecuteQueryResponse extends \Google\Protobuf\Internal\Message +{ + protected $response; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\ResultSetMetadata $metadata + * Structure of rows in this response stream. The first (and only the first) + * response streamed from the server will be of this type. + * @type \Google\Cloud\Bigtable\V2\PartialResultSet $results + * A partial result set with row data potentially including additional + * instructions on how recent past and future partial responses should be + * interpreted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Structure of rows in this response stream. The first (and only the first) + * response streamed from the server will be of this type. + * + * Generated from protobuf field .google.bigtable.v2.ResultSetMetadata metadata = 1; + * @return \Google\Cloud\Bigtable\V2\ResultSetMetadata|null + */ + public function getMetadata() + { + return $this->readOneof(1); + } + + public function hasMetadata() + { + return $this->hasOneof(1); + } + + /** + * Structure of rows in this response stream. The first (and only the first) + * response streamed from the server will be of this type. + * + * Generated from protobuf field .google.bigtable.v2.ResultSetMetadata metadata = 1; + * @param \Google\Cloud\Bigtable\V2\ResultSetMetadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ResultSetMetadata::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A partial result set with row data potentially including additional + * instructions on how recent past and future partial responses should be + * interpreted. + * + * Generated from protobuf field .google.bigtable.v2.PartialResultSet results = 2; + * @return \Google\Cloud\Bigtable\V2\PartialResultSet|null + */ + public function getResults() + { + return $this->readOneof(2); + } + + public function hasResults() + { + return $this->hasOneof(2); + } + + /** + * A partial result set with row data potentially including additional + * instructions on how recent past and future partial responses should be + * interpreted. + * + * Generated from protobuf field .google.bigtable.v2.PartialResultSet results = 2; + * @param \Google\Cloud\Bigtable\V2\PartialResultSet $var + * @return $this + */ + public function setResults($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\PartialResultSet::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getResponse() + { + return $this->whichOneof("response"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Family.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Family.php new file mode 100644 index 000000000000..429023c4587d --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Family.php @@ -0,0 +1,122 @@ +google.bigtable.v2.Family + */ +class Family extends \Google\Protobuf\Internal\Message +{ + /** + * The unique key which identifies this family within its row. This is the + * same key that's used to identify the family in, for example, a RowFilter + * which sets its "family_name_regex_filter" field. + * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may + * produce cells in a sentinel family with an empty name. + * Must be no greater than 64 characters in length. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Must not be empty. Sorted in order of increasing "qualifier". + * + * Generated from protobuf field repeated .google.bigtable.v2.Column columns = 2; + */ + private $columns; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique key which identifies this family within its row. This is the + * same key that's used to identify the family in, for example, a RowFilter + * which sets its "family_name_regex_filter" field. + * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may + * produce cells in a sentinel family with an empty name. + * Must be no greater than 64 characters in length. + * @type array<\Google\Cloud\Bigtable\V2\Column>|\Google\Protobuf\Internal\RepeatedField $columns + * Must not be empty. Sorted in order of increasing "qualifier". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The unique key which identifies this family within its row. This is the + * same key that's used to identify the family in, for example, a RowFilter + * which sets its "family_name_regex_filter" field. + * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may + * produce cells in a sentinel family with an empty name. + * Must be no greater than 64 characters in length. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique key which identifies this family within its row. This is the + * same key that's used to identify the family in, for example, a RowFilter + * which sets its "family_name_regex_filter" field. + * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may + * produce cells in a sentinel family with an empty name. + * Must be no greater than 64 characters in length. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Must not be empty. Sorted in order of increasing "qualifier". + * + * Generated from protobuf field repeated .google.bigtable.v2.Column columns = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getColumns() + { + return $this->columns; + } + + /** + * Must not be empty. Sorted in order of increasing "qualifier". + * + * Generated from protobuf field repeated .google.bigtable.v2.Column columns = 2; + * @param array<\Google\Cloud\Bigtable\V2\Column>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setColumns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Column::class); + $this->columns = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/FeatureFlags.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/FeatureFlags.php new file mode 100644 index 000000000000..51c17b64d53f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/FeatureFlags.php @@ -0,0 +1,378 @@ +google.bigtable.v2.FeatureFlags + */ +class FeatureFlags extends \Google\Protobuf\Internal\Message +{ + /** + * Notify the server that the client supports reverse scans. The server will + * reject ReadRowsRequests with the reverse bit set when this is absent. + * + * Generated from protobuf field bool reverse_scans = 1; + */ + protected $reverse_scans = false; + /** + * Notify the server that the client enables batch write flow control by + * requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons, + * this disables partial retries. + * + * Generated from protobuf field bool mutate_rows_rate_limit = 3; + */ + protected $mutate_rows_rate_limit = false; + /** + * Notify the server that the client enables batch write flow control by + * requesting RateLimitInfo from MutateRowsResponse. With partial retries + * enabled. + * + * Generated from protobuf field bool mutate_rows_rate_limit2 = 5; + */ + protected $mutate_rows_rate_limit2 = false; + /** + * Notify the server that the client supports the last_scanned_row field + * in ReadRowsResponse for long-running scans. + * + * Generated from protobuf field bool last_scanned_row_responses = 4; + */ + protected $last_scanned_row_responses = false; + /** + * Notify the server that the client supports using encoded routing cookie + * strings to retry requests with. + * + * Generated from protobuf field bool routing_cookie = 6; + */ + protected $routing_cookie = false; + /** + * Notify the server that the client supports using retry info back off + * durations to retry requests with. + * + * Generated from protobuf field bool retry_info = 7; + */ + protected $retry_info = false; + /** + * Notify the server that the client has client side metrics enabled. + * + * Generated from protobuf field bool client_side_metrics_enabled = 8; + */ + protected $client_side_metrics_enabled = false; + /** + * Notify the server that the client using Traffic Director endpoint. + * + * Generated from protobuf field bool traffic_director_enabled = 9; + */ + protected $traffic_director_enabled = false; + /** + * Notify the server that the client explicitly opted in for Direct Access. + * + * Generated from protobuf field bool direct_access_requested = 10; + */ + protected $direct_access_requested = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $reverse_scans + * Notify the server that the client supports reverse scans. The server will + * reject ReadRowsRequests with the reverse bit set when this is absent. + * @type bool $mutate_rows_rate_limit + * Notify the server that the client enables batch write flow control by + * requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons, + * this disables partial retries. + * @type bool $mutate_rows_rate_limit2 + * Notify the server that the client enables batch write flow control by + * requesting RateLimitInfo from MutateRowsResponse. With partial retries + * enabled. + * @type bool $last_scanned_row_responses + * Notify the server that the client supports the last_scanned_row field + * in ReadRowsResponse for long-running scans. + * @type bool $routing_cookie + * Notify the server that the client supports using encoded routing cookie + * strings to retry requests with. + * @type bool $retry_info + * Notify the server that the client supports using retry info back off + * durations to retry requests with. + * @type bool $client_side_metrics_enabled + * Notify the server that the client has client side metrics enabled. + * @type bool $traffic_director_enabled + * Notify the server that the client using Traffic Director endpoint. + * @type bool $direct_access_requested + * Notify the server that the client explicitly opted in for Direct Access. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\FeatureFlags::initOnce(); + parent::__construct($data); + } + + /** + * Notify the server that the client supports reverse scans. The server will + * reject ReadRowsRequests with the reverse bit set when this is absent. + * + * Generated from protobuf field bool reverse_scans = 1; + * @return bool + */ + public function getReverseScans() + { + return $this->reverse_scans; + } + + /** + * Notify the server that the client supports reverse scans. The server will + * reject ReadRowsRequests with the reverse bit set when this is absent. + * + * Generated from protobuf field bool reverse_scans = 1; + * @param bool $var + * @return $this + */ + public function setReverseScans($var) + { + GPBUtil::checkBool($var); + $this->reverse_scans = $var; + + return $this; + } + + /** + * Notify the server that the client enables batch write flow control by + * requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons, + * this disables partial retries. + * + * Generated from protobuf field bool mutate_rows_rate_limit = 3; + * @return bool + */ + public function getMutateRowsRateLimit() + { + return $this->mutate_rows_rate_limit; + } + + /** + * Notify the server that the client enables batch write flow control by + * requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons, + * this disables partial retries. + * + * Generated from protobuf field bool mutate_rows_rate_limit = 3; + * @param bool $var + * @return $this + */ + public function setMutateRowsRateLimit($var) + { + GPBUtil::checkBool($var); + $this->mutate_rows_rate_limit = $var; + + return $this; + } + + /** + * Notify the server that the client enables batch write flow control by + * requesting RateLimitInfo from MutateRowsResponse. With partial retries + * enabled. + * + * Generated from protobuf field bool mutate_rows_rate_limit2 = 5; + * @return bool + */ + public function getMutateRowsRateLimit2() + { + return $this->mutate_rows_rate_limit2; + } + + /** + * Notify the server that the client enables batch write flow control by + * requesting RateLimitInfo from MutateRowsResponse. With partial retries + * enabled. + * + * Generated from protobuf field bool mutate_rows_rate_limit2 = 5; + * @param bool $var + * @return $this + */ + public function setMutateRowsRateLimit2($var) + { + GPBUtil::checkBool($var); + $this->mutate_rows_rate_limit2 = $var; + + return $this; + } + + /** + * Notify the server that the client supports the last_scanned_row field + * in ReadRowsResponse for long-running scans. + * + * Generated from protobuf field bool last_scanned_row_responses = 4; + * @return bool + */ + public function getLastScannedRowResponses() + { + return $this->last_scanned_row_responses; + } + + /** + * Notify the server that the client supports the last_scanned_row field + * in ReadRowsResponse for long-running scans. + * + * Generated from protobuf field bool last_scanned_row_responses = 4; + * @param bool $var + * @return $this + */ + public function setLastScannedRowResponses($var) + { + GPBUtil::checkBool($var); + $this->last_scanned_row_responses = $var; + + return $this; + } + + /** + * Notify the server that the client supports using encoded routing cookie + * strings to retry requests with. + * + * Generated from protobuf field bool routing_cookie = 6; + * @return bool + */ + public function getRoutingCookie() + { + return $this->routing_cookie; + } + + /** + * Notify the server that the client supports using encoded routing cookie + * strings to retry requests with. + * + * Generated from protobuf field bool routing_cookie = 6; + * @param bool $var + * @return $this + */ + public function setRoutingCookie($var) + { + GPBUtil::checkBool($var); + $this->routing_cookie = $var; + + return $this; + } + + /** + * Notify the server that the client supports using retry info back off + * durations to retry requests with. + * + * Generated from protobuf field bool retry_info = 7; + * @return bool + */ + public function getRetryInfo() + { + return $this->retry_info; + } + + /** + * Notify the server that the client supports using retry info back off + * durations to retry requests with. + * + * Generated from protobuf field bool retry_info = 7; + * @param bool $var + * @return $this + */ + public function setRetryInfo($var) + { + GPBUtil::checkBool($var); + $this->retry_info = $var; + + return $this; + } + + /** + * Notify the server that the client has client side metrics enabled. + * + * Generated from protobuf field bool client_side_metrics_enabled = 8; + * @return bool + */ + public function getClientSideMetricsEnabled() + { + return $this->client_side_metrics_enabled; + } + + /** + * Notify the server that the client has client side metrics enabled. + * + * Generated from protobuf field bool client_side_metrics_enabled = 8; + * @param bool $var + * @return $this + */ + public function setClientSideMetricsEnabled($var) + { + GPBUtil::checkBool($var); + $this->client_side_metrics_enabled = $var; + + return $this; + } + + /** + * Notify the server that the client using Traffic Director endpoint. + * + * Generated from protobuf field bool traffic_director_enabled = 9; + * @return bool + */ + public function getTrafficDirectorEnabled() + { + return $this->traffic_director_enabled; + } + + /** + * Notify the server that the client using Traffic Director endpoint. + * + * Generated from protobuf field bool traffic_director_enabled = 9; + * @param bool $var + * @return $this + */ + public function setTrafficDirectorEnabled($var) + { + GPBUtil::checkBool($var); + $this->traffic_director_enabled = $var; + + return $this; + } + + /** + * Notify the server that the client explicitly opted in for Direct Access. + * + * Generated from protobuf field bool direct_access_requested = 10; + * @return bool + */ + public function getDirectAccessRequested() + { + return $this->direct_access_requested; + } + + /** + * Notify the server that the client explicitly opted in for Direct Access. + * + * Generated from protobuf field bool direct_access_requested = 10; + * @param bool $var + * @return $this + */ + public function setDirectAccessRequested($var) + { + GPBUtil::checkBool($var); + $this->direct_access_requested = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/FullReadStatsView.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/FullReadStatsView.php new file mode 100644 index 000000000000..3376ecb5017e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/FullReadStatsView.php @@ -0,0 +1,137 @@ +google.bigtable.v2.FullReadStatsView + */ +class FullReadStatsView extends \Google\Protobuf\Internal\Message +{ + /** + * Iteration stats describe how efficient the read is, e.g. comparing + * rows seen vs. rows returned or cells seen vs cells returned can provide an + * indication of read efficiency (the higher the ratio of seen to retuned the + * better). + * + * Generated from protobuf field .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + */ + protected $read_iteration_stats = null; + /** + * Request latency stats describe the time taken to complete a request, from + * the server side. + * + * Generated from protobuf field .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + */ + protected $request_latency_stats = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\ReadIterationStats $read_iteration_stats + * Iteration stats describe how efficient the read is, e.g. comparing + * rows seen vs. rows returned or cells seen vs cells returned can provide an + * indication of read efficiency (the higher the ratio of seen to retuned the + * better). + * @type \Google\Cloud\Bigtable\V2\RequestLatencyStats $request_latency_stats + * Request latency stats describe the time taken to complete a request, from + * the server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\RequestStats::initOnce(); + parent::__construct($data); + } + + /** + * Iteration stats describe how efficient the read is, e.g. comparing + * rows seen vs. rows returned or cells seen vs cells returned can provide an + * indication of read efficiency (the higher the ratio of seen to retuned the + * better). + * + * Generated from protobuf field .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + * @return \Google\Cloud\Bigtable\V2\ReadIterationStats|null + */ + public function getReadIterationStats() + { + return $this->read_iteration_stats; + } + + public function hasReadIterationStats() + { + return isset($this->read_iteration_stats); + } + + public function clearReadIterationStats() + { + unset($this->read_iteration_stats); + } + + /** + * Iteration stats describe how efficient the read is, e.g. comparing + * rows seen vs. rows returned or cells seen vs cells returned can provide an + * indication of read efficiency (the higher the ratio of seen to retuned the + * better). + * + * Generated from protobuf field .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + * @param \Google\Cloud\Bigtable\V2\ReadIterationStats $var + * @return $this + */ + public function setReadIterationStats($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ReadIterationStats::class); + $this->read_iteration_stats = $var; + + return $this; + } + + /** + * Request latency stats describe the time taken to complete a request, from + * the server side. + * + * Generated from protobuf field .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + * @return \Google\Cloud\Bigtable\V2\RequestLatencyStats|null + */ + public function getRequestLatencyStats() + { + return $this->request_latency_stats; + } + + public function hasRequestLatencyStats() + { + return isset($this->request_latency_stats); + } + + public function clearRequestLatencyStats() + { + unset($this->request_latency_stats); + } + + /** + * Request latency stats describe the time taken to complete a request, from + * the server side. + * + * Generated from protobuf field .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + * @param \Google\Cloud\Bigtable\V2\RequestLatencyStats $var + * @return $this + */ + public function setRequestLatencyStats($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RequestLatencyStats::class); + $this->request_latency_stats = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/GenerateInitialChangeStreamPartitionsRequest.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/GenerateInitialChangeStreamPartitionsRequest.php new file mode 100644 index 000000000000..67233adb93bf --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/GenerateInitialChangeStreamPartitionsRequest.php @@ -0,0 +1,160 @@ +google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + */ +class GenerateInitialChangeStreamPartitionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the table from which to get change stream + * partitions. Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $table_name = ''; + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * + * Generated from protobuf field string app_profile_id = 2; + */ + protected $app_profile_id = ''; + + /** + * @param string $tableName Required. The unique name of the table from which to get change stream + * partitions. Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\V2\GenerateInitialChangeStreamPartitionsRequest + * + * @experimental + */ + public static function build(string $tableName): self + { + return (new self()) + ->setTableName($tableName); + } + + /** + * @param string $tableName Required. The unique name of the table from which to get change stream + * partitions. Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $appProfileId This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * + * @return \Google\Cloud\Bigtable\V2\GenerateInitialChangeStreamPartitionsRequest + * + * @experimental + */ + public static function buildFromTableNameAppProfileId(string $tableName, string $appProfileId): self + { + return (new self()) + ->setTableName($tableName) + ->setAppProfileId($appProfileId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * Required. The unique name of the table from which to get change stream + * partitions. Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the table from which to get change stream + * partitions. Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTableName() + { + return $this->table_name; + } + + /** + * Required. The unique name of the table from which to get change stream + * partitions. Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTableName($var) + { + GPBUtil::checkString($var, True); + $this->table_name = $var; + + return $this; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * + * Generated from protobuf field string app_profile_id = 2; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * + * Generated from protobuf field string app_profile_id = 2; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/GenerateInitialChangeStreamPartitionsResponse.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/GenerateInitialChangeStreamPartitionsResponse.php new file mode 100644 index 000000000000..26f241b3bd8c --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/GenerateInitialChangeStreamPartitionsResponse.php @@ -0,0 +1,78 @@ +google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + */ +class GenerateInitialChangeStreamPartitionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A partition of the change stream. + * + * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 1; + */ + protected $partition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\StreamPartition $partition + * A partition of the change stream. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * A partition of the change stream. + * + * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 1; + * @return \Google\Cloud\Bigtable\V2\StreamPartition|null + */ + public function getPartition() + { + return $this->partition; + } + + public function hasPartition() + { + return isset($this->partition); + } + + public function clearPartition() + { + unset($this->partition); + } + + /** + * A partition of the change stream. + * + * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 1; + * @param \Google\Cloud\Bigtable\V2\StreamPartition $var + * @return $this + */ + public function setPartition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\StreamPartition::class); + $this->partition = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowRequest.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowRequest.php new file mode 100644 index 000000000000..50e64e6e0217 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowRequest.php @@ -0,0 +1,290 @@ +google.bigtable.v2.MutateRowRequest + */ +class MutateRowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique name of the table to which the mutation should be + * applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $table_name = ''; + /** + * Optional. The unique name of the AuthorizedView to which the mutation + * should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $authorized_view_name = ''; + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 4; + */ + protected $app_profile_id = ''; + /** + * Required. The key of the row to which the mutation should be applied. + * + * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $row_key = ''; + /** + * Required. Changes to be atomically applied to the specified row. Entries + * are applied in order, meaning that earlier mutations can be masked by later + * ones. Must contain at least one entry and at most 100000. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $mutations; + + /** + * @param string $tableName Optional. The unique name of the table to which the mutation should be + * applied. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $rowKey Required. The key of the row to which the mutation should be applied. + * @param \Google\Cloud\Bigtable\V2\Mutation[] $mutations Required. Changes to be atomically applied to the specified row. Entries + * are applied in order, meaning that earlier mutations can be masked by later + * ones. Must contain at least one entry and at most 100000. + * + * @return \Google\Cloud\Bigtable\V2\MutateRowRequest + * + * @experimental + */ + public static function build(string $tableName, string $rowKey, array $mutations): self + { + return (new self()) + ->setTableName($tableName) + ->setRowKey($rowKey) + ->setMutations($mutations); + } + + /** + * @param string $tableName Optional. The unique name of the table to which the mutation should be + * applied. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $rowKey Required. The key of the row to which the mutation should be applied. + * @param \Google\Cloud\Bigtable\V2\Mutation[] $mutations Required. Changes to be atomically applied to the specified row. Entries + * are applied in order, meaning that earlier mutations can be masked by later + * ones. Must contain at least one entry and at most 100000. + * @param string $appProfileId This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * @return \Google\Cloud\Bigtable\V2\MutateRowRequest + * + * @experimental + */ + public static function buildFromTableNameRowKeyMutationsAppProfileId(string $tableName, string $rowKey, array $mutations, string $appProfileId): self + { + return (new self()) + ->setTableName($tableName) + ->setRowKey($rowKey) + ->setMutations($mutations) + ->setAppProfileId($appProfileId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * Optional. The unique name of the table to which the mutation should be + * applied. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $authorized_view_name + * Optional. The unique name of the AuthorizedView to which the mutation + * should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @type string $row_key + * Required. The key of the row to which the mutation should be applied. + * @type array<\Google\Cloud\Bigtable\V2\Mutation>|\Google\Protobuf\Internal\RepeatedField $mutations + * Required. Changes to be atomically applied to the specified row. Entries + * are applied in order, meaning that earlier mutations can be masked by later + * ones. Must contain at least one entry and at most 100000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique name of the table to which the mutation should be + * applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getTableName() + { + return $this->table_name; + } + + /** + * Optional. The unique name of the table to which the mutation should be + * applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTableName($var) + { + GPBUtil::checkString($var, True); + $this->table_name = $var; + + return $this; + } + + /** + * Optional. The unique name of the AuthorizedView to which the mutation + * should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAuthorizedViewName() + { + return $this->authorized_view_name; + } + + /** + * Optional. The unique name of the AuthorizedView to which the mutation + * should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAuthorizedViewName($var) + { + GPBUtil::checkString($var, True); + $this->authorized_view_name = $var; + + return $this; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 4; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 4; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + + /** + * Required. The key of the row to which the mutation should be applied. + * + * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRowKey() + { + return $this->row_key; + } + + /** + * Required. The key of the row to which the mutation should be applied. + * + * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRowKey($var) + { + GPBUtil::checkString($var, False); + $this->row_key = $var; + + return $this; + } + + /** + * Required. Changes to be atomically applied to the specified row. Entries + * are applied in order, meaning that earlier mutations can be masked by later + * ones. Must contain at least one entry and at most 100000. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMutations() + { + return $this->mutations; + } + + /** + * Required. Changes to be atomically applied to the specified row. Entries + * are applied in order, meaning that earlier mutations can be masked by later + * ones. Must contain at least one entry and at most 100000. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Bigtable\V2\Mutation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMutations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Mutation::class); + $this->mutations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowResponse.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowResponse.php new file mode 100644 index 000000000000..2a2cc243d6aa --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowResponse.php @@ -0,0 +1,33 @@ +google.bigtable.v2.MutateRowResponse + */ +class MutateRowResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsRequest.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsRequest.php new file mode 100644 index 000000000000..64ce09021ece --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsRequest.php @@ -0,0 +1,264 @@ +google.bigtable.v2.MutateRowsRequest + */ +class MutateRowsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique name of the table to which the mutations should be + * applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $table_name = ''; + /** + * Optional. The unique name of the AuthorizedView to which the mutations + * should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $authorized_view_name = ''; + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 3; + */ + protected $app_profile_id = ''; + /** + * Required. The row keys and corresponding mutations to be applied in bulk. + * Each entry is applied as an atomic mutation, but the entries may be + * applied in arbitrary order (even between entries for the same row). + * At least one entry must be specified, and in total the entries can + * contain at most 100000 mutations. + * + * Generated from protobuf field repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entries; + + /** + * @param string $tableName Optional. The unique name of the table to which the mutations should be + * applied. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param \Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry[] $entries Required. The row keys and corresponding mutations to be applied in bulk. + * Each entry is applied as an atomic mutation, but the entries may be + * applied in arbitrary order (even between entries for the same row). + * At least one entry must be specified, and in total the entries can + * contain at most 100000 mutations. + * + * @return \Google\Cloud\Bigtable\V2\MutateRowsRequest + * + * @experimental + */ + public static function build(string $tableName, array $entries): self + { + return (new self()) + ->setTableName($tableName) + ->setEntries($entries); + } + + /** + * @param string $tableName Optional. The unique name of the table to which the mutations should be + * applied. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param \Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry[] $entries Required. The row keys and corresponding mutations to be applied in bulk. + * Each entry is applied as an atomic mutation, but the entries may be + * applied in arbitrary order (even between entries for the same row). + * At least one entry must be specified, and in total the entries can + * contain at most 100000 mutations. + * @param string $appProfileId This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * @return \Google\Cloud\Bigtable\V2\MutateRowsRequest + * + * @experimental + */ + public static function buildFromTableNameEntriesAppProfileId(string $tableName, array $entries, string $appProfileId): self + { + return (new self()) + ->setTableName($tableName) + ->setEntries($entries) + ->setAppProfileId($appProfileId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * Optional. The unique name of the table to which the mutations should be + * applied. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $authorized_view_name + * Optional. The unique name of the AuthorizedView to which the mutations + * should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @type array<\Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry>|\Google\Protobuf\Internal\RepeatedField $entries + * Required. The row keys and corresponding mutations to be applied in bulk. + * Each entry is applied as an atomic mutation, but the entries may be + * applied in arbitrary order (even between entries for the same row). + * At least one entry must be specified, and in total the entries can + * contain at most 100000 mutations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique name of the table to which the mutations should be + * applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getTableName() + { + return $this->table_name; + } + + /** + * Optional. The unique name of the table to which the mutations should be + * applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTableName($var) + { + GPBUtil::checkString($var, True); + $this->table_name = $var; + + return $this; + } + + /** + * Optional. The unique name of the AuthorizedView to which the mutations + * should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAuthorizedViewName() + { + return $this->authorized_view_name; + } + + /** + * Optional. The unique name of the AuthorizedView to which the mutations + * should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAuthorizedViewName($var) + { + GPBUtil::checkString($var, True); + $this->authorized_view_name = $var; + + return $this; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 3; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 3; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + + /** + * Required. The row keys and corresponding mutations to be applied in bulk. + * Each entry is applied as an atomic mutation, but the entries may be + * applied in arbitrary order (even between entries for the same row). + * At least one entry must be specified, and in total the entries can + * contain at most 100000 mutations. + * + * Generated from protobuf field repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntries() + { + return $this->entries; + } + + /** + * Required. The row keys and corresponding mutations to be applied in bulk. + * Each entry is applied as an atomic mutation, but the entries may be + * applied in arbitrary order (even between entries for the same row). + * At least one entry must be specified, and in total the entries can + * contain at most 100000 mutations. + * + * Generated from protobuf field repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry::class); + $this->entries = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsRequest/Entry.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsRequest/Entry.php new file mode 100644 index 000000000000..96659f4574ed --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsRequest/Entry.php @@ -0,0 +1,112 @@ +google.bigtable.v2.MutateRowsRequest.Entry + */ +class Entry extends \Google\Protobuf\Internal\Message +{ + /** + * The key of the row to which the `mutations` should be applied. + * + * Generated from protobuf field bytes row_key = 1; + */ + protected $row_key = ''; + /** + * Required. Changes to be atomically applied to the specified row. + * Mutations are applied in order, meaning that earlier mutations can be + * masked by later ones. You must specify at least one mutation. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $mutations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $row_key + * The key of the row to which the `mutations` should be applied. + * @type array<\Google\Cloud\Bigtable\V2\Mutation>|\Google\Protobuf\Internal\RepeatedField $mutations + * Required. Changes to be atomically applied to the specified row. + * Mutations are applied in order, meaning that earlier mutations can be + * masked by later ones. You must specify at least one mutation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * The key of the row to which the `mutations` should be applied. + * + * Generated from protobuf field bytes row_key = 1; + * @return string + */ + public function getRowKey() + { + return $this->row_key; + } + + /** + * The key of the row to which the `mutations` should be applied. + * + * Generated from protobuf field bytes row_key = 1; + * @param string $var + * @return $this + */ + public function setRowKey($var) + { + GPBUtil::checkString($var, False); + $this->row_key = $var; + + return $this; + } + + /** + * Required. Changes to be atomically applied to the specified row. + * Mutations are applied in order, meaning that earlier mutations can be + * masked by later ones. You must specify at least one mutation. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMutations() + { + return $this->mutations; + } + + /** + * Required. Changes to be atomically applied to the specified row. + * Mutations are applied in order, meaning that earlier mutations can be + * masked by later ones. You must specify at least one mutation. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Bigtable\V2\Mutation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMutations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Mutation::class); + $this->mutations = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Entry::class, \Google\Cloud\Bigtable\V2\MutateRowsRequest_Entry::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsResponse.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsResponse.php new file mode 100644 index 000000000000..9467b61e1b39 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsResponse.php @@ -0,0 +1,119 @@ +google.bigtable.v2.MutateRowsResponse + */ +class MutateRowsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * One or more results for Entries from the batch request. + * + * Generated from protobuf field repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + private $entries; + /** + * Information about how client should limit the rate (QPS). Primirily used by + * supported official Cloud Bigtable clients. If unset, the rate limit info is + * not provided by the server. + * + * Generated from protobuf field optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + protected $rate_limit_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry>|\Google\Protobuf\Internal\RepeatedField $entries + * One or more results for Entries from the batch request. + * @type \Google\Cloud\Bigtable\V2\RateLimitInfo $rate_limit_info + * Information about how client should limit the rate (QPS). Primirily used by + * supported official Cloud Bigtable clients. If unset, the rate limit info is + * not provided by the server. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * One or more results for Entries from the batch request. + * + * Generated from protobuf field repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntries() + { + return $this->entries; + } + + /** + * One or more results for Entries from the batch request. + * + * Generated from protobuf field repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + * @param array<\Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry::class); + $this->entries = $arr; + + return $this; + } + + /** + * Information about how client should limit the rate (QPS). Primirily used by + * supported official Cloud Bigtable clients. If unset, the rate limit info is + * not provided by the server. + * + * Generated from protobuf field optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + * @return \Google\Cloud\Bigtable\V2\RateLimitInfo|null + */ + public function getRateLimitInfo() + { + return $this->rate_limit_info; + } + + public function hasRateLimitInfo() + { + return isset($this->rate_limit_info); + } + + public function clearRateLimitInfo() + { + unset($this->rate_limit_info); + } + + /** + * Information about how client should limit the rate (QPS). Primirily used by + * supported official Cloud Bigtable clients. If unset, the rate limit info is + * not provided by the server. + * + * Generated from protobuf field optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + * @param \Google\Cloud\Bigtable\V2\RateLimitInfo $var + * @return $this + */ + public function setRateLimitInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RateLimitInfo::class); + $this->rate_limit_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsResponse/Entry.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsResponse/Entry.php new file mode 100644 index 000000000000..a6049b0d0792 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/MutateRowsResponse/Entry.php @@ -0,0 +1,130 @@ +google.bigtable.v2.MutateRowsResponse.Entry + */ +class Entry extends \Google\Protobuf\Internal\Message +{ + /** + * The index into the original request's `entries` list of the Entry + * for which a result is being reported. + * + * Generated from protobuf field int64 index = 1; + */ + protected $index = 0; + /** + * The result of the request Entry identified by `index`. + * Depending on how requests are batched during execution, it is possible + * for one Entry to fail due to an error with another Entry. In the event + * that this occurs, the same error will be reported for both entries. + * + * Generated from protobuf field .google.rpc.Status status = 2; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $index + * The index into the original request's `entries` list of the Entry + * for which a result is being reported. + * @type \Google\Rpc\Status $status + * The result of the request Entry identified by `index`. + * Depending on how requests are batched during execution, it is possible + * for one Entry to fail due to an error with another Entry. In the event + * that this occurs, the same error will be reported for both entries. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * The index into the original request's `entries` list of the Entry + * for which a result is being reported. + * + * Generated from protobuf field int64 index = 1; + * @return int|string + */ + public function getIndex() + { + return $this->index; + } + + /** + * The index into the original request's `entries` list of the Entry + * for which a result is being reported. + * + * Generated from protobuf field int64 index = 1; + * @param int|string $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt64($var); + $this->index = $var; + + return $this; + } + + /** + * The result of the request Entry identified by `index`. + * Depending on how requests are batched during execution, it is possible + * for one Entry to fail due to an error with another Entry. In the event + * that this occurs, the same error will be reported for both entries. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @return \Google\Rpc\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * The result of the request Entry identified by `index`. + * Depending on how requests are batched during execution, it is possible + * for one Entry to fail due to an error with another Entry. In the event + * that this occurs, the same error will be reported for both entries. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Entry::class, \Google\Cloud\Bigtable\V2\MutateRowsResponse_Entry::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation.php new file mode 100644 index 000000000000..24f7bf5f7d59 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation.php @@ -0,0 +1,240 @@ +google.bigtable.v2.Mutation + */ +class Mutation extends \Google\Protobuf\Internal\Message +{ + protected $mutation; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Mutation\SetCell $set_cell + * Set a cell's value. + * @type \Google\Cloud\Bigtable\V2\Mutation\AddToCell $add_to_cell + * Incrementally updates an `Aggregate` cell. + * @type \Google\Cloud\Bigtable\V2\Mutation\MergeToCell $merge_to_cell + * Merges accumulated state to an `Aggregate` cell. + * @type \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn $delete_from_column + * Deletes cells from a column. + * @type \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily $delete_from_family + * Deletes cells from a column family. + * @type \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow $delete_from_row + * Deletes cells from the entire row. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * Set a cell's value. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * @return \Google\Cloud\Bigtable\V2\Mutation\SetCell|null + */ + public function getSetCell() + { + return $this->readOneof(1); + } + + public function hasSetCell() + { + return $this->hasOneof(1); + } + + /** + * Set a cell's value. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * @param \Google\Cloud\Bigtable\V2\Mutation\SetCell $var + * @return $this + */ + public function setSetCell($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation\SetCell::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Incrementally updates an `Aggregate` cell. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + * @return \Google\Cloud\Bigtable\V2\Mutation\AddToCell|null + */ + public function getAddToCell() + { + return $this->readOneof(5); + } + + public function hasAddToCell() + { + return $this->hasOneof(5); + } + + /** + * Incrementally updates an `Aggregate` cell. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + * @param \Google\Cloud\Bigtable\V2\Mutation\AddToCell $var + * @return $this + */ + public function setAddToCell($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation\AddToCell::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Merges accumulated state to an `Aggregate` cell. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + * @return \Google\Cloud\Bigtable\V2\Mutation\MergeToCell|null + */ + public function getMergeToCell() + { + return $this->readOneof(6); + } + + public function hasMergeToCell() + { + return $this->hasOneof(6); + } + + /** + * Merges accumulated state to an `Aggregate` cell. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + * @param \Google\Cloud\Bigtable\V2\Mutation\MergeToCell $var + * @return $this + */ + public function setMergeToCell($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation\MergeToCell::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Deletes cells from a column. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + * @return \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn|null + */ + public function getDeleteFromColumn() + { + return $this->readOneof(2); + } + + public function hasDeleteFromColumn() + { + return $this->hasOneof(2); + } + + /** + * Deletes cells from a column. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + * @param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn $var + * @return $this + */ + public function setDeleteFromColumn($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Deletes cells from a column family. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + * @return \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily|null + */ + public function getDeleteFromFamily() + { + return $this->readOneof(3); + } + + public function hasDeleteFromFamily() + { + return $this->hasOneof(3); + } + + /** + * Deletes cells from a column family. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + * @param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily $var + * @return $this + */ + public function setDeleteFromFamily($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Deletes cells from the entire row. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + * @return \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow|null + */ + public function getDeleteFromRow() + { + return $this->readOneof(4); + } + + public function hasDeleteFromRow() + { + return $this->hasOneof(4); + } + + /** + * Deletes cells from the entire row. + * + * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + * @param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow $var + * @return $this + */ + public function setDeleteFromRow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getMutation() + { + return $this->whichOneof("mutation"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/AddToCell.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/AddToCell.php new file mode 100644 index 000000000000..2ef613a1e015 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/AddToCell.php @@ -0,0 +1,222 @@ +google.bigtable.v2.Mutation.AddToCell + */ +class AddToCell extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the `Aggregate` family into which new data should be added. + * This must be a family with a `value_type` of `Aggregate`. + * Format: `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + */ + protected $family_name = ''; + /** + * The qualifier of the column into which new data should be added. This + * must be a `raw_value`. + * + * Generated from protobuf field .google.bigtable.v2.Value column_qualifier = 2; + */ + protected $column_qualifier = null; + /** + * The timestamp of the cell to which new data should be added. This must + * be a `raw_timestamp_micros` that matches the table's `granularity`. + * + * Generated from protobuf field .google.bigtable.v2.Value timestamp = 3; + */ + protected $timestamp = null; + /** + * The input value to be accumulated into the specified cell. This must be + * compatible with the family's `value_type.input_type`. + * + * Generated from protobuf field .google.bigtable.v2.Value input = 4; + */ + protected $input = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the `Aggregate` family into which new data should be added. + * This must be a family with a `value_type` of `Aggregate`. + * Format: `[-_.a-zA-Z0-9]+` + * @type \Google\Cloud\Bigtable\V2\Value $column_qualifier + * The qualifier of the column into which new data should be added. This + * must be a `raw_value`. + * @type \Google\Cloud\Bigtable\V2\Value $timestamp + * The timestamp of the cell to which new data should be added. This must + * be a `raw_timestamp_micros` that matches the table's `granularity`. + * @type \Google\Cloud\Bigtable\V2\Value $input + * The input value to be accumulated into the specified cell. This must be + * compatible with the family's `value_type.input_type`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the `Aggregate` family into which new data should be added. + * This must be a family with a `value_type` of `Aggregate`. + * Format: `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * The name of the `Aggregate` family into which new data should be added. + * This must be a family with a `value_type` of `Aggregate`. + * Format: `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + + /** + * The qualifier of the column into which new data should be added. This + * must be a `raw_value`. + * + * Generated from protobuf field .google.bigtable.v2.Value column_qualifier = 2; + * @return \Google\Cloud\Bigtable\V2\Value|null + */ + public function getColumnQualifier() + { + return $this->column_qualifier; + } + + public function hasColumnQualifier() + { + return isset($this->column_qualifier); + } + + public function clearColumnQualifier() + { + unset($this->column_qualifier); + } + + /** + * The qualifier of the column into which new data should be added. This + * must be a `raw_value`. + * + * Generated from protobuf field .google.bigtable.v2.Value column_qualifier = 2; + * @param \Google\Cloud\Bigtable\V2\Value $var + * @return $this + */ + public function setColumnQualifier($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Value::class); + $this->column_qualifier = $var; + + return $this; + } + + /** + * The timestamp of the cell to which new data should be added. This must + * be a `raw_timestamp_micros` that matches the table's `granularity`. + * + * Generated from protobuf field .google.bigtable.v2.Value timestamp = 3; + * @return \Google\Cloud\Bigtable\V2\Value|null + */ + public function getTimestamp() + { + return $this->timestamp; + } + + public function hasTimestamp() + { + return isset($this->timestamp); + } + + public function clearTimestamp() + { + unset($this->timestamp); + } + + /** + * The timestamp of the cell to which new data should be added. This must + * be a `raw_timestamp_micros` that matches the table's `granularity`. + * + * Generated from protobuf field .google.bigtable.v2.Value timestamp = 3; + * @param \Google\Cloud\Bigtable\V2\Value $var + * @return $this + */ + public function setTimestamp($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Value::class); + $this->timestamp = $var; + + return $this; + } + + /** + * The input value to be accumulated into the specified cell. This must be + * compatible with the family's `value_type.input_type`. + * + * Generated from protobuf field .google.bigtable.v2.Value input = 4; + * @return \Google\Cloud\Bigtable\V2\Value|null + */ + public function getInput() + { + return $this->input; + } + + public function hasInput() + { + return isset($this->input); + } + + public function clearInput() + { + unset($this->input); + } + + /** + * The input value to be accumulated into the specified cell. This must be + * compatible with the family's `value_type.input_type`. + * + * Generated from protobuf field .google.bigtable.v2.Value input = 4; + * @param \Google\Cloud\Bigtable\V2\Value $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Value::class); + $this->input = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AddToCell::class, \Google\Cloud\Bigtable\V2\Mutation_AddToCell::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/DeleteFromColumn.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/DeleteFromColumn.php new file mode 100644 index 000000000000..a91638edfa4a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/DeleteFromColumn.php @@ -0,0 +1,157 @@ +google.bigtable.v2.Mutation.DeleteFromColumn + */ +class DeleteFromColumn extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + */ + protected $family_name = ''; + /** + * The qualifier of the column from which cells should be deleted. + * Can be any byte string, including the empty string. + * + * Generated from protobuf field bytes column_qualifier = 2; + */ + protected $column_qualifier = ''; + /** + * The range of timestamps within which cells should be deleted. + * + * Generated from protobuf field .google.bigtable.v2.TimestampRange time_range = 3; + */ + protected $time_range = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * @type string $column_qualifier + * The qualifier of the column from which cells should be deleted. + * Can be any byte string, including the empty string. + * @type \Google\Cloud\Bigtable\V2\TimestampRange $time_range + * The range of timestamps within which cells should be deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + + /** + * The qualifier of the column from which cells should be deleted. + * Can be any byte string, including the empty string. + * + * Generated from protobuf field bytes column_qualifier = 2; + * @return string + */ + public function getColumnQualifier() + { + return $this->column_qualifier; + } + + /** + * The qualifier of the column from which cells should be deleted. + * Can be any byte string, including the empty string. + * + * Generated from protobuf field bytes column_qualifier = 2; + * @param string $var + * @return $this + */ + public function setColumnQualifier($var) + { + GPBUtil::checkString($var, False); + $this->column_qualifier = $var; + + return $this; + } + + /** + * The range of timestamps within which cells should be deleted. + * + * Generated from protobuf field .google.bigtable.v2.TimestampRange time_range = 3; + * @return \Google\Cloud\Bigtable\V2\TimestampRange|null + */ + public function getTimeRange() + { + return $this->time_range; + } + + public function hasTimeRange() + { + return isset($this->time_range); + } + + public function clearTimeRange() + { + unset($this->time_range); + } + + /** + * The range of timestamps within which cells should be deleted. + * + * Generated from protobuf field .google.bigtable.v2.TimestampRange time_range = 3; + * @param \Google\Cloud\Bigtable\V2\TimestampRange $var + * @return $this + */ + public function setTimeRange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\TimestampRange::class); + $this->time_range = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DeleteFromColumn::class, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromColumn::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/DeleteFromFamily.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/DeleteFromFamily.php new file mode 100644 index 000000000000..66cdb291bf3c --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/DeleteFromFamily.php @@ -0,0 +1,74 @@ +google.bigtable.v2.Mutation.DeleteFromFamily + */ +class DeleteFromFamily extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + */ + protected $family_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DeleteFromFamily::class, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromFamily::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/DeleteFromRow.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/DeleteFromRow.php new file mode 100644 index 000000000000..9200902a1780 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/DeleteFromRow.php @@ -0,0 +1,36 @@ +google.bigtable.v2.Mutation.DeleteFromRow + */ +class DeleteFromRow extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DeleteFromRow::class, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromRow::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/MergeToCell.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/MergeToCell.php new file mode 100644 index 000000000000..391e80f1aeea --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/MergeToCell.php @@ -0,0 +1,227 @@ +google.bigtable.v2.Mutation.MergeToCell + */ +class MergeToCell extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the `Aggregate` family into which new data should be added. + * This must be a family with a `value_type` of `Aggregate`. + * Format: `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + */ + protected $family_name = ''; + /** + * The qualifier of the column into which new data should be added. This + * must be a `raw_value`. + * + * Generated from protobuf field .google.bigtable.v2.Value column_qualifier = 2; + */ + protected $column_qualifier = null; + /** + * The timestamp of the cell to which new data should be added. This must + * be a `raw_timestamp_micros` that matches the table's `granularity`. + * + * Generated from protobuf field .google.bigtable.v2.Value timestamp = 3; + */ + protected $timestamp = null; + /** + * The input value to be merged into the specified cell. This must be + * compatible with the family's `value_type.state_type`. Merging `NULL` is + * allowed, but has no effect. + * + * Generated from protobuf field .google.bigtable.v2.Value input = 4; + */ + protected $input = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the `Aggregate` family into which new data should be added. + * This must be a family with a `value_type` of `Aggregate`. + * Format: `[-_.a-zA-Z0-9]+` + * @type \Google\Cloud\Bigtable\V2\Value $column_qualifier + * The qualifier of the column into which new data should be added. This + * must be a `raw_value`. + * @type \Google\Cloud\Bigtable\V2\Value $timestamp + * The timestamp of the cell to which new data should be added. This must + * be a `raw_timestamp_micros` that matches the table's `granularity`. + * @type \Google\Cloud\Bigtable\V2\Value $input + * The input value to be merged into the specified cell. This must be + * compatible with the family's `value_type.state_type`. Merging `NULL` is + * allowed, but has no effect. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the `Aggregate` family into which new data should be added. + * This must be a family with a `value_type` of `Aggregate`. + * Format: `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * The name of the `Aggregate` family into which new data should be added. + * This must be a family with a `value_type` of `Aggregate`. + * Format: `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + + /** + * The qualifier of the column into which new data should be added. This + * must be a `raw_value`. + * + * Generated from protobuf field .google.bigtable.v2.Value column_qualifier = 2; + * @return \Google\Cloud\Bigtable\V2\Value|null + */ + public function getColumnQualifier() + { + return $this->column_qualifier; + } + + public function hasColumnQualifier() + { + return isset($this->column_qualifier); + } + + public function clearColumnQualifier() + { + unset($this->column_qualifier); + } + + /** + * The qualifier of the column into which new data should be added. This + * must be a `raw_value`. + * + * Generated from protobuf field .google.bigtable.v2.Value column_qualifier = 2; + * @param \Google\Cloud\Bigtable\V2\Value $var + * @return $this + */ + public function setColumnQualifier($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Value::class); + $this->column_qualifier = $var; + + return $this; + } + + /** + * The timestamp of the cell to which new data should be added. This must + * be a `raw_timestamp_micros` that matches the table's `granularity`. + * + * Generated from protobuf field .google.bigtable.v2.Value timestamp = 3; + * @return \Google\Cloud\Bigtable\V2\Value|null + */ + public function getTimestamp() + { + return $this->timestamp; + } + + public function hasTimestamp() + { + return isset($this->timestamp); + } + + public function clearTimestamp() + { + unset($this->timestamp); + } + + /** + * The timestamp of the cell to which new data should be added. This must + * be a `raw_timestamp_micros` that matches the table's `granularity`. + * + * Generated from protobuf field .google.bigtable.v2.Value timestamp = 3; + * @param \Google\Cloud\Bigtable\V2\Value $var + * @return $this + */ + public function setTimestamp($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Value::class); + $this->timestamp = $var; + + return $this; + } + + /** + * The input value to be merged into the specified cell. This must be + * compatible with the family's `value_type.state_type`. Merging `NULL` is + * allowed, but has no effect. + * + * Generated from protobuf field .google.bigtable.v2.Value input = 4; + * @return \Google\Cloud\Bigtable\V2\Value|null + */ + public function getInput() + { + return $this->input; + } + + public function hasInput() + { + return isset($this->input); + } + + public function clearInput() + { + unset($this->input); + } + + /** + * The input value to be merged into the specified cell. This must be + * compatible with the family's `value_type.state_type`. Merging `NULL` is + * allowed, but has no effect. + * + * Generated from protobuf field .google.bigtable.v2.Value input = 4; + * @param \Google\Cloud\Bigtable\V2\Value $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Value::class); + $this->input = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MergeToCell::class, \Google\Cloud\Bigtable\V2\Mutation_MergeToCell::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/SetCell.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/SetCell.php new file mode 100644 index 000000000000..b156e5d5d564 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Mutation/SetCell.php @@ -0,0 +1,196 @@ +google.bigtable.v2.Mutation.SetCell + */ +class SetCell extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the family into which new data should be written. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + */ + protected $family_name = ''; + /** + * The qualifier of the column into which new data should be written. + * Can be any byte string, including the empty string. + * + * Generated from protobuf field bytes column_qualifier = 2; + */ + protected $column_qualifier = ''; + /** + * The timestamp of the cell into which new data should be written. + * Use -1 for current Bigtable server time. + * Otherwise, the client should set this value itself, noting that the + * default value is a timestamp of zero if the field is left unspecified. + * Values must match the granularity of the table (e.g. micros, millis). + * + * Generated from protobuf field int64 timestamp_micros = 3; + */ + protected $timestamp_micros = 0; + /** + * The value to be written into the specified cell. + * + * Generated from protobuf field bytes value = 4; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the family into which new data should be written. + * Must match `[-_.a-zA-Z0-9]+` + * @type string $column_qualifier + * The qualifier of the column into which new data should be written. + * Can be any byte string, including the empty string. + * @type int|string $timestamp_micros + * The timestamp of the cell into which new data should be written. + * Use -1 for current Bigtable server time. + * Otherwise, the client should set this value itself, noting that the + * default value is a timestamp of zero if the field is left unspecified. + * Values must match the granularity of the table (e.g. micros, millis). + * @type string $value + * The value to be written into the specified cell. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the family into which new data should be written. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * The name of the family into which new data should be written. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + + /** + * The qualifier of the column into which new data should be written. + * Can be any byte string, including the empty string. + * + * Generated from protobuf field bytes column_qualifier = 2; + * @return string + */ + public function getColumnQualifier() + { + return $this->column_qualifier; + } + + /** + * The qualifier of the column into which new data should be written. + * Can be any byte string, including the empty string. + * + * Generated from protobuf field bytes column_qualifier = 2; + * @param string $var + * @return $this + */ + public function setColumnQualifier($var) + { + GPBUtil::checkString($var, False); + $this->column_qualifier = $var; + + return $this; + } + + /** + * The timestamp of the cell into which new data should be written. + * Use -1 for current Bigtable server time. + * Otherwise, the client should set this value itself, noting that the + * default value is a timestamp of zero if the field is left unspecified. + * Values must match the granularity of the table (e.g. micros, millis). + * + * Generated from protobuf field int64 timestamp_micros = 3; + * @return int|string + */ + public function getTimestampMicros() + { + return $this->timestamp_micros; + } + + /** + * The timestamp of the cell into which new data should be written. + * Use -1 for current Bigtable server time. + * Otherwise, the client should set this value itself, noting that the + * default value is a timestamp of zero if the field is left unspecified. + * Values must match the granularity of the table (e.g. micros, millis). + * + * Generated from protobuf field int64 timestamp_micros = 3; + * @param int|string $var + * @return $this + */ + public function setTimestampMicros($var) + { + GPBUtil::checkInt64($var); + $this->timestamp_micros = $var; + + return $this; + } + + /** + * The value to be written into the specified cell. + * + * Generated from protobuf field bytes value = 4; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value to be written into the specified cell. + * + * Generated from protobuf field bytes value = 4; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, False); + $this->value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SetCell::class, \Google\Cloud\Bigtable\V2\Mutation_SetCell::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/PartialResultSet.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/PartialResultSet.php new file mode 100644 index 000000000000..321757c77992 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/PartialResultSet.php @@ -0,0 +1,225 @@ +google.bigtable.v2.PartialResultSet + */ +class PartialResultSet extends \Google\Protobuf\Internal\Message +{ + /** + * An opaque token sent by the server to allow query resumption and signal + * the client to accumulate `partial_rows` since the last non-empty + * `resume_token`. On resumption, the resumed query will return the remaining + * rows for this query. + * If there is a batch in progress, a non-empty `resume_token` + * means that that the batch of `partial_rows` will be complete after merging + * the `partial_rows` from this response. The client must only yield + * completed batches to the application, and must ensure that any future + * retries send the latest token to avoid returning duplicate data. + * The server may set 'resume_token' without a 'partial_rows'. If there is a + * batch in progress the client should yield it. + * The server will also send a sentinel `resume_token` when last batch of + * `partial_rows` is sent. If the client retries the ExecuteQueryRequest with + * the sentinel `resume_token`, the server will emit it again without any + * `partial_rows`, then return OK. + * + * Generated from protobuf field bytes resume_token = 5; + */ + protected $resume_token = ''; + /** + * Estimated size of a new batch. The server will always set this when + * returning the first `partial_rows` of a batch, and will not set it at any + * other time. + * The client can use this estimate to allocate an initial buffer for the + * batched results. This helps minimize the number of allocations required, + * though the buffer size may still need to be increased if the estimate is + * too low. + * + * Generated from protobuf field int32 estimated_batch_size = 4; + */ + protected $estimated_batch_size = 0; + protected $partial_rows; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\ProtoRowsBatch $proto_rows_batch + * Partial rows in serialized ProtoRows format. + * @type string $resume_token + * An opaque token sent by the server to allow query resumption and signal + * the client to accumulate `partial_rows` since the last non-empty + * `resume_token`. On resumption, the resumed query will return the remaining + * rows for this query. + * If there is a batch in progress, a non-empty `resume_token` + * means that that the batch of `partial_rows` will be complete after merging + * the `partial_rows` from this response. The client must only yield + * completed batches to the application, and must ensure that any future + * retries send the latest token to avoid returning duplicate data. + * The server may set 'resume_token' without a 'partial_rows'. If there is a + * batch in progress the client should yield it. + * The server will also send a sentinel `resume_token` when last batch of + * `partial_rows` is sent. If the client retries the ExecuteQueryRequest with + * the sentinel `resume_token`, the server will emit it again without any + * `partial_rows`, then return OK. + * @type int $estimated_batch_size + * Estimated size of a new batch. The server will always set this when + * returning the first `partial_rows` of a batch, and will not set it at any + * other time. + * The client can use this estimate to allocate an initial buffer for the + * batched results. This helps minimize the number of allocations required, + * though the buffer size may still need to be increased if the estimate is + * too low. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * Partial rows in serialized ProtoRows format. + * + * Generated from protobuf field .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + * @return \Google\Cloud\Bigtable\V2\ProtoRowsBatch|null + */ + public function getProtoRowsBatch() + { + return $this->readOneof(3); + } + + public function hasProtoRowsBatch() + { + return $this->hasOneof(3); + } + + /** + * Partial rows in serialized ProtoRows format. + * + * Generated from protobuf field .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + * @param \Google\Cloud\Bigtable\V2\ProtoRowsBatch $var + * @return $this + */ + public function setProtoRowsBatch($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ProtoRowsBatch::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * An opaque token sent by the server to allow query resumption and signal + * the client to accumulate `partial_rows` since the last non-empty + * `resume_token`. On resumption, the resumed query will return the remaining + * rows for this query. + * If there is a batch in progress, a non-empty `resume_token` + * means that that the batch of `partial_rows` will be complete after merging + * the `partial_rows` from this response. The client must only yield + * completed batches to the application, and must ensure that any future + * retries send the latest token to avoid returning duplicate data. + * The server may set 'resume_token' without a 'partial_rows'. If there is a + * batch in progress the client should yield it. + * The server will also send a sentinel `resume_token` when last batch of + * `partial_rows` is sent. If the client retries the ExecuteQueryRequest with + * the sentinel `resume_token`, the server will emit it again without any + * `partial_rows`, then return OK. + * + * Generated from protobuf field bytes resume_token = 5; + * @return string + */ + public function getResumeToken() + { + return $this->resume_token; + } + + /** + * An opaque token sent by the server to allow query resumption and signal + * the client to accumulate `partial_rows` since the last non-empty + * `resume_token`. On resumption, the resumed query will return the remaining + * rows for this query. + * If there is a batch in progress, a non-empty `resume_token` + * means that that the batch of `partial_rows` will be complete after merging + * the `partial_rows` from this response. The client must only yield + * completed batches to the application, and must ensure that any future + * retries send the latest token to avoid returning duplicate data. + * The server may set 'resume_token' without a 'partial_rows'. If there is a + * batch in progress the client should yield it. + * The server will also send a sentinel `resume_token` when last batch of + * `partial_rows` is sent. If the client retries the ExecuteQueryRequest with + * the sentinel `resume_token`, the server will emit it again without any + * `partial_rows`, then return OK. + * + * Generated from protobuf field bytes resume_token = 5; + * @param string $var + * @return $this + */ + public function setResumeToken($var) + { + GPBUtil::checkString($var, False); + $this->resume_token = $var; + + return $this; + } + + /** + * Estimated size of a new batch. The server will always set this when + * returning the first `partial_rows` of a batch, and will not set it at any + * other time. + * The client can use this estimate to allocate an initial buffer for the + * batched results. This helps minimize the number of allocations required, + * though the buffer size may still need to be increased if the estimate is + * too low. + * + * Generated from protobuf field int32 estimated_batch_size = 4; + * @return int + */ + public function getEstimatedBatchSize() + { + return $this->estimated_batch_size; + } + + /** + * Estimated size of a new batch. The server will always set this when + * returning the first `partial_rows` of a batch, and will not set it at any + * other time. + * The client can use this estimate to allocate an initial buffer for the + * batched results. This helps minimize the number of allocations required, + * though the buffer size may still need to be increased if the estimate is + * too low. + * + * Generated from protobuf field int32 estimated_batch_size = 4; + * @param int $var + * @return $this + */ + public function setEstimatedBatchSize($var) + { + GPBUtil::checkInt32($var); + $this->estimated_batch_size = $var; + + return $this; + } + + /** + * @return string + */ + public function getPartialRows() + { + return $this->whichOneof("partial_rows"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/PingAndWarmRequest.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/PingAndWarmRequest.php new file mode 100644 index 000000000000..4daf892b444f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/PingAndWarmRequest.php @@ -0,0 +1,148 @@ +google.bigtable.v2.PingAndWarmRequest + */ +class PingAndWarmRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the instance to check permissions for as well + * as respond. Values are of the form + * `projects//instances/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2; + */ + protected $app_profile_id = ''; + + /** + * @param string $name Required. The unique name of the instance to check permissions for as well + * as respond. Values are of the form + * `projects//instances/`. Please see + * {@see BigtableClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\V2\PingAndWarmRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * @param string $name Required. The unique name of the instance to check permissions for as well + * as respond. Values are of the form + * `projects//instances/`. Please see + * {@see BigtableClient::instanceName()} for help formatting this field. + * @param string $appProfileId This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * @return \Google\Cloud\Bigtable\V2\PingAndWarmRequest + * + * @experimental + */ + public static function buildFromNameAppProfileId(string $name, string $appProfileId): self + { + return (new self()) + ->setName($name) + ->setAppProfileId($appProfileId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the instance to check permissions for as well + * as respond. Values are of the form + * `projects//instances/`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the instance to check permissions for as well + * as respond. Values are of the form + * `projects//instances/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique name of the instance to check permissions for as well + * as respond. Values are of the form + * `projects//instances/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/PingAndWarmResponse.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/PingAndWarmResponse.php new file mode 100644 index 000000000000..a14857274660 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/PingAndWarmResponse.php @@ -0,0 +1,33 @@ +google.bigtable.v2.PingAndWarmResponse + */ +class PingAndWarmResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoFormat.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoFormat.php new file mode 100644 index 000000000000..3317d0383327 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoFormat.php @@ -0,0 +1,34 @@ +google.bigtable.v2.ProtoFormat + */ +class ProtoFormat extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoRows.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoRows.php new file mode 100644 index 000000000000..42447f5b08bf --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoRows.php @@ -0,0 +1,78 @@ +google.bigtable.v2.ProtoRows + */ +class ProtoRows extends \Google\Protobuf\Internal\Message +{ + /** + * A proto rows message consists of a list of values. Every N complete values + * defines a row, where N is equal to the number of entries in the + * `metadata.proto_schema.columns` value received in the first response. + * + * Generated from protobuf field repeated .google.bigtable.v2.Value values = 2; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\V2\Value>|\Google\Protobuf\Internal\RepeatedField $values + * A proto rows message consists of a list of values. Every N complete values + * defines a row, where N is equal to the number of entries in the + * `metadata.proto_schema.columns` value received in the first response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * A proto rows message consists of a list of values. Every N complete values + * defines a row, where N is equal to the number of entries in the + * `metadata.proto_schema.columns` value received in the first response. + * + * Generated from protobuf field repeated .google.bigtable.v2.Value values = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * A proto rows message consists of a list of values. Every N complete values + * defines a row, where N is equal to the number of entries in the + * `metadata.proto_schema.columns` value received in the first response. + * + * Generated from protobuf field repeated .google.bigtable.v2.Value values = 2; + * @param array<\Google\Cloud\Bigtable\V2\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Value::class); + $this->values = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoRowsBatch.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoRowsBatch.php new file mode 100644 index 000000000000..3c7ea10177e7 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoRowsBatch.php @@ -0,0 +1,71 @@ +google.bigtable.v2.ProtoRowsBatch + */ +class ProtoRowsBatch extends \Google\Protobuf\Internal\Message +{ + /** + * Merge partial results by concatenating these bytes, then parsing the + * overall value as a `ProtoRows` message. + * + * Generated from protobuf field bytes batch_data = 1; + */ + protected $batch_data = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $batch_data + * Merge partial results by concatenating these bytes, then parsing the + * overall value as a `ProtoRows` message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * Merge partial results by concatenating these bytes, then parsing the + * overall value as a `ProtoRows` message. + * + * Generated from protobuf field bytes batch_data = 1; + * @return string + */ + public function getBatchData() + { + return $this->batch_data; + } + + /** + * Merge partial results by concatenating these bytes, then parsing the + * overall value as a `ProtoRows` message. + * + * Generated from protobuf field bytes batch_data = 1; + * @param string $var + * @return $this + */ + public function setBatchData($var) + { + GPBUtil::checkString($var, False); + $this->batch_data = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoSchema.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoSchema.php new file mode 100644 index 000000000000..efd883b7c5e2 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ProtoSchema.php @@ -0,0 +1,67 @@ +google.bigtable.v2.ProtoSchema + */ +class ProtoSchema extends \Google\Protobuf\Internal\Message +{ + /** + * The columns in the result set. + * + * Generated from protobuf field repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + private $columns; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\V2\ColumnMetadata>|\Google\Protobuf\Internal\RepeatedField $columns + * The columns in the result set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The columns in the result set. + * + * Generated from protobuf field repeated .google.bigtable.v2.ColumnMetadata columns = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getColumns() + { + return $this->columns; + } + + /** + * The columns in the result set. + * + * Generated from protobuf field repeated .google.bigtable.v2.ColumnMetadata columns = 1; + * @param array<\Google\Cloud\Bigtable\V2\ColumnMetadata>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setColumns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\ColumnMetadata::class); + $this->columns = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RateLimitInfo.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RateLimitInfo.php new file mode 100644 index 000000000000..db1f756b6be9 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RateLimitInfo.php @@ -0,0 +1,159 @@ +google.bigtable.v2.RateLimitInfo + */ +class RateLimitInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Time that clients should wait before adjusting the target rate again. + * If clients adjust rate too frequently, the impact of the previous + * adjustment may not have been taken into account and may + * over-throttle or under-throttle. If clients adjust rate too slowly, they + * will not be responsive to load changes on server side, and may + * over-throttle or under-throttle. + * + * Generated from protobuf field .google.protobuf.Duration period = 1; + */ + protected $period = null; + /** + * If it has been at least one `period` since the last load adjustment, the + * client should multiply the current load by this value to get the new target + * load. For example, if the current load is 100 and `factor` is 0.8, the new + * target load should be 80. After adjusting, the client should ignore + * `factor` until another `period` has passed. + * The client can measure its load using any unit that's comparable over time + * For example, QPS can be used as long as each request involves a similar + * amount of work. + * + * Generated from protobuf field double factor = 2; + */ + protected $factor = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $period + * Time that clients should wait before adjusting the target rate again. + * If clients adjust rate too frequently, the impact of the previous + * adjustment may not have been taken into account and may + * over-throttle or under-throttle. If clients adjust rate too slowly, they + * will not be responsive to load changes on server side, and may + * over-throttle or under-throttle. + * @type float $factor + * If it has been at least one `period` since the last load adjustment, the + * client should multiply the current load by this value to get the new target + * load. For example, if the current load is 100 and `factor` is 0.8, the new + * target load should be 80. After adjusting, the client should ignore + * `factor` until another `period` has passed. + * The client can measure its load using any unit that's comparable over time + * For example, QPS can be used as long as each request involves a similar + * amount of work. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Time that clients should wait before adjusting the target rate again. + * If clients adjust rate too frequently, the impact of the previous + * adjustment may not have been taken into account and may + * over-throttle or under-throttle. If clients adjust rate too slowly, they + * will not be responsive to load changes on server side, and may + * over-throttle or under-throttle. + * + * Generated from protobuf field .google.protobuf.Duration period = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getPeriod() + { + return $this->period; + } + + public function hasPeriod() + { + return isset($this->period); + } + + public function clearPeriod() + { + unset($this->period); + } + + /** + * Time that clients should wait before adjusting the target rate again. + * If clients adjust rate too frequently, the impact of the previous + * adjustment may not have been taken into account and may + * over-throttle or under-throttle. If clients adjust rate too slowly, they + * will not be responsive to load changes on server side, and may + * over-throttle or under-throttle. + * + * Generated from protobuf field .google.protobuf.Duration period = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->period = $var; + + return $this; + } + + /** + * If it has been at least one `period` since the last load adjustment, the + * client should multiply the current load by this value to get the new target + * load. For example, if the current load is 100 and `factor` is 0.8, the new + * target load should be 80. After adjusting, the client should ignore + * `factor` until another `period` has passed. + * The client can measure its load using any unit that's comparable over time + * For example, QPS can be used as long as each request involves a similar + * amount of work. + * + * Generated from protobuf field double factor = 2; + * @return float + */ + public function getFactor() + { + return $this->factor; + } + + /** + * If it has been at least one `period` since the last load adjustment, the + * client should multiply the current load by this value to get the new target + * load. For example, if the current load is 100 and `factor` is 0.8, the new + * target load should be 80. After adjusting, the client should ignore + * `factor` until another `period` has passed. + * The client can measure its load using any unit that's comparable over time + * For example, QPS can be used as long as each request involves a similar + * amount of work. + * + * Generated from protobuf field double factor = 2; + * @param float $var + * @return $this + */ + public function setFactor($var) + { + GPBUtil::checkDouble($var); + $this->factor = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamRequest.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamRequest.php new file mode 100644 index 000000000000..cac57eea1345 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamRequest.php @@ -0,0 +1,412 @@ +google.bigtable.v2.ReadChangeStreamRequest + */ +class ReadChangeStreamRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the table from which to read a change stream. + * Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $table_name = ''; + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * + * Generated from protobuf field string app_profile_id = 2; + */ + protected $app_profile_id = ''; + /** + * The partition to read changes from. + * + * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 3; + */ + protected $partition = null; + /** + * If specified, OK will be returned when the stream advances beyond + * this time. Otherwise, changes will be continuously delivered on the stream. + * This value is inclusive and will be truncated to microsecond granularity. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; + */ + protected $end_time = null; + /** + * If specified, the duration between `Heartbeat` messages on the stream. + * Otherwise, defaults to 5 seconds. + * + * Generated from protobuf field .google.protobuf.Duration heartbeat_duration = 7; + */ + protected $heartbeat_duration = null; + protected $start_from; + + /** + * @param string $tableName Required. The unique name of the table from which to read a change stream. + * Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\V2\ReadChangeStreamRequest + * + * @experimental + */ + public static function build(string $tableName): self + { + return (new self()) + ->setTableName($tableName); + } + + /** + * @param string $tableName Required. The unique name of the table from which to read a change stream. + * Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $appProfileId This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * + * @return \Google\Cloud\Bigtable\V2\ReadChangeStreamRequest + * + * @experimental + */ + public static function buildFromTableNameAppProfileId(string $tableName, string $appProfileId): self + { + return (new self()) + ->setTableName($tableName) + ->setAppProfileId($appProfileId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * Required. The unique name of the table from which to read a change stream. + * Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * @type \Google\Cloud\Bigtable\V2\StreamPartition $partition + * The partition to read changes from. + * @type \Google\Protobuf\Timestamp $start_time + * Start reading the stream at the specified timestamp. This timestamp must + * be within the change stream retention period, less than or equal to the + * current time, and after change stream creation, whichever is greater. + * This value is inclusive and will be truncated to microsecond granularity. + * @type \Google\Cloud\Bigtable\V2\StreamContinuationTokens $continuation_tokens + * Tokens that describe how to resume reading a stream where reading + * previously left off. If specified, changes will be read starting at the + * the position. Tokens are delivered on the stream as part of `Heartbeat` + * and `CloseStream` messages. + * If a single token is provided, the token’s partition must exactly match + * the request’s partition. If multiple tokens are provided, as in the case + * of a partition merge, the union of the token partitions must exactly + * cover the request’s partition. Otherwise, INVALID_ARGUMENT will be + * returned. + * @type \Google\Protobuf\Timestamp $end_time + * If specified, OK will be returned when the stream advances beyond + * this time. Otherwise, changes will be continuously delivered on the stream. + * This value is inclusive and will be truncated to microsecond granularity. + * @type \Google\Protobuf\Duration $heartbeat_duration + * If specified, the duration between `Heartbeat` messages on the stream. + * Otherwise, defaults to 5 seconds. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the table from which to read a change stream. + * Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTableName() + { + return $this->table_name; + } + + /** + * Required. The unique name of the table from which to read a change stream. + * Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTableName($var) + { + GPBUtil::checkString($var, True); + $this->table_name = $var; + + return $this; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * + * Generated from protobuf field string app_profile_id = 2; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * + * Generated from protobuf field string app_profile_id = 2; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + + /** + * The partition to read changes from. + * + * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 3; + * @return \Google\Cloud\Bigtable\V2\StreamPartition|null + */ + public function getPartition() + { + return $this->partition; + } + + public function hasPartition() + { + return isset($this->partition); + } + + public function clearPartition() + { + unset($this->partition); + } + + /** + * The partition to read changes from. + * + * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 3; + * @param \Google\Cloud\Bigtable\V2\StreamPartition $var + * @return $this + */ + public function setPartition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\StreamPartition::class); + $this->partition = $var; + + return $this; + } + + /** + * Start reading the stream at the specified timestamp. This timestamp must + * be within the change stream retention period, less than or equal to the + * current time, and after change stream creation, whichever is greater. + * This value is inclusive and will be truncated to microsecond granularity. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->readOneof(4); + } + + public function hasStartTime() + { + return $this->hasOneof(4); + } + + /** + * Start reading the stream at the specified timestamp. This timestamp must + * be within the change stream retention period, less than or equal to the + * current time, and after change stream creation, whichever is greater. + * This value is inclusive and will be truncated to microsecond granularity. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Tokens that describe how to resume reading a stream where reading + * previously left off. If specified, changes will be read starting at the + * the position. Tokens are delivered on the stream as part of `Heartbeat` + * and `CloseStream` messages. + * If a single token is provided, the token’s partition must exactly match + * the request’s partition. If multiple tokens are provided, as in the case + * of a partition merge, the union of the token partitions must exactly + * cover the request’s partition. Otherwise, INVALID_ARGUMENT will be + * returned. + * + * Generated from protobuf field .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + * @return \Google\Cloud\Bigtable\V2\StreamContinuationTokens|null + */ + public function getContinuationTokens() + { + return $this->readOneof(6); + } + + public function hasContinuationTokens() + { + return $this->hasOneof(6); + } + + /** + * Tokens that describe how to resume reading a stream where reading + * previously left off. If specified, changes will be read starting at the + * the position. Tokens are delivered on the stream as part of `Heartbeat` + * and `CloseStream` messages. + * If a single token is provided, the token’s partition must exactly match + * the request’s partition. If multiple tokens are provided, as in the case + * of a partition merge, the union of the token partitions must exactly + * cover the request’s partition. Otherwise, INVALID_ARGUMENT will be + * returned. + * + * Generated from protobuf field .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + * @param \Google\Cloud\Bigtable\V2\StreamContinuationTokens $var + * @return $this + */ + public function setContinuationTokens($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\StreamContinuationTokens::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * If specified, OK will be returned when the stream advances beyond + * this time. Otherwise, changes will be continuously delivered on the stream. + * This value is inclusive and will be truncated to microsecond granularity. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * If specified, OK will be returned when the stream advances beyond + * this time. Otherwise, changes will be continuously delivered on the stream. + * This value is inclusive and will be truncated to microsecond granularity. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * If specified, the duration between `Heartbeat` messages on the stream. + * Otherwise, defaults to 5 seconds. + * + * Generated from protobuf field .google.protobuf.Duration heartbeat_duration = 7; + * @return \Google\Protobuf\Duration|null + */ + public function getHeartbeatDuration() + { + return $this->heartbeat_duration; + } + + public function hasHeartbeatDuration() + { + return isset($this->heartbeat_duration); + } + + public function clearHeartbeatDuration() + { + unset($this->heartbeat_duration); + } + + /** + * If specified, the duration between `Heartbeat` messages on the stream. + * Otherwise, defaults to 5 seconds. + * + * Generated from protobuf field .google.protobuf.Duration heartbeat_duration = 7; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setHeartbeatDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->heartbeat_duration = $var; + + return $this; + } + + /** + * @return string + */ + public function getStartFrom() + { + return $this->whichOneof("start_from"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse.php new file mode 100644 index 000000000000..bdacae25dce3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse.php @@ -0,0 +1,142 @@ +google.bigtable.v2.ReadChangeStreamResponse + */ +class ReadChangeStreamResponse extends \Google\Protobuf\Internal\Message +{ + protected $stream_record; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange $data_change + * A mutation to the partition. + * @type \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\Heartbeat $heartbeat + * A periodic heartbeat message. + * @type \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\CloseStream $close_stream + * An indication that the stream should be closed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * A mutation to the partition. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + * @return \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange|null + */ + public function getDataChange() + { + return $this->readOneof(1); + } + + public function hasDataChange() + { + return $this->hasOneof(1); + } + + /** + * A mutation to the partition. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + * @param \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange $var + * @return $this + */ + public function setDataChange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A periodic heartbeat message. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + * @return \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\Heartbeat|null + */ + public function getHeartbeat() + { + return $this->readOneof(2); + } + + public function hasHeartbeat() + { + return $this->hasOneof(2); + } + + /** + * A periodic heartbeat message. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + * @param \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\Heartbeat $var + * @return $this + */ + public function setHeartbeat($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\Heartbeat::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * An indication that the stream should be closed. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + * @return \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\CloseStream|null + */ + public function getCloseStream() + { + return $this->readOneof(3); + } + + public function hasCloseStream() + { + return $this->hasOneof(3); + } + + /** + * An indication that the stream should be closed. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + * @param \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\CloseStream $var + * @return $this + */ + public function setCloseStream($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\CloseStream::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getStreamRecord() + { + return $this->whichOneof("stream_record"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/CloseStream.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/CloseStream.php new file mode 100644 index 000000000000..4551bb34ed65 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/CloseStream.php @@ -0,0 +1,179 @@ +google.bigtable.v2.ReadChangeStreamResponse.CloseStream + */ +class CloseStream extends \Google\Protobuf\Internal\Message +{ + /** + * The status of the stream. + * + * Generated from protobuf field .google.rpc.Status status = 1; + */ + protected $status = null; + /** + * If non-empty, contains the information needed to resume reading their + * associated partitions. + * + * Generated from protobuf field repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + private $continuation_tokens; + /** + * If non-empty, contains the new partitions to start reading from, which + * are related to but not necessarily identical to the partitions for the + * above `continuation_tokens`. + * + * Generated from protobuf field repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + private $new_partitions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\Status $status + * The status of the stream. + * @type array<\Google\Cloud\Bigtable\V2\StreamContinuationToken>|\Google\Protobuf\Internal\RepeatedField $continuation_tokens + * If non-empty, contains the information needed to resume reading their + * associated partitions. + * @type array<\Google\Cloud\Bigtable\V2\StreamPartition>|\Google\Protobuf\Internal\RepeatedField $new_partitions + * If non-empty, contains the new partitions to start reading from, which + * are related to but not necessarily identical to the partitions for the + * above `continuation_tokens`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * The status of the stream. + * + * Generated from protobuf field .google.rpc.Status status = 1; + * @return \Google\Rpc\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * The status of the stream. + * + * Generated from protobuf field .google.rpc.Status status = 1; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + + /** + * If non-empty, contains the information needed to resume reading their + * associated partitions. + * + * Generated from protobuf field repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContinuationTokens() + { + return $this->continuation_tokens; + } + + /** + * If non-empty, contains the information needed to resume reading their + * associated partitions. + * + * Generated from protobuf field repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + * @param array<\Google\Cloud\Bigtable\V2\StreamContinuationToken>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContinuationTokens($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\StreamContinuationToken::class); + $this->continuation_tokens = $arr; + + return $this; + } + + /** + * If non-empty, contains the new partitions to start reading from, which + * are related to but not necessarily identical to the partitions for the + * above `continuation_tokens`. + * + * Generated from protobuf field repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNewPartitions() + { + return $this->new_partitions; + } + + /** + * If non-empty, contains the new partitions to start reading from, which + * are related to but not necessarily identical to the partitions for the + * above `continuation_tokens`. + * + * Generated from protobuf field repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + * @param array<\Google\Cloud\Bigtable\V2\StreamPartition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNewPartitions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\StreamPartition::class); + $this->new_partitions = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CloseStream::class, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_CloseStream::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/DataChange.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/DataChange.php new file mode 100644 index 000000000000..9bb24720fb1a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/DataChange.php @@ -0,0 +1,439 @@ +google.bigtable.v2.ReadChangeStreamResponse.DataChange + */ +class DataChange extends \Google\Protobuf\Internal\Message +{ + /** + * The type of the mutation. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + */ + protected $type = 0; + /** + * The cluster where the mutation was applied. + * Not set when `type` is `GARBAGE_COLLECTION`. + * + * Generated from protobuf field string source_cluster_id = 2; + */ + protected $source_cluster_id = ''; + /** + * The row key for all mutations that are part of this `DataChange`. + * If the `DataChange` is chunked across multiple messages, then this field + * will only be set for the first message. + * + * Generated from protobuf field bytes row_key = 3; + */ + protected $row_key = ''; + /** + * The timestamp at which the mutation was applied on the Bigtable server. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_timestamp = 4; + */ + protected $commit_timestamp = null; + /** + * A value that lets stream consumers reconstruct Bigtable's + * conflict resolution semantics. + * https://cloud.google.com/bigtable/docs/writes#conflict-resolution + * In the event that the same row key, column family, column qualifier, + * timestamp are modified on different clusters at the same + * `commit_timestamp`, the mutation with the larger `tiebreaker` will be the + * one chosen for the eventually consistent state of the system. + * + * Generated from protobuf field int32 tiebreaker = 5; + */ + protected $tiebreaker = 0; + /** + * The mutations associated with this change to the partition. + * May contain complete mutations or chunks of a multi-message chunked + * `DataChange` record. + * + * Generated from protobuf field repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + */ + private $chunks; + /** + * When true, indicates that the entire `DataChange` has been read + * and the client can safely process the message. + * + * Generated from protobuf field bool done = 8; + */ + protected $done = false; + /** + * An encoded position for this stream's partition to restart reading from. + * This token is for the StreamPartition from the request. + * + * Generated from protobuf field string token = 9; + */ + protected $token = ''; + /** + * An estimate of the commit timestamp that is usually lower than or equal + * to any timestamp for a record that will be delivered in the future on the + * stream. It is possible that, under particular circumstances that a future + * record has a timestamp is is lower than a previously seen timestamp. For + * an example usage see + * https://beam.apache.org/documentation/basics/#watermarks + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_low_watermark = 10; + */ + protected $estimated_low_watermark = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The type of the mutation. + * @type string $source_cluster_id + * The cluster where the mutation was applied. + * Not set when `type` is `GARBAGE_COLLECTION`. + * @type string $row_key + * The row key for all mutations that are part of this `DataChange`. + * If the `DataChange` is chunked across multiple messages, then this field + * will only be set for the first message. + * @type \Google\Protobuf\Timestamp $commit_timestamp + * The timestamp at which the mutation was applied on the Bigtable server. + * @type int $tiebreaker + * A value that lets stream consumers reconstruct Bigtable's + * conflict resolution semantics. + * https://cloud.google.com/bigtable/docs/writes#conflict-resolution + * In the event that the same row key, column family, column qualifier, + * timestamp are modified on different clusters at the same + * `commit_timestamp`, the mutation with the larger `tiebreaker` will be the + * one chosen for the eventually consistent state of the system. + * @type array<\Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk>|\Google\Protobuf\Internal\RepeatedField $chunks + * The mutations associated with this change to the partition. + * May contain complete mutations or chunks of a multi-message chunked + * `DataChange` record. + * @type bool $done + * When true, indicates that the entire `DataChange` has been read + * and the client can safely process the message. + * @type string $token + * An encoded position for this stream's partition to restart reading from. + * This token is for the StreamPartition from the request. + * @type \Google\Protobuf\Timestamp $estimated_low_watermark + * An estimate of the commit timestamp that is usually lower than or equal + * to any timestamp for a record that will be delivered in the future on the + * stream. It is possible that, under particular circumstances that a future + * record has a timestamp is is lower than a previously seen timestamp. For + * an example usage see + * https://beam.apache.org/documentation/basics/#watermarks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * The type of the mutation. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the mutation. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange\Type::class); + $this->type = $var; + + return $this; + } + + /** + * The cluster where the mutation was applied. + * Not set when `type` is `GARBAGE_COLLECTION`. + * + * Generated from protobuf field string source_cluster_id = 2; + * @return string + */ + public function getSourceClusterId() + { + return $this->source_cluster_id; + } + + /** + * The cluster where the mutation was applied. + * Not set when `type` is `GARBAGE_COLLECTION`. + * + * Generated from protobuf field string source_cluster_id = 2; + * @param string $var + * @return $this + */ + public function setSourceClusterId($var) + { + GPBUtil::checkString($var, True); + $this->source_cluster_id = $var; + + return $this; + } + + /** + * The row key for all mutations that are part of this `DataChange`. + * If the `DataChange` is chunked across multiple messages, then this field + * will only be set for the first message. + * + * Generated from protobuf field bytes row_key = 3; + * @return string + */ + public function getRowKey() + { + return $this->row_key; + } + + /** + * The row key for all mutations that are part of this `DataChange`. + * If the `DataChange` is chunked across multiple messages, then this field + * will only be set for the first message. + * + * Generated from protobuf field bytes row_key = 3; + * @param string $var + * @return $this + */ + public function setRowKey($var) + { + GPBUtil::checkString($var, False); + $this->row_key = $var; + + return $this; + } + + /** + * The timestamp at which the mutation was applied on the Bigtable server. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_timestamp = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCommitTimestamp() + { + return $this->commit_timestamp; + } + + public function hasCommitTimestamp() + { + return isset($this->commit_timestamp); + } + + public function clearCommitTimestamp() + { + unset($this->commit_timestamp); + } + + /** + * The timestamp at which the mutation was applied on the Bigtable server. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_timestamp = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCommitTimestamp($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->commit_timestamp = $var; + + return $this; + } + + /** + * A value that lets stream consumers reconstruct Bigtable's + * conflict resolution semantics. + * https://cloud.google.com/bigtable/docs/writes#conflict-resolution + * In the event that the same row key, column family, column qualifier, + * timestamp are modified on different clusters at the same + * `commit_timestamp`, the mutation with the larger `tiebreaker` will be the + * one chosen for the eventually consistent state of the system. + * + * Generated from protobuf field int32 tiebreaker = 5; + * @return int + */ + public function getTiebreaker() + { + return $this->tiebreaker; + } + + /** + * A value that lets stream consumers reconstruct Bigtable's + * conflict resolution semantics. + * https://cloud.google.com/bigtable/docs/writes#conflict-resolution + * In the event that the same row key, column family, column qualifier, + * timestamp are modified on different clusters at the same + * `commit_timestamp`, the mutation with the larger `tiebreaker` will be the + * one chosen for the eventually consistent state of the system. + * + * Generated from protobuf field int32 tiebreaker = 5; + * @param int $var + * @return $this + */ + public function setTiebreaker($var) + { + GPBUtil::checkInt32($var); + $this->tiebreaker = $var; + + return $this; + } + + /** + * The mutations associated with this change to the partition. + * May contain complete mutations or chunks of a multi-message chunked + * `DataChange` record. + * + * Generated from protobuf field repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChunks() + { + return $this->chunks; + } + + /** + * The mutations associated with this change to the partition. + * May contain complete mutations or chunks of a multi-message chunked + * `DataChange` record. + * + * Generated from protobuf field repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * @param array<\Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChunks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk::class); + $this->chunks = $arr; + + return $this; + } + + /** + * When true, indicates that the entire `DataChange` has been read + * and the client can safely process the message. + * + * Generated from protobuf field bool done = 8; + * @return bool + */ + public function getDone() + { + return $this->done; + } + + /** + * When true, indicates that the entire `DataChange` has been read + * and the client can safely process the message. + * + * Generated from protobuf field bool done = 8; + * @param bool $var + * @return $this + */ + public function setDone($var) + { + GPBUtil::checkBool($var); + $this->done = $var; + + return $this; + } + + /** + * An encoded position for this stream's partition to restart reading from. + * This token is for the StreamPartition from the request. + * + * Generated from protobuf field string token = 9; + * @return string + */ + public function getToken() + { + return $this->token; + } + + /** + * An encoded position for this stream's partition to restart reading from. + * This token is for the StreamPartition from the request. + * + * Generated from protobuf field string token = 9; + * @param string $var + * @return $this + */ + public function setToken($var) + { + GPBUtil::checkString($var, True); + $this->token = $var; + + return $this; + } + + /** + * An estimate of the commit timestamp that is usually lower than or equal + * to any timestamp for a record that will be delivered in the future on the + * stream. It is possible that, under particular circumstances that a future + * record has a timestamp is is lower than a previously seen timestamp. For + * an example usage see + * https://beam.apache.org/documentation/basics/#watermarks + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_low_watermark = 10; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEstimatedLowWatermark() + { + return $this->estimated_low_watermark; + } + + public function hasEstimatedLowWatermark() + { + return isset($this->estimated_low_watermark); + } + + public function clearEstimatedLowWatermark() + { + unset($this->estimated_low_watermark); + } + + /** + * An estimate of the commit timestamp that is usually lower than or equal + * to any timestamp for a record that will be delivered in the future on the + * stream. It is possible that, under particular circumstances that a future + * record has a timestamp is is lower than a previously seen timestamp. For + * an example usage see + * https://beam.apache.org/documentation/basics/#watermarks + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_low_watermark = 10; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEstimatedLowWatermark($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->estimated_low_watermark = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DataChange::class, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_DataChange::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/DataChange/Type.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/DataChange/Type.php new file mode 100644 index 000000000000..0eb4b8204f45 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/DataChange/Type.php @@ -0,0 +1,72 @@ +google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type + */ +class Type +{ + /** + * The type is unspecified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * A user-initiated mutation. + * + * Generated from protobuf enum USER = 1; + */ + const USER = 1; + /** + * A system-initiated mutation as part of garbage collection. + * https://cloud.google.com/bigtable/docs/garbage-collection + * + * Generated from protobuf enum GARBAGE_COLLECTION = 2; + */ + const GARBAGE_COLLECTION = 2; + /** + * This is a continuation of a multi-message change. + * + * Generated from protobuf enum CONTINUATION = 3; + */ + const CONTINUATION = 3; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::USER => 'USER', + self::GARBAGE_COLLECTION => 'GARBAGE_COLLECTION', + self::CONTINUATION => 'CONTINUATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_DataChange_Type::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/Heartbeat.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/Heartbeat.php new file mode 100644 index 000000000000..e20a2f711230 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/Heartbeat.php @@ -0,0 +1,149 @@ +google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + */ +class Heartbeat extends \Google\Protobuf\Internal\Message +{ + /** + * A token that can be provided to a subsequent `ReadChangeStream` call + * to pick up reading at the current stream position. + * + * Generated from protobuf field .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + */ + protected $continuation_token = null; + /** + * An estimate of the commit timestamp that is usually lower than or equal + * to any timestamp for a record that will be delivered in the future on the + * stream. It is possible that, under particular circumstances that a future + * record has a timestamp is is lower than a previously seen timestamp. For + * an example usage see + * https://beam.apache.org/documentation/basics/#watermarks + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_low_watermark = 2; + */ + protected $estimated_low_watermark = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\StreamContinuationToken $continuation_token + * A token that can be provided to a subsequent `ReadChangeStream` call + * to pick up reading at the current stream position. + * @type \Google\Protobuf\Timestamp $estimated_low_watermark + * An estimate of the commit timestamp that is usually lower than or equal + * to any timestamp for a record that will be delivered in the future on the + * stream. It is possible that, under particular circumstances that a future + * record has a timestamp is is lower than a previously seen timestamp. For + * an example usage see + * https://beam.apache.org/documentation/basics/#watermarks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * A token that can be provided to a subsequent `ReadChangeStream` call + * to pick up reading at the current stream position. + * + * Generated from protobuf field .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + * @return \Google\Cloud\Bigtable\V2\StreamContinuationToken|null + */ + public function getContinuationToken() + { + return $this->continuation_token; + } + + public function hasContinuationToken() + { + return isset($this->continuation_token); + } + + public function clearContinuationToken() + { + unset($this->continuation_token); + } + + /** + * A token that can be provided to a subsequent `ReadChangeStream` call + * to pick up reading at the current stream position. + * + * Generated from protobuf field .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + * @param \Google\Cloud\Bigtable\V2\StreamContinuationToken $var + * @return $this + */ + public function setContinuationToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\StreamContinuationToken::class); + $this->continuation_token = $var; + + return $this; + } + + /** + * An estimate of the commit timestamp that is usually lower than or equal + * to any timestamp for a record that will be delivered in the future on the + * stream. It is possible that, under particular circumstances that a future + * record has a timestamp is is lower than a previously seen timestamp. For + * an example usage see + * https://beam.apache.org/documentation/basics/#watermarks + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_low_watermark = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEstimatedLowWatermark() + { + return $this->estimated_low_watermark; + } + + public function hasEstimatedLowWatermark() + { + return isset($this->estimated_low_watermark); + } + + public function clearEstimatedLowWatermark() + { + unset($this->estimated_low_watermark); + } + + /** + * An estimate of the commit timestamp that is usually lower than or equal + * to any timestamp for a record that will be delivered in the future on the + * stream. It is possible that, under particular circumstances that a future + * record has a timestamp is is lower than a previously seen timestamp. For + * an example usage see + * https://beam.apache.org/documentation/basics/#watermarks + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_low_watermark = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEstimatedLowWatermark($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->estimated_low_watermark = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Heartbeat::class, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_Heartbeat::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/MutationChunk.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/MutationChunk.php new file mode 100644 index 000000000000..861921c6235d --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/MutationChunk.php @@ -0,0 +1,136 @@ +google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + */ +class MutationChunk extends \Google\Protobuf\Internal\Message +{ + /** + * If set, then the mutation is a `SetCell` with a chunked value across + * multiple messages. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + */ + protected $chunk_info = null; + /** + * If this is a continuation of a chunked message (`chunked_value_offset` > + * 0), ignore all fields except the `SetCell`'s value and merge it with + * the previous message by concatenating the value fields. + * + * Generated from protobuf field .google.bigtable.v2.Mutation mutation = 2; + */ + protected $mutation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk\ChunkInfo $chunk_info + * If set, then the mutation is a `SetCell` with a chunked value across + * multiple messages. + * @type \Google\Cloud\Bigtable\V2\Mutation $mutation + * If this is a continuation of a chunked message (`chunked_value_offset` > + * 0), ignore all fields except the `SetCell`'s value and merge it with + * the previous message by concatenating the value fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * If set, then the mutation is a `SetCell` with a chunked value across + * multiple messages. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * @return \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk\ChunkInfo|null + */ + public function getChunkInfo() + { + return $this->chunk_info; + } + + public function hasChunkInfo() + { + return isset($this->chunk_info); + } + + public function clearChunkInfo() + { + unset($this->chunk_info); + } + + /** + * If set, then the mutation is a `SetCell` with a chunked value across + * multiple messages. + * + * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * @param \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk\ChunkInfo $var + * @return $this + */ + public function setChunkInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk\ChunkInfo::class); + $this->chunk_info = $var; + + return $this; + } + + /** + * If this is a continuation of a chunked message (`chunked_value_offset` > + * 0), ignore all fields except the `SetCell`'s value and merge it with + * the previous message by concatenating the value fields. + * + * Generated from protobuf field .google.bigtable.v2.Mutation mutation = 2; + * @return \Google\Cloud\Bigtable\V2\Mutation|null + */ + public function getMutation() + { + return $this->mutation; + } + + public function hasMutation() + { + return isset($this->mutation); + } + + public function clearMutation() + { + unset($this->mutation); + } + + /** + * If this is a continuation of a chunked message (`chunked_value_offset` > + * 0), ignore all fields except the `SetCell`'s value and merge it with + * the previous message by concatenating the value fields. + * + * Generated from protobuf field .google.bigtable.v2.Mutation mutation = 2; + * @param \Google\Cloud\Bigtable\V2\Mutation $var + * @return $this + */ + public function setMutation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation::class); + $this->mutation = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MutationChunk::class, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_MutationChunk::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/MutationChunk/ChunkInfo.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/MutationChunk/ChunkInfo.php new file mode 100644 index 000000000000..f8a6c673c8bf --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadChangeStreamResponse/MutationChunk/ChunkInfo.php @@ -0,0 +1,144 @@ +google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + */ +class ChunkInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The total value size of all the chunks that make up the `SetCell`. + * + * Generated from protobuf field int32 chunked_value_size = 1; + */ + protected $chunked_value_size = 0; + /** + * The byte offset of this chunk into the total value size of the + * mutation. + * + * Generated from protobuf field int32 chunked_value_offset = 2; + */ + protected $chunked_value_offset = 0; + /** + * When true, this is the last chunk of a chunked `SetCell`. + * + * Generated from protobuf field bool last_chunk = 3; + */ + protected $last_chunk = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $chunked_value_size + * The total value size of all the chunks that make up the `SetCell`. + * @type int $chunked_value_offset + * The byte offset of this chunk into the total value size of the + * mutation. + * @type bool $last_chunk + * When true, this is the last chunk of a chunked `SetCell`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * The total value size of all the chunks that make up the `SetCell`. + * + * Generated from protobuf field int32 chunked_value_size = 1; + * @return int + */ + public function getChunkedValueSize() + { + return $this->chunked_value_size; + } + + /** + * The total value size of all the chunks that make up the `SetCell`. + * + * Generated from protobuf field int32 chunked_value_size = 1; + * @param int $var + * @return $this + */ + public function setChunkedValueSize($var) + { + GPBUtil::checkInt32($var); + $this->chunked_value_size = $var; + + return $this; + } + + /** + * The byte offset of this chunk into the total value size of the + * mutation. + * + * Generated from protobuf field int32 chunked_value_offset = 2; + * @return int + */ + public function getChunkedValueOffset() + { + return $this->chunked_value_offset; + } + + /** + * The byte offset of this chunk into the total value size of the + * mutation. + * + * Generated from protobuf field int32 chunked_value_offset = 2; + * @param int $var + * @return $this + */ + public function setChunkedValueOffset($var) + { + GPBUtil::checkInt32($var); + $this->chunked_value_offset = $var; + + return $this; + } + + /** + * When true, this is the last chunk of a chunked `SetCell`. + * + * Generated from protobuf field bool last_chunk = 3; + * @return bool + */ + public function getLastChunk() + { + return $this->last_chunk; + } + + /** + * When true, this is the last chunk of a chunked `SetCell`. + * + * Generated from protobuf field bool last_chunk = 3; + * @param bool $var + * @return $this + */ + public function setLastChunk($var) + { + GPBUtil::checkBool($var); + $this->last_chunk = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ChunkInfo::class, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_MutationChunk_ChunkInfo::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadIterationStats.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadIterationStats.php new file mode 100644 index 000000000000..f226aa85abc9 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadIterationStats.php @@ -0,0 +1,179 @@ +google.bigtable.v2.ReadIterationStats + */ +class ReadIterationStats extends \Google\Protobuf\Internal\Message +{ + /** + * The rows seen (scanned) as part of the request. This includes the count of + * rows returned, as captured below. + * + * Generated from protobuf field int64 rows_seen_count = 1; + */ + protected $rows_seen_count = 0; + /** + * The rows returned as part of the request. + * + * Generated from protobuf field int64 rows_returned_count = 2; + */ + protected $rows_returned_count = 0; + /** + * The cells seen (scanned) as part of the request. This includes the count of + * cells returned, as captured below. + * + * Generated from protobuf field int64 cells_seen_count = 3; + */ + protected $cells_seen_count = 0; + /** + * The cells returned as part of the request. + * + * Generated from protobuf field int64 cells_returned_count = 4; + */ + protected $cells_returned_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $rows_seen_count + * The rows seen (scanned) as part of the request. This includes the count of + * rows returned, as captured below. + * @type int|string $rows_returned_count + * The rows returned as part of the request. + * @type int|string $cells_seen_count + * The cells seen (scanned) as part of the request. This includes the count of + * cells returned, as captured below. + * @type int|string $cells_returned_count + * The cells returned as part of the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\RequestStats::initOnce(); + parent::__construct($data); + } + + /** + * The rows seen (scanned) as part of the request. This includes the count of + * rows returned, as captured below. + * + * Generated from protobuf field int64 rows_seen_count = 1; + * @return int|string + */ + public function getRowsSeenCount() + { + return $this->rows_seen_count; + } + + /** + * The rows seen (scanned) as part of the request. This includes the count of + * rows returned, as captured below. + * + * Generated from protobuf field int64 rows_seen_count = 1; + * @param int|string $var + * @return $this + */ + public function setRowsSeenCount($var) + { + GPBUtil::checkInt64($var); + $this->rows_seen_count = $var; + + return $this; + } + + /** + * The rows returned as part of the request. + * + * Generated from protobuf field int64 rows_returned_count = 2; + * @return int|string + */ + public function getRowsReturnedCount() + { + return $this->rows_returned_count; + } + + /** + * The rows returned as part of the request. + * + * Generated from protobuf field int64 rows_returned_count = 2; + * @param int|string $var + * @return $this + */ + public function setRowsReturnedCount($var) + { + GPBUtil::checkInt64($var); + $this->rows_returned_count = $var; + + return $this; + } + + /** + * The cells seen (scanned) as part of the request. This includes the count of + * cells returned, as captured below. + * + * Generated from protobuf field int64 cells_seen_count = 3; + * @return int|string + */ + public function getCellsSeenCount() + { + return $this->cells_seen_count; + } + + /** + * The cells seen (scanned) as part of the request. This includes the count of + * cells returned, as captured below. + * + * Generated from protobuf field int64 cells_seen_count = 3; + * @param int|string $var + * @return $this + */ + public function setCellsSeenCount($var) + { + GPBUtil::checkInt64($var); + $this->cells_seen_count = $var; + + return $this; + } + + /** + * The cells returned as part of the request. + * + * Generated from protobuf field int64 cells_returned_count = 4; + * @return int|string + */ + public function getCellsReturnedCount() + { + return $this->cells_returned_count; + } + + /** + * The cells returned as part of the request. + * + * Generated from protobuf field int64 cells_returned_count = 4; + * @param int|string $var + * @return $this + */ + public function setCellsReturnedCount($var) + { + GPBUtil::checkInt64($var); + $this->cells_returned_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadModifyWriteRowRequest.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadModifyWriteRowRequest.php new file mode 100644 index 000000000000..ab877a010aab --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadModifyWriteRowRequest.php @@ -0,0 +1,296 @@ +google.bigtable.v2.ReadModifyWriteRowRequest + */ +class ReadModifyWriteRowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique name of the table to which the read/modify/write rules + * should be applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $table_name = ''; + /** + * Optional. The unique name of the AuthorizedView to which the + * read/modify/write rules should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $authorized_view_name = ''; + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 4; + */ + protected $app_profile_id = ''; + /** + * Required. The key of the row to which the read/modify/write rules should be + * applied. + * + * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $row_key = ''; + /** + * Required. Rules specifying how the specified row's contents are to be + * transformed into writes. Entries are applied in order, meaning that earlier + * rules will affect the results of later ones. + * + * Generated from protobuf field repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $rules; + + /** + * @param string $tableName Optional. The unique name of the table to which the read/modify/write rules + * should be applied. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $rowKey Required. The key of the row to which the read/modify/write rules should be + * applied. + * @param \Google\Cloud\Bigtable\V2\ReadModifyWriteRule[] $rules Required. Rules specifying how the specified row's contents are to be + * transformed into writes. Entries are applied in order, meaning that earlier + * rules will affect the results of later ones. + * + * @return \Google\Cloud\Bigtable\V2\ReadModifyWriteRowRequest + * + * @experimental + */ + public static function build(string $tableName, string $rowKey, array $rules): self + { + return (new self()) + ->setTableName($tableName) + ->setRowKey($rowKey) + ->setRules($rules); + } + + /** + * @param string $tableName Optional. The unique name of the table to which the read/modify/write rules + * should be applied. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $rowKey Required. The key of the row to which the read/modify/write rules should be + * applied. + * @param \Google\Cloud\Bigtable\V2\ReadModifyWriteRule[] $rules Required. Rules specifying how the specified row's contents are to be + * transformed into writes. Entries are applied in order, meaning that earlier + * rules will affect the results of later ones. + * @param string $appProfileId This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * @return \Google\Cloud\Bigtable\V2\ReadModifyWriteRowRequest + * + * @experimental + */ + public static function buildFromTableNameRowKeyRulesAppProfileId(string $tableName, string $rowKey, array $rules, string $appProfileId): self + { + return (new self()) + ->setTableName($tableName) + ->setRowKey($rowKey) + ->setRules($rules) + ->setAppProfileId($appProfileId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * Optional. The unique name of the table to which the read/modify/write rules + * should be applied. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $authorized_view_name + * Optional. The unique name of the AuthorizedView to which the + * read/modify/write rules should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @type string $row_key + * Required. The key of the row to which the read/modify/write rules should be + * applied. + * @type array<\Google\Cloud\Bigtable\V2\ReadModifyWriteRule>|\Google\Protobuf\Internal\RepeatedField $rules + * Required. Rules specifying how the specified row's contents are to be + * transformed into writes. Entries are applied in order, meaning that earlier + * rules will affect the results of later ones. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique name of the table to which the read/modify/write rules + * should be applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getTableName() + { + return $this->table_name; + } + + /** + * Optional. The unique name of the table to which the read/modify/write rules + * should be applied. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTableName($var) + { + GPBUtil::checkString($var, True); + $this->table_name = $var; + + return $this; + } + + /** + * Optional. The unique name of the AuthorizedView to which the + * read/modify/write rules should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAuthorizedViewName() + { + return $this->authorized_view_name; + } + + /** + * Optional. The unique name of the AuthorizedView to which the + * read/modify/write rules should be applied. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAuthorizedViewName($var) + { + GPBUtil::checkString($var, True); + $this->authorized_view_name = $var; + + return $this; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 4; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 4; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + + /** + * Required. The key of the row to which the read/modify/write rules should be + * applied. + * + * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRowKey() + { + return $this->row_key; + } + + /** + * Required. The key of the row to which the read/modify/write rules should be + * applied. + * + * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRowKey($var) + { + GPBUtil::checkString($var, False); + $this->row_key = $var; + + return $this; + } + + /** + * Required. Rules specifying how the specified row's contents are to be + * transformed into writes. Entries are applied in order, meaning that earlier + * rules will affect the results of later ones. + * + * Generated from protobuf field repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * Required. Rules specifying how the specified row's contents are to be + * transformed into writes. Entries are applied in order, meaning that earlier + * rules will affect the results of later ones. + * + * Generated from protobuf field repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Bigtable\V2\ReadModifyWriteRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\ReadModifyWriteRule::class); + $this->rules = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadModifyWriteRowResponse.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadModifyWriteRowResponse.php new file mode 100644 index 000000000000..1b1c1cdac4a9 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadModifyWriteRowResponse.php @@ -0,0 +1,77 @@ +google.bigtable.v2.ReadModifyWriteRowResponse + */ +class ReadModifyWriteRowResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A Row containing the new contents of all cells modified by the request. + * + * Generated from protobuf field .google.bigtable.v2.Row row = 1; + */ + protected $row = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Row $row + * A Row containing the new contents of all cells modified by the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * A Row containing the new contents of all cells modified by the request. + * + * Generated from protobuf field .google.bigtable.v2.Row row = 1; + * @return \Google\Cloud\Bigtable\V2\Row|null + */ + public function getRow() + { + return $this->row; + } + + public function hasRow() + { + return isset($this->row); + } + + public function clearRow() + { + unset($this->row); + } + + /** + * A Row containing the new contents of all cells modified by the request. + * + * Generated from protobuf field .google.bigtable.v2.Row row = 1; + * @param \Google\Cloud\Bigtable\V2\Row $var + * @return $this + */ + public function setRow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Row::class); + $this->row = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadModifyWriteRule.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadModifyWriteRule.php new file mode 100644 index 000000000000..1afafb1f597a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadModifyWriteRule.php @@ -0,0 +1,204 @@ +google.bigtable.v2.ReadModifyWriteRule + */ +class ReadModifyWriteRule extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the family to which the read/modify/write should be applied. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + */ + protected $family_name = ''; + /** + * The qualifier of the column to which the read/modify/write should be + * applied. + * Can be any byte string, including the empty string. + * + * Generated from protobuf field bytes column_qualifier = 2; + */ + protected $column_qualifier = ''; + protected $rule; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the family to which the read/modify/write should be applied. + * Must match `[-_.a-zA-Z0-9]+` + * @type string $column_qualifier + * The qualifier of the column to which the read/modify/write should be + * applied. + * Can be any byte string, including the empty string. + * @type string $append_value + * Rule specifying that `append_value` be appended to the existing value. + * If the targeted cell is unset, it will be treated as containing the + * empty string. + * @type int|string $increment_amount + * Rule specifying that `increment_amount` be added to the existing value. + * If the targeted cell is unset, it will be treated as containing a zero. + * Otherwise, the targeted cell must contain an 8-byte value (interpreted + * as a 64-bit big-endian signed integer), or the entire request will fail. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the family to which the read/modify/write should be applied. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * The name of the family to which the read/modify/write should be applied. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + + /** + * The qualifier of the column to which the read/modify/write should be + * applied. + * Can be any byte string, including the empty string. + * + * Generated from protobuf field bytes column_qualifier = 2; + * @return string + */ + public function getColumnQualifier() + { + return $this->column_qualifier; + } + + /** + * The qualifier of the column to which the read/modify/write should be + * applied. + * Can be any byte string, including the empty string. + * + * Generated from protobuf field bytes column_qualifier = 2; + * @param string $var + * @return $this + */ + public function setColumnQualifier($var) + { + GPBUtil::checkString($var, False); + $this->column_qualifier = $var; + + return $this; + } + + /** + * Rule specifying that `append_value` be appended to the existing value. + * If the targeted cell is unset, it will be treated as containing the + * empty string. + * + * Generated from protobuf field bytes append_value = 3; + * @return string + */ + public function getAppendValue() + { + return $this->readOneof(3); + } + + public function hasAppendValue() + { + return $this->hasOneof(3); + } + + /** + * Rule specifying that `append_value` be appended to the existing value. + * If the targeted cell is unset, it will be treated as containing the + * empty string. + * + * Generated from protobuf field bytes append_value = 3; + * @param string $var + * @return $this + */ + public function setAppendValue($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Rule specifying that `increment_amount` be added to the existing value. + * If the targeted cell is unset, it will be treated as containing a zero. + * Otherwise, the targeted cell must contain an 8-byte value (interpreted + * as a 64-bit big-endian signed integer), or the entire request will fail. + * + * Generated from protobuf field int64 increment_amount = 4; + * @return int|string + */ + public function getIncrementAmount() + { + return $this->readOneof(4); + } + + public function hasIncrementAmount() + { + return $this->hasOneof(4); + } + + /** + * Rule specifying that `increment_amount` be added to the existing value. + * If the targeted cell is unset, it will be treated as containing a zero. + * Otherwise, the targeted cell must contain an 8-byte value (interpreted + * as a 64-bit big-endian signed integer), or the entire request will fail. + * + * Generated from protobuf field int64 increment_amount = 4; + * @param int|string $var + * @return $this + */ + public function setIncrementAmount($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getRule() + { + return $this->whichOneof("rule"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsRequest.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsRequest.php new file mode 100644 index 000000000000..d8401d3e4c46 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsRequest.php @@ -0,0 +1,426 @@ +google.bigtable.v2.ReadRowsRequest + */ +class ReadRowsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique name of the table from which to read. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $table_name = ''; + /** + * Optional. The unique name of the AuthorizedView from which to read. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $authorized_view_name = ''; + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 5; + */ + protected $app_profile_id = ''; + /** + * The row keys and/or ranges to read sequentially. If not specified, reads + * from all rows. + * + * Generated from protobuf field .google.bigtable.v2.RowSet rows = 2; + */ + protected $rows = null; + /** + * The filter to apply to the contents of the specified row(s). If unset, + * reads the entirety of each row. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter filter = 3; + */ + protected $filter = null; + /** + * The read will stop after committing to N rows' worth of results. The + * default (zero) is to return all results. + * + * Generated from protobuf field int64 rows_limit = 4; + */ + protected $rows_limit = 0; + /** + * The view into RequestStats, as described above. + * + * Generated from protobuf field .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + */ + protected $request_stats_view = 0; + /** + * Experimental API - Please note that this API is currently experimental + * and can change in the future. + * Return rows in lexiographical descending order of the row keys. The row + * contents will not be affected by this flag. + * Example result set: + * [ + * {key: "k2", "f:col1": "v1", "f:col2": "v1"}, + * {key: "k1", "f:col1": "v2", "f:col2": "v2"} + * ] + * + * Generated from protobuf field bool reversed = 7; + */ + protected $reversed = false; + + /** + * @param string $tableName Optional. The unique name of the table from which to read. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\V2\ReadRowsRequest + * + * @experimental + */ + public static function build(string $tableName): self + { + return (new self()) + ->setTableName($tableName); + } + + /** + * @param string $tableName Optional. The unique name of the table from which to read. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $appProfileId This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * @return \Google\Cloud\Bigtable\V2\ReadRowsRequest + * + * @experimental + */ + public static function buildFromTableNameAppProfileId(string $tableName, string $appProfileId): self + { + return (new self()) + ->setTableName($tableName) + ->setAppProfileId($appProfileId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * Optional. The unique name of the table from which to read. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $authorized_view_name + * Optional. The unique name of the AuthorizedView from which to read. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @type \Google\Cloud\Bigtable\V2\RowSet $rows + * The row keys and/or ranges to read sequentially. If not specified, reads + * from all rows. + * @type \Google\Cloud\Bigtable\V2\RowFilter $filter + * The filter to apply to the contents of the specified row(s). If unset, + * reads the entirety of each row. + * @type int|string $rows_limit + * The read will stop after committing to N rows' worth of results. The + * default (zero) is to return all results. + * @type int $request_stats_view + * The view into RequestStats, as described above. + * @type bool $reversed + * Experimental API - Please note that this API is currently experimental + * and can change in the future. + * Return rows in lexiographical descending order of the row keys. The row + * contents will not be affected by this flag. + * Example result set: + * [ + * {key: "k2", "f:col1": "v1", "f:col2": "v1"}, + * {key: "k1", "f:col1": "v2", "f:col2": "v2"} + * ] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique name of the table from which to read. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getTableName() + { + return $this->table_name; + } + + /** + * Optional. The unique name of the table from which to read. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTableName($var) + { + GPBUtil::checkString($var, True); + $this->table_name = $var; + + return $this; + } + + /** + * Optional. The unique name of the AuthorizedView from which to read. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAuthorizedViewName() + { + return $this->authorized_view_name; + } + + /** + * Optional. The unique name of the AuthorizedView from which to read. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAuthorizedViewName($var) + { + GPBUtil::checkString($var, True); + $this->authorized_view_name = $var; + + return $this; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 5; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 5; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + + /** + * The row keys and/or ranges to read sequentially. If not specified, reads + * from all rows. + * + * Generated from protobuf field .google.bigtable.v2.RowSet rows = 2; + * @return \Google\Cloud\Bigtable\V2\RowSet|null + */ + public function getRows() + { + return $this->rows; + } + + public function hasRows() + { + return isset($this->rows); + } + + public function clearRows() + { + unset($this->rows); + } + + /** + * The row keys and/or ranges to read sequentially. If not specified, reads + * from all rows. + * + * Generated from protobuf field .google.bigtable.v2.RowSet rows = 2; + * @param \Google\Cloud\Bigtable\V2\RowSet $var + * @return $this + */ + public function setRows($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowSet::class); + $this->rows = $var; + + return $this; + } + + /** + * The filter to apply to the contents of the specified row(s). If unset, + * reads the entirety of each row. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter filter = 3; + * @return \Google\Cloud\Bigtable\V2\RowFilter|null + */ + public function getFilter() + { + return $this->filter; + } + + public function hasFilter() + { + return isset($this->filter); + } + + public function clearFilter() + { + unset($this->filter); + } + + /** + * The filter to apply to the contents of the specified row(s). If unset, + * reads the entirety of each row. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter filter = 3; + * @param \Google\Cloud\Bigtable\V2\RowFilter $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->filter = $var; + + return $this; + } + + /** + * The read will stop after committing to N rows' worth of results. The + * default (zero) is to return all results. + * + * Generated from protobuf field int64 rows_limit = 4; + * @return int|string + */ + public function getRowsLimit() + { + return $this->rows_limit; + } + + /** + * The read will stop after committing to N rows' worth of results. The + * default (zero) is to return all results. + * + * Generated from protobuf field int64 rows_limit = 4; + * @param int|string $var + * @return $this + */ + public function setRowsLimit($var) + { + GPBUtil::checkInt64($var); + $this->rows_limit = $var; + + return $this; + } + + /** + * The view into RequestStats, as described above. + * + * Generated from protobuf field .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * @return int + */ + public function getRequestStatsView() + { + return $this->request_stats_view; + } + + /** + * The view into RequestStats, as described above. + * + * Generated from protobuf field .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * @param int $var + * @return $this + */ + public function setRequestStatsView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\V2\ReadRowsRequest\RequestStatsView::class); + $this->request_stats_view = $var; + + return $this; + } + + /** + * Experimental API - Please note that this API is currently experimental + * and can change in the future. + * Return rows in lexiographical descending order of the row keys. The row + * contents will not be affected by this flag. + * Example result set: + * [ + * {key: "k2", "f:col1": "v1", "f:col2": "v1"}, + * {key: "k1", "f:col1": "v2", "f:col2": "v2"} + * ] + * + * Generated from protobuf field bool reversed = 7; + * @return bool + */ + public function getReversed() + { + return $this->reversed; + } + + /** + * Experimental API - Please note that this API is currently experimental + * and can change in the future. + * Return rows in lexiographical descending order of the row keys. The row + * contents will not be affected by this flag. + * Example result set: + * [ + * {key: "k2", "f:col1": "v1", "f:col2": "v1"}, + * {key: "k1", "f:col1": "v2", "f:col2": "v2"} + * ] + * + * Generated from protobuf field bool reversed = 7; + * @param bool $var + * @return $this + */ + public function setReversed($var) + { + GPBUtil::checkBool($var); + $this->reversed = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsRequest/RequestStatsView.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsRequest/RequestStatsView.php new file mode 100644 index 000000000000..9dd641bbd6dc --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsRequest/RequestStatsView.php @@ -0,0 +1,67 @@ +google.bigtable.v2.ReadRowsRequest.RequestStatsView + */ +class RequestStatsView +{ + /** + * The default / unset value. The API will default to the NONE option below. + * + * Generated from protobuf enum REQUEST_STATS_VIEW_UNSPECIFIED = 0; + */ + const REQUEST_STATS_VIEW_UNSPECIFIED = 0; + /** + * Do not include any RequestStats in the response. This will leave the + * RequestStats embedded message unset in the response. + * + * Generated from protobuf enum REQUEST_STATS_NONE = 1; + */ + const REQUEST_STATS_NONE = 1; + /** + * Include the full set of available RequestStats in the response, + * applicable to this read. + * + * Generated from protobuf enum REQUEST_STATS_FULL = 2; + */ + const REQUEST_STATS_FULL = 2; + + private static $valueToName = [ + self::REQUEST_STATS_VIEW_UNSPECIFIED => 'REQUEST_STATS_VIEW_UNSPECIFIED', + self::REQUEST_STATS_NONE => 'REQUEST_STATS_NONE', + self::REQUEST_STATS_FULL => 'REQUEST_STATS_FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RequestStatsView::class, \Google\Cloud\Bigtable\V2\ReadRowsRequest_RequestStatsView::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsResponse.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsResponse.php new file mode 100644 index 000000000000..024cc02abc0c --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsResponse.php @@ -0,0 +1,233 @@ +google.bigtable.v2.ReadRowsResponse + */ +class ReadRowsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A collection of a row's contents as part of the read request. + * + * Generated from protobuf field repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + private $chunks; + /** + * Optionally the server might return the row key of the last row it + * has scanned. The client can use this to construct a more + * efficient retry request if needed: any row keys or portions of + * ranges less than this row key can be dropped from the request. + * This is primarily useful for cases where the server has read a + * lot of data that was filtered out since the last committed row + * key, allowing the client to skip that work on a retry. + * + * Generated from protobuf field bytes last_scanned_row_key = 2; + */ + protected $last_scanned_row_key = ''; + /** + * If requested, provide enhanced query performance statistics. The semantics + * dictate: + * * request_stats is empty on every (streamed) response, except + * * request_stats has non-empty information after all chunks have been + * streamed, where the ReadRowsResponse message only contains + * request_stats. + * * For example, if a read request would have returned an empty + * response instead a single ReadRowsResponse is streamed with empty + * chunks and request_stats filled. + * Visually, response messages will stream as follows: + * ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}} + * \______________________/ \________________________________/ + * Primary response Trailer of RequestStats info + * Or if the read did not return any values: + * {chunks: [], request_stats: {...}} + * \________________________________/ + * Trailer of RequestStats info + * + * Generated from protobuf field .google.bigtable.v2.RequestStats request_stats = 3; + */ + protected $request_stats = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk>|\Google\Protobuf\Internal\RepeatedField $chunks + * A collection of a row's contents as part of the read request. + * @type string $last_scanned_row_key + * Optionally the server might return the row key of the last row it + * has scanned. The client can use this to construct a more + * efficient retry request if needed: any row keys or portions of + * ranges less than this row key can be dropped from the request. + * This is primarily useful for cases where the server has read a + * lot of data that was filtered out since the last committed row + * key, allowing the client to skip that work on a retry. + * @type \Google\Cloud\Bigtable\V2\RequestStats $request_stats + * If requested, provide enhanced query performance statistics. The semantics + * dictate: + * * request_stats is empty on every (streamed) response, except + * * request_stats has non-empty information after all chunks have been + * streamed, where the ReadRowsResponse message only contains + * request_stats. + * * For example, if a read request would have returned an empty + * response instead a single ReadRowsResponse is streamed with empty + * chunks and request_stats filled. + * Visually, response messages will stream as follows: + * ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}} + * \______________________/ \________________________________/ + * Primary response Trailer of RequestStats info + * Or if the read did not return any values: + * {chunks: [], request_stats: {...}} + * \________________________________/ + * Trailer of RequestStats info + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * A collection of a row's contents as part of the read request. + * + * Generated from protobuf field repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChunks() + { + return $this->chunks; + } + + /** + * A collection of a row's contents as part of the read request. + * + * Generated from protobuf field repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + * @param array<\Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChunks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk::class); + $this->chunks = $arr; + + return $this; + } + + /** + * Optionally the server might return the row key of the last row it + * has scanned. The client can use this to construct a more + * efficient retry request if needed: any row keys or portions of + * ranges less than this row key can be dropped from the request. + * This is primarily useful for cases where the server has read a + * lot of data that was filtered out since the last committed row + * key, allowing the client to skip that work on a retry. + * + * Generated from protobuf field bytes last_scanned_row_key = 2; + * @return string + */ + public function getLastScannedRowKey() + { + return $this->last_scanned_row_key; + } + + /** + * Optionally the server might return the row key of the last row it + * has scanned. The client can use this to construct a more + * efficient retry request if needed: any row keys or portions of + * ranges less than this row key can be dropped from the request. + * This is primarily useful for cases where the server has read a + * lot of data that was filtered out since the last committed row + * key, allowing the client to skip that work on a retry. + * + * Generated from protobuf field bytes last_scanned_row_key = 2; + * @param string $var + * @return $this + */ + public function setLastScannedRowKey($var) + { + GPBUtil::checkString($var, False); + $this->last_scanned_row_key = $var; + + return $this; + } + + /** + * If requested, provide enhanced query performance statistics. The semantics + * dictate: + * * request_stats is empty on every (streamed) response, except + * * request_stats has non-empty information after all chunks have been + * streamed, where the ReadRowsResponse message only contains + * request_stats. + * * For example, if a read request would have returned an empty + * response instead a single ReadRowsResponse is streamed with empty + * chunks and request_stats filled. + * Visually, response messages will stream as follows: + * ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}} + * \______________________/ \________________________________/ + * Primary response Trailer of RequestStats info + * Or if the read did not return any values: + * {chunks: [], request_stats: {...}} + * \________________________________/ + * Trailer of RequestStats info + * + * Generated from protobuf field .google.bigtable.v2.RequestStats request_stats = 3; + * @return \Google\Cloud\Bigtable\V2\RequestStats|null + */ + public function getRequestStats() + { + return $this->request_stats; + } + + public function hasRequestStats() + { + return isset($this->request_stats); + } + + public function clearRequestStats() + { + unset($this->request_stats); + } + + /** + * If requested, provide enhanced query performance statistics. The semantics + * dictate: + * * request_stats is empty on every (streamed) response, except + * * request_stats has non-empty information after all chunks have been + * streamed, where the ReadRowsResponse message only contains + * request_stats. + * * For example, if a read request would have returned an empty + * response instead a single ReadRowsResponse is streamed with empty + * chunks and request_stats filled. + * Visually, response messages will stream as follows: + * ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}} + * \______________________/ \________________________________/ + * Primary response Trailer of RequestStats info + * Or if the read did not return any values: + * {chunks: [], request_stats: {...}} + * \________________________________/ + * Trailer of RequestStats info + * + * Generated from protobuf field .google.bigtable.v2.RequestStats request_stats = 3; + * @param \Google\Cloud\Bigtable\V2\RequestStats $var + * @return $this + */ + public function setRequestStats($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RequestStats::class); + $this->request_stats = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsResponse/CellChunk.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsResponse/CellChunk.php new file mode 100644 index 000000000000..0ff8217f7de4 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ReadRowsResponse/CellChunk.php @@ -0,0 +1,560 @@ +google.bigtable.v2.ReadRowsResponse.CellChunk + */ +class CellChunk extends \Google\Protobuf\Internal\Message +{ + /** + * The row key for this chunk of data. If the row key is empty, + * this CellChunk is a continuation of the same row as the previous + * CellChunk in the response stream, even if that CellChunk was in a + * previous ReadRowsResponse message. + * + * Generated from protobuf field bytes row_key = 1; + */ + protected $row_key = ''; + /** + * The column family name for this chunk of data. If this message + * is not present this CellChunk is a continuation of the same column + * family as the previous CellChunk. The empty string can occur as a + * column family name in a response so clients must check + * explicitly for the presence of this message, not just for + * `family_name.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.StringValue family_name = 2; + */ + protected $family_name = null; + /** + * The column qualifier for this chunk of data. If this message + * is not present, this CellChunk is a continuation of the same column + * as the previous CellChunk. Column qualifiers may be empty so + * clients must check for the presence of this message, not just + * for `qualifier.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; + */ + protected $qualifier = null; + /** + * The cell's stored timestamp, which also uniquely identifies it + * within its column. Values are always expressed in + * microseconds, but individual tables may set a coarser + * granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will + * only allow values of `timestamp_micros` which are multiples of + * 1000. Timestamps are only set in the first CellChunk per cell + * (for cells split into multiple chunks). + * + * Generated from protobuf field int64 timestamp_micros = 4; + */ + protected $timestamp_micros = 0; + /** + * Labels applied to the cell by a + * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set + * on the first CellChunk per cell. + * + * Generated from protobuf field repeated string labels = 5; + */ + private $labels; + /** + * The value stored in the cell. Cell values can be split across + * multiple CellChunks. In that case only the value field will be + * set in CellChunks after the first: the timestamp and labels + * will only be present in the first CellChunk, even if the first + * CellChunk came in a previous ReadRowsResponse. + * + * Generated from protobuf field bytes value = 6; + */ + protected $value = ''; + /** + * If this CellChunk is part of a chunked cell value and this is + * not the final chunk of that cell, value_size will be set to the + * total length of the cell value. The client can use this size + * to pre-allocate memory to hold the full cell value. + * + * Generated from protobuf field int32 value_size = 7; + */ + protected $value_size = 0; + protected $row_status; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $row_key + * The row key for this chunk of data. If the row key is empty, + * this CellChunk is a continuation of the same row as the previous + * CellChunk in the response stream, even if that CellChunk was in a + * previous ReadRowsResponse message. + * @type \Google\Protobuf\StringValue $family_name + * The column family name for this chunk of data. If this message + * is not present this CellChunk is a continuation of the same column + * family as the previous CellChunk. The empty string can occur as a + * column family name in a response so clients must check + * explicitly for the presence of this message, not just for + * `family_name.value` being non-empty. + * @type \Google\Protobuf\BytesValue $qualifier + * The column qualifier for this chunk of data. If this message + * is not present, this CellChunk is a continuation of the same column + * as the previous CellChunk. Column qualifiers may be empty so + * clients must check for the presence of this message, not just + * for `qualifier.value` being non-empty. + * @type int|string $timestamp_micros + * The cell's stored timestamp, which also uniquely identifies it + * within its column. Values are always expressed in + * microseconds, but individual tables may set a coarser + * granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will + * only allow values of `timestamp_micros` which are multiples of + * 1000. Timestamps are only set in the first CellChunk per cell + * (for cells split into multiple chunks). + * @type array|\Google\Protobuf\Internal\RepeatedField $labels + * Labels applied to the cell by a + * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set + * on the first CellChunk per cell. + * @type string $value + * The value stored in the cell. Cell values can be split across + * multiple CellChunks. In that case only the value field will be + * set in CellChunks after the first: the timestamp and labels + * will only be present in the first CellChunk, even if the first + * CellChunk came in a previous ReadRowsResponse. + * @type int $value_size + * If this CellChunk is part of a chunked cell value and this is + * not the final chunk of that cell, value_size will be set to the + * total length of the cell value. The client can use this size + * to pre-allocate memory to hold the full cell value. + * @type bool $reset_row + * Indicates that the client should drop all previous chunks for + * `row_key`, as it will be re-read from the beginning. + * @type bool $commit_row + * Indicates that the client can safely process all previous chunks for + * `row_key`, as its data has been fully read. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * The row key for this chunk of data. If the row key is empty, + * this CellChunk is a continuation of the same row as the previous + * CellChunk in the response stream, even if that CellChunk was in a + * previous ReadRowsResponse message. + * + * Generated from protobuf field bytes row_key = 1; + * @return string + */ + public function getRowKey() + { + return $this->row_key; + } + + /** + * The row key for this chunk of data. If the row key is empty, + * this CellChunk is a continuation of the same row as the previous + * CellChunk in the response stream, even if that CellChunk was in a + * previous ReadRowsResponse message. + * + * Generated from protobuf field bytes row_key = 1; + * @param string $var + * @return $this + */ + public function setRowKey($var) + { + GPBUtil::checkString($var, False); + $this->row_key = $var; + + return $this; + } + + /** + * The column family name for this chunk of data. If this message + * is not present this CellChunk is a continuation of the same column + * family as the previous CellChunk. The empty string can occur as a + * column family name in a response so clients must check + * explicitly for the presence of this message, not just for + * `family_name.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.StringValue family_name = 2; + * @return \Google\Protobuf\StringValue|null + */ + public function getFamilyName() + { + return $this->family_name; + } + + public function hasFamilyName() + { + return isset($this->family_name); + } + + public function clearFamilyName() + { + unset($this->family_name); + } + + /** + * Returns the unboxed value from getFamilyName() + + * The column family name for this chunk of data. If this message + * is not present this CellChunk is a continuation of the same column + * family as the previous CellChunk. The empty string can occur as a + * column family name in a response so clients must check + * explicitly for the presence of this message, not just for + * `family_name.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.StringValue family_name = 2; + * @return string|null + */ + public function getFamilyNameUnwrapped() + { + return $this->readWrapperValue("family_name"); + } + + /** + * The column family name for this chunk of data. If this message + * is not present this CellChunk is a continuation of the same column + * family as the previous CellChunk. The empty string can occur as a + * column family name in a response so clients must check + * explicitly for the presence of this message, not just for + * `family_name.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.StringValue family_name = 2; + * @param \Google\Protobuf\StringValue $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class); + $this->family_name = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object. + + * The column family name for this chunk of data. If this message + * is not present this CellChunk is a continuation of the same column + * family as the previous CellChunk. The empty string can occur as a + * column family name in a response so clients must check + * explicitly for the presence of this message, not just for + * `family_name.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.StringValue family_name = 2; + * @param string|null $var + * @return $this + */ + public function setFamilyNameUnwrapped($var) + { + $this->writeWrapperValue("family_name", $var); + return $this;} + + /** + * The column qualifier for this chunk of data. If this message + * is not present, this CellChunk is a continuation of the same column + * as the previous CellChunk. Column qualifiers may be empty so + * clients must check for the presence of this message, not just + * for `qualifier.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; + * @return \Google\Protobuf\BytesValue|null + */ + public function getQualifier() + { + return $this->qualifier; + } + + public function hasQualifier() + { + return isset($this->qualifier); + } + + public function clearQualifier() + { + unset($this->qualifier); + } + + /** + * Returns the unboxed value from getQualifier() + + * The column qualifier for this chunk of data. If this message + * is not present, this CellChunk is a continuation of the same column + * as the previous CellChunk. Column qualifiers may be empty so + * clients must check for the presence of this message, not just + * for `qualifier.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; + * @return string|null + */ + public function getQualifierUnwrapped() + { + return $this->readWrapperValue("qualifier"); + } + + /** + * The column qualifier for this chunk of data. If this message + * is not present, this CellChunk is a continuation of the same column + * as the previous CellChunk. Column qualifiers may be empty so + * clients must check for the presence of this message, not just + * for `qualifier.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; + * @param \Google\Protobuf\BytesValue $var + * @return $this + */ + public function setQualifier($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BytesValue::class); + $this->qualifier = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BytesValue object. + + * The column qualifier for this chunk of data. If this message + * is not present, this CellChunk is a continuation of the same column + * as the previous CellChunk. Column qualifiers may be empty so + * clients must check for the presence of this message, not just + * for `qualifier.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; + * @param string|null $var + * @return $this + */ + public function setQualifierUnwrapped($var) + { + $this->writeWrapperValue("qualifier", $var); + return $this;} + + /** + * The cell's stored timestamp, which also uniquely identifies it + * within its column. Values are always expressed in + * microseconds, but individual tables may set a coarser + * granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will + * only allow values of `timestamp_micros` which are multiples of + * 1000. Timestamps are only set in the first CellChunk per cell + * (for cells split into multiple chunks). + * + * Generated from protobuf field int64 timestamp_micros = 4; + * @return int|string + */ + public function getTimestampMicros() + { + return $this->timestamp_micros; + } + + /** + * The cell's stored timestamp, which also uniquely identifies it + * within its column. Values are always expressed in + * microseconds, but individual tables may set a coarser + * granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will + * only allow values of `timestamp_micros` which are multiples of + * 1000. Timestamps are only set in the first CellChunk per cell + * (for cells split into multiple chunks). + * + * Generated from protobuf field int64 timestamp_micros = 4; + * @param int|string $var + * @return $this + */ + public function setTimestampMicros($var) + { + GPBUtil::checkInt64($var); + $this->timestamp_micros = $var; + + return $this; + } + + /** + * Labels applied to the cell by a + * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set + * on the first CellChunk per cell. + * + * Generated from protobuf field repeated string labels = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels applied to the cell by a + * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set + * on the first CellChunk per cell. + * + * Generated from protobuf field repeated string labels = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The value stored in the cell. Cell values can be split across + * multiple CellChunks. In that case only the value field will be + * set in CellChunks after the first: the timestamp and labels + * will only be present in the first CellChunk, even if the first + * CellChunk came in a previous ReadRowsResponse. + * + * Generated from protobuf field bytes value = 6; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value stored in the cell. Cell values can be split across + * multiple CellChunks. In that case only the value field will be + * set in CellChunks after the first: the timestamp and labels + * will only be present in the first CellChunk, even if the first + * CellChunk came in a previous ReadRowsResponse. + * + * Generated from protobuf field bytes value = 6; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, False); + $this->value = $var; + + return $this; + } + + /** + * If this CellChunk is part of a chunked cell value and this is + * not the final chunk of that cell, value_size will be set to the + * total length of the cell value. The client can use this size + * to pre-allocate memory to hold the full cell value. + * + * Generated from protobuf field int32 value_size = 7; + * @return int + */ + public function getValueSize() + { + return $this->value_size; + } + + /** + * If this CellChunk is part of a chunked cell value and this is + * not the final chunk of that cell, value_size will be set to the + * total length of the cell value. The client can use this size + * to pre-allocate memory to hold the full cell value. + * + * Generated from protobuf field int32 value_size = 7; + * @param int $var + * @return $this + */ + public function setValueSize($var) + { + GPBUtil::checkInt32($var); + $this->value_size = $var; + + return $this; + } + + /** + * Indicates that the client should drop all previous chunks for + * `row_key`, as it will be re-read from the beginning. + * + * Generated from protobuf field bool reset_row = 8; + * @return bool + */ + public function getResetRow() + { + return $this->readOneof(8); + } + + public function hasResetRow() + { + return $this->hasOneof(8); + } + + /** + * Indicates that the client should drop all previous chunks for + * `row_key`, as it will be re-read from the beginning. + * + * Generated from protobuf field bool reset_row = 8; + * @param bool $var + * @return $this + */ + public function setResetRow($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Indicates that the client can safely process all previous chunks for + * `row_key`, as its data has been fully read. + * + * Generated from protobuf field bool commit_row = 9; + * @return bool + */ + public function getCommitRow() + { + return $this->readOneof(9); + } + + public function hasCommitRow() + { + return $this->hasOneof(9); + } + + /** + * Indicates that the client can safely process all previous chunks for + * `row_key`, as its data has been fully read. + * + * Generated from protobuf field bool commit_row = 9; + * @param bool $var + * @return $this + */ + public function setCommitRow($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * @return string + */ + public function getRowStatus() + { + return $this->whichOneof("row_status"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CellChunk::class, \Google\Cloud\Bigtable\V2\ReadRowsResponse_CellChunk::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RequestLatencyStats.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RequestLatencyStats.php new file mode 100644 index 000000000000..26a852ba8ea8 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RequestLatencyStats.php @@ -0,0 +1,135 @@ +google.bigtable.v2.RequestLatencyStats + */ +class RequestLatencyStats extends \Google\Protobuf\Internal\Message +{ + /** + * The latency measured by the frontend server handling this request, from + * when the request was received, to when this value is sent back in the + * response. For more context on the component that is measuring this latency, + * see: https://cloud.google.com/bigtable/docs/overview + * Note: This value may be slightly shorter than the value reported into + * aggregate latency metrics in Monitoring for this request + * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value + * needs to be sent in the response before the latency measurement including + * that transmission is finalized. + * Note: This value includes the end-to-end latency of contacting nodes in + * the targeted cluster, e.g. measuring from when the first byte arrives at + * the frontend server, to when this value is sent back as the last value in + * the response, including any latency incurred by contacting nodes, waiting + * for results from nodes, and finally sending results from nodes back to the + * caller. + * + * Generated from protobuf field .google.protobuf.Duration frontend_server_latency = 1; + */ + protected $frontend_server_latency = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $frontend_server_latency + * The latency measured by the frontend server handling this request, from + * when the request was received, to when this value is sent back in the + * response. For more context on the component that is measuring this latency, + * see: https://cloud.google.com/bigtable/docs/overview + * Note: This value may be slightly shorter than the value reported into + * aggregate latency metrics in Monitoring for this request + * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value + * needs to be sent in the response before the latency measurement including + * that transmission is finalized. + * Note: This value includes the end-to-end latency of contacting nodes in + * the targeted cluster, e.g. measuring from when the first byte arrives at + * the frontend server, to when this value is sent back as the last value in + * the response, including any latency incurred by contacting nodes, waiting + * for results from nodes, and finally sending results from nodes back to the + * caller. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\RequestStats::initOnce(); + parent::__construct($data); + } + + /** + * The latency measured by the frontend server handling this request, from + * when the request was received, to when this value is sent back in the + * response. For more context on the component that is measuring this latency, + * see: https://cloud.google.com/bigtable/docs/overview + * Note: This value may be slightly shorter than the value reported into + * aggregate latency metrics in Monitoring for this request + * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value + * needs to be sent in the response before the latency measurement including + * that transmission is finalized. + * Note: This value includes the end-to-end latency of contacting nodes in + * the targeted cluster, e.g. measuring from when the first byte arrives at + * the frontend server, to when this value is sent back as the last value in + * the response, including any latency incurred by contacting nodes, waiting + * for results from nodes, and finally sending results from nodes back to the + * caller. + * + * Generated from protobuf field .google.protobuf.Duration frontend_server_latency = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getFrontendServerLatency() + { + return $this->frontend_server_latency; + } + + public function hasFrontendServerLatency() + { + return isset($this->frontend_server_latency); + } + + public function clearFrontendServerLatency() + { + unset($this->frontend_server_latency); + } + + /** + * The latency measured by the frontend server handling this request, from + * when the request was received, to when this value is sent back in the + * response. For more context on the component that is measuring this latency, + * see: https://cloud.google.com/bigtable/docs/overview + * Note: This value may be slightly shorter than the value reported into + * aggregate latency metrics in Monitoring for this request + * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value + * needs to be sent in the response before the latency measurement including + * that transmission is finalized. + * Note: This value includes the end-to-end latency of contacting nodes in + * the targeted cluster, e.g. measuring from when the first byte arrives at + * the frontend server, to when this value is sent back as the last value in + * the response, including any latency incurred by contacting nodes, waiting + * for results from nodes, and finally sending results from nodes back to the + * caller. + * + * Generated from protobuf field .google.protobuf.Duration frontend_server_latency = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setFrontendServerLatency($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->frontend_server_latency = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RequestStats.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RequestStats.php new file mode 100644 index 000000000000..9726ac0d3f26 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RequestStats.php @@ -0,0 +1,81 @@ +google.bigtable.v2.RequestStats + */ +class RequestStats extends \Google\Protobuf\Internal\Message +{ + protected $stats_view; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\FullReadStatsView $full_read_stats_view + * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL + * view, see package google.bigtable.v2. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\RequestStats::initOnce(); + parent::__construct($data); + } + + /** + * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL + * view, see package google.bigtable.v2. + * + * Generated from protobuf field .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + * @return \Google\Cloud\Bigtable\V2\FullReadStatsView|null + */ + public function getFullReadStatsView() + { + return $this->readOneof(1); + } + + public function hasFullReadStatsView() + { + return $this->hasOneof(1); + } + + /** + * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL + * view, see package google.bigtable.v2. + * + * Generated from protobuf field .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + * @param \Google\Cloud\Bigtable\V2\FullReadStatsView $var + * @return $this + */ + public function setFullReadStatsView($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\FullReadStatsView::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getStatsView() + { + return $this->whichOneof("stats_view"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ResponseParams.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ResponseParams.php new file mode 100644 index 000000000000..08a68a68ff05 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ResponseParams.php @@ -0,0 +1,128 @@ +google.bigtable.v2.ResponseParams + */ +class ResponseParams extends \Google\Protobuf\Internal\Message +{ + /** + * The cloud bigtable zone associated with the cluster. + * + * Generated from protobuf field optional string zone_id = 1; + */ + protected $zone_id = null; + /** + * Identifier for a cluster that represents set of + * bigtable resources. + * + * Generated from protobuf field optional string cluster_id = 2; + */ + protected $cluster_id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $zone_id + * The cloud bigtable zone associated with the cluster. + * @type string $cluster_id + * Identifier for a cluster that represents set of + * bigtable resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\ResponseParams::initOnce(); + parent::__construct($data); + } + + /** + * The cloud bigtable zone associated with the cluster. + * + * Generated from protobuf field optional string zone_id = 1; + * @return string + */ + public function getZoneId() + { + return isset($this->zone_id) ? $this->zone_id : ''; + } + + public function hasZoneId() + { + return isset($this->zone_id); + } + + public function clearZoneId() + { + unset($this->zone_id); + } + + /** + * The cloud bigtable zone associated with the cluster. + * + * Generated from protobuf field optional string zone_id = 1; + * @param string $var + * @return $this + */ + public function setZoneId($var) + { + GPBUtil::checkString($var, True); + $this->zone_id = $var; + + return $this; + } + + /** + * Identifier for a cluster that represents set of + * bigtable resources. + * + * Generated from protobuf field optional string cluster_id = 2; + * @return string + */ + public function getClusterId() + { + return isset($this->cluster_id) ? $this->cluster_id : ''; + } + + public function hasClusterId() + { + return isset($this->cluster_id); + } + + public function clearClusterId() + { + unset($this->cluster_id); + } + + /** + * Identifier for a cluster that represents set of + * bigtable resources. + * + * Generated from protobuf field optional string cluster_id = 2; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ResultSetMetadata.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ResultSetMetadata.php new file mode 100644 index 000000000000..9e61567a09bd --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ResultSetMetadata.php @@ -0,0 +1,75 @@ +google.bigtable.v2.ResultSetMetadata + */ +class ResultSetMetadata extends \Google\Protobuf\Internal\Message +{ + protected $schema; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\ProtoSchema $proto_schema + * Schema in proto format + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * Schema in proto format + * + * Generated from protobuf field .google.bigtable.v2.ProtoSchema proto_schema = 1; + * @return \Google\Cloud\Bigtable\V2\ProtoSchema|null + */ + public function getProtoSchema() + { + return $this->readOneof(1); + } + + public function hasProtoSchema() + { + return $this->hasOneof(1); + } + + /** + * Schema in proto format + * + * Generated from protobuf field .google.bigtable.v2.ProtoSchema proto_schema = 1; + * @param \Google\Cloud\Bigtable\V2\ProtoSchema $var + * @return $this + */ + public function setProtoSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ProtoSchema::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getSchema() + { + return $this->whichOneof("schema"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Row.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Row.php new file mode 100644 index 000000000000..ad1d56187e7a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Row.php @@ -0,0 +1,114 @@ +google.bigtable.v2.Row + */ +class Row extends \Google\Protobuf\Internal\Message +{ + /** + * The unique key which identifies this row within its table. This is the same + * key that's used to identify the row in, for example, a MutateRowRequest. + * May contain any non-empty byte string up to 4KiB in length. + * + * Generated from protobuf field bytes key = 1; + */ + protected $key = ''; + /** + * May be empty, but only if the entire row is empty. + * The mutual ordering of column families is not specified. + * + * Generated from protobuf field repeated .google.bigtable.v2.Family families = 2; + */ + private $families; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The unique key which identifies this row within its table. This is the same + * key that's used to identify the row in, for example, a MutateRowRequest. + * May contain any non-empty byte string up to 4KiB in length. + * @type array<\Google\Cloud\Bigtable\V2\Family>|\Google\Protobuf\Internal\RepeatedField $families + * May be empty, but only if the entire row is empty. + * The mutual ordering of column families is not specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The unique key which identifies this row within its table. This is the same + * key that's used to identify the row in, for example, a MutateRowRequest. + * May contain any non-empty byte string up to 4KiB in length. + * + * Generated from protobuf field bytes key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * The unique key which identifies this row within its table. This is the same + * key that's used to identify the row in, for example, a MutateRowRequest. + * May contain any non-empty byte string up to 4KiB in length. + * + * Generated from protobuf field bytes key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, False); + $this->key = $var; + + return $this; + } + + /** + * May be empty, but only if the entire row is empty. + * The mutual ordering of column families is not specified. + * + * Generated from protobuf field repeated .google.bigtable.v2.Family families = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFamilies() + { + return $this->families; + } + + /** + * May be empty, but only if the entire row is empty. + * The mutual ordering of column families is not specified. + * + * Generated from protobuf field repeated .google.bigtable.v2.Family families = 2; + * @param array<\Google\Cloud\Bigtable\V2\Family>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFamilies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Family::class); + $this->families = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter.php new file mode 100644 index 000000000000..3d05e40a7922 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter.php @@ -0,0 +1,990 @@ +google.bigtable.v2.RowFilter + */ +class RowFilter extends \Google\Protobuf\Internal\Message +{ + protected $filter; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\RowFilter\Chain $chain + * Applies several RowFilters to the data in sequence, progressively + * narrowing the results. + * @type \Google\Cloud\Bigtable\V2\RowFilter\Interleave $interleave + * Applies several RowFilters to the data in parallel and combines the + * results. + * @type \Google\Cloud\Bigtable\V2\RowFilter\Condition $condition + * Applies one of two possible RowFilters to the data based on the output of + * a predicate RowFilter. + * @type bool $sink + * ADVANCED USE ONLY. + * Hook for introspection into the RowFilter. Outputs all cells directly to + * the output of the read rather than to any parent filter. Consider the + * following example: + * Chain( + * FamilyRegex("A"), + * Interleave( + * All(), + * Chain(Label("foo"), Sink()) + * ), + * QualifierRegex("B") + * ) + * A,A,1,w + * A,B,2,x + * B,B,4,z + * | + * FamilyRegex("A") + * | + * A,A,1,w + * A,B,2,x + * | + * +------------+-------------+ + * | | + * All() Label(foo) + * | | + * A,A,1,w A,A,1,w,labels:[foo] + * A,B,2,x A,B,2,x,labels:[foo] + * | | + * | Sink() --------------+ + * | | | + * +------------+ x------+ A,A,1,w,labels:[foo] + * | A,B,2,x,labels:[foo] + * A,A,1,w | + * A,B,2,x | + * | | + * QualifierRegex("B") | + * | | + * A,B,2,x | + * | | + * +--------------------------------+ + * | + * A,A,1,w,labels:[foo] + * A,B,2,x,labels:[foo] // could be switched + * A,B,2,x // could be switched + * Despite being excluded by the qualifier filter, a copy of every cell + * that reaches the sink is present in the final result. + * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave], + * duplicate cells are possible, and appear in an unspecified mutual order. + * In this case we have a duplicate with column "A:B" and timestamp 2, + * because one copy passed through the all filter while the other was + * passed through the label and sink. Note that one copy has label "foo", + * while the other does not. + * Cannot be used within the `predicate_filter`, `true_filter`, or + * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition]. + * @type bool $pass_all_filter + * Matches all cells, regardless of input. Functionally equivalent to + * leaving `filter` unset, but included for completeness. + * @type bool $block_all_filter + * Does not match any cells, regardless of input. Useful for temporarily + * disabling just part of a filter. + * @type string $row_key_regex_filter + * Matches only cells from rows whose keys satisfy the given RE2 regex. In + * other words, passes through the entire row when the key matches, and + * otherwise produces an empty row. + * Note that, since row keys can contain arbitrary bytes, the `\C` escape + * sequence must be used if a true wildcard is desired. The `.` character + * will not match the new line character `\n`, which may be present in a + * binary key. + * @type float $row_sample_filter + * Matches all cells from a row with probability p, and matches no cells + * from the row with probability 1-p. + * @type string $family_name_regex_filter + * Matches only cells from columns whose families satisfy the given RE2 + * regex. For technical reasons, the regex must not contain the `:` + * character, even if it is not being used as a literal. + * Note that, since column families cannot contain the new line character + * `\n`, it is sufficient to use `.` as a full wildcard when matching + * column family names. + * @type string $column_qualifier_regex_filter + * Matches only cells from columns whose qualifiers satisfy the given RE2 + * regex. + * Note that, since column qualifiers can contain arbitrary bytes, the `\C` + * escape sequence must be used if a true wildcard is desired. The `.` + * character will not match the new line character `\n`, which may be + * present in a binary qualifier. + * @type \Google\Cloud\Bigtable\V2\ColumnRange $column_range_filter + * Matches only cells from columns within the given range. + * @type \Google\Cloud\Bigtable\V2\TimestampRange $timestamp_range_filter + * Matches only cells with timestamps within the given range. + * @type string $value_regex_filter + * Matches only cells with values that satisfy the given regular expression. + * Note that, since cell values can contain arbitrary bytes, the `\C` escape + * sequence must be used if a true wildcard is desired. The `.` character + * will not match the new line character `\n`, which may be present in a + * binary value. + * @type \Google\Cloud\Bigtable\V2\ValueRange $value_range_filter + * Matches only cells with values that fall within the given range. + * @type int $cells_per_row_offset_filter + * Skips the first N cells of each row, matching all subsequent cells. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * @type int $cells_per_row_limit_filter + * Matches only the first N cells of each row. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * @type int $cells_per_column_limit_filter + * Matches only the most recent N cells within each column. For example, + * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9, + * skip all earlier cells in `foo:bar`, and then begin matching again in + * column `foo:bar2`. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * @type bool $strip_value_transformer + * Replaces each cell's value with the empty string. + * @type string $apply_label_transformer + * Applies the given label to all cells in the output row. This allows + * the client to determine which results were produced from which part of + * the filter. + * Values must be at most 15 characters in length, and match the RE2 + * pattern `[a-z0-9\\-]+` + * Due to a technical limitation, it is not currently possible to apply + * multiple labels to a cell. As a result, a Chain may have no more than + * one sub-filter which contains a `apply_label_transformer`. It is okay for + * an Interleave to contain multiple `apply_label_transformers`, as they + * will be applied to separate copies of the input. This may be relaxed in + * the future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * Applies several RowFilters to the data in sequence, progressively + * narrowing the results. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter.Chain chain = 1; + * @return \Google\Cloud\Bigtable\V2\RowFilter\Chain|null + */ + public function getChain() + { + return $this->readOneof(1); + } + + public function hasChain() + { + return $this->hasOneof(1); + } + + /** + * Applies several RowFilters to the data in sequence, progressively + * narrowing the results. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter.Chain chain = 1; + * @param \Google\Cloud\Bigtable\V2\RowFilter\Chain $var + * @return $this + */ + public function setChain($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter\Chain::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Applies several RowFilters to the data in parallel and combines the + * results. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter.Interleave interleave = 2; + * @return \Google\Cloud\Bigtable\V2\RowFilter\Interleave|null + */ + public function getInterleave() + { + return $this->readOneof(2); + } + + public function hasInterleave() + { + return $this->hasOneof(2); + } + + /** + * Applies several RowFilters to the data in parallel and combines the + * results. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter.Interleave interleave = 2; + * @param \Google\Cloud\Bigtable\V2\RowFilter\Interleave $var + * @return $this + */ + public function setInterleave($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter\Interleave::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Applies one of two possible RowFilters to the data based on the output of + * a predicate RowFilter. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter.Condition condition = 3; + * @return \Google\Cloud\Bigtable\V2\RowFilter\Condition|null + */ + public function getCondition() + { + return $this->readOneof(3); + } + + public function hasCondition() + { + return $this->hasOneof(3); + } + + /** + * Applies one of two possible RowFilters to the data based on the output of + * a predicate RowFilter. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter.Condition condition = 3; + * @param \Google\Cloud\Bigtable\V2\RowFilter\Condition $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter\Condition::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * ADVANCED USE ONLY. + * Hook for introspection into the RowFilter. Outputs all cells directly to + * the output of the read rather than to any parent filter. Consider the + * following example: + * Chain( + * FamilyRegex("A"), + * Interleave( + * All(), + * Chain(Label("foo"), Sink()) + * ), + * QualifierRegex("B") + * ) + * A,A,1,w + * A,B,2,x + * B,B,4,z + * | + * FamilyRegex("A") + * | + * A,A,1,w + * A,B,2,x + * | + * +------------+-------------+ + * | | + * All() Label(foo) + * | | + * A,A,1,w A,A,1,w,labels:[foo] + * A,B,2,x A,B,2,x,labels:[foo] + * | | + * | Sink() --------------+ + * | | | + * +------------+ x------+ A,A,1,w,labels:[foo] + * | A,B,2,x,labels:[foo] + * A,A,1,w | + * A,B,2,x | + * | | + * QualifierRegex("B") | + * | | + * A,B,2,x | + * | | + * +--------------------------------+ + * | + * A,A,1,w,labels:[foo] + * A,B,2,x,labels:[foo] // could be switched + * A,B,2,x // could be switched + * Despite being excluded by the qualifier filter, a copy of every cell + * that reaches the sink is present in the final result. + * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave], + * duplicate cells are possible, and appear in an unspecified mutual order. + * In this case we have a duplicate with column "A:B" and timestamp 2, + * because one copy passed through the all filter while the other was + * passed through the label and sink. Note that one copy has label "foo", + * while the other does not. + * Cannot be used within the `predicate_filter`, `true_filter`, or + * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition]. + * + * Generated from protobuf field bool sink = 16; + * @return bool + */ + public function getSink() + { + return $this->readOneof(16); + } + + public function hasSink() + { + return $this->hasOneof(16); + } + + /** + * ADVANCED USE ONLY. + * Hook for introspection into the RowFilter. Outputs all cells directly to + * the output of the read rather than to any parent filter. Consider the + * following example: + * Chain( + * FamilyRegex("A"), + * Interleave( + * All(), + * Chain(Label("foo"), Sink()) + * ), + * QualifierRegex("B") + * ) + * A,A,1,w + * A,B,2,x + * B,B,4,z + * | + * FamilyRegex("A") + * | + * A,A,1,w + * A,B,2,x + * | + * +------------+-------------+ + * | | + * All() Label(foo) + * | | + * A,A,1,w A,A,1,w,labels:[foo] + * A,B,2,x A,B,2,x,labels:[foo] + * | | + * | Sink() --------------+ + * | | | + * +------------+ x------+ A,A,1,w,labels:[foo] + * | A,B,2,x,labels:[foo] + * A,A,1,w | + * A,B,2,x | + * | | + * QualifierRegex("B") | + * | | + * A,B,2,x | + * | | + * +--------------------------------+ + * | + * A,A,1,w,labels:[foo] + * A,B,2,x,labels:[foo] // could be switched + * A,B,2,x // could be switched + * Despite being excluded by the qualifier filter, a copy of every cell + * that reaches the sink is present in the final result. + * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave], + * duplicate cells are possible, and appear in an unspecified mutual order. + * In this case we have a duplicate with column "A:B" and timestamp 2, + * because one copy passed through the all filter while the other was + * passed through the label and sink. Note that one copy has label "foo", + * while the other does not. + * Cannot be used within the `predicate_filter`, `true_filter`, or + * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition]. + * + * Generated from protobuf field bool sink = 16; + * @param bool $var + * @return $this + */ + public function setSink($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Matches all cells, regardless of input. Functionally equivalent to + * leaving `filter` unset, but included for completeness. + * + * Generated from protobuf field bool pass_all_filter = 17; + * @return bool + */ + public function getPassAllFilter() + { + return $this->readOneof(17); + } + + public function hasPassAllFilter() + { + return $this->hasOneof(17); + } + + /** + * Matches all cells, regardless of input. Functionally equivalent to + * leaving `filter` unset, but included for completeness. + * + * Generated from protobuf field bool pass_all_filter = 17; + * @param bool $var + * @return $this + */ + public function setPassAllFilter($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(17, $var); + + return $this; + } + + /** + * Does not match any cells, regardless of input. Useful for temporarily + * disabling just part of a filter. + * + * Generated from protobuf field bool block_all_filter = 18; + * @return bool + */ + public function getBlockAllFilter() + { + return $this->readOneof(18); + } + + public function hasBlockAllFilter() + { + return $this->hasOneof(18); + } + + /** + * Does not match any cells, regardless of input. Useful for temporarily + * disabling just part of a filter. + * + * Generated from protobuf field bool block_all_filter = 18; + * @param bool $var + * @return $this + */ + public function setBlockAllFilter($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(18, $var); + + return $this; + } + + /** + * Matches only cells from rows whose keys satisfy the given RE2 regex. In + * other words, passes through the entire row when the key matches, and + * otherwise produces an empty row. + * Note that, since row keys can contain arbitrary bytes, the `\C` escape + * sequence must be used if a true wildcard is desired. The `.` character + * will not match the new line character `\n`, which may be present in a + * binary key. + * + * Generated from protobuf field bytes row_key_regex_filter = 4; + * @return string + */ + public function getRowKeyRegexFilter() + { + return $this->readOneof(4); + } + + public function hasRowKeyRegexFilter() + { + return $this->hasOneof(4); + } + + /** + * Matches only cells from rows whose keys satisfy the given RE2 regex. In + * other words, passes through the entire row when the key matches, and + * otherwise produces an empty row. + * Note that, since row keys can contain arbitrary bytes, the `\C` escape + * sequence must be used if a true wildcard is desired. The `.` character + * will not match the new line character `\n`, which may be present in a + * binary key. + * + * Generated from protobuf field bytes row_key_regex_filter = 4; + * @param string $var + * @return $this + */ + public function setRowKeyRegexFilter($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Matches all cells from a row with probability p, and matches no cells + * from the row with probability 1-p. + * + * Generated from protobuf field double row_sample_filter = 14; + * @return float + */ + public function getRowSampleFilter() + { + return $this->readOneof(14); + } + + public function hasRowSampleFilter() + { + return $this->hasOneof(14); + } + + /** + * Matches all cells from a row with probability p, and matches no cells + * from the row with probability 1-p. + * + * Generated from protobuf field double row_sample_filter = 14; + * @param float $var + * @return $this + */ + public function setRowSampleFilter($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * Matches only cells from columns whose families satisfy the given RE2 + * regex. For technical reasons, the regex must not contain the `:` + * character, even if it is not being used as a literal. + * Note that, since column families cannot contain the new line character + * `\n`, it is sufficient to use `.` as a full wildcard when matching + * column family names. + * + * Generated from protobuf field string family_name_regex_filter = 5; + * @return string + */ + public function getFamilyNameRegexFilter() + { + return $this->readOneof(5); + } + + public function hasFamilyNameRegexFilter() + { + return $this->hasOneof(5); + } + + /** + * Matches only cells from columns whose families satisfy the given RE2 + * regex. For technical reasons, the regex must not contain the `:` + * character, even if it is not being used as a literal. + * Note that, since column families cannot contain the new line character + * `\n`, it is sufficient to use `.` as a full wildcard when matching + * column family names. + * + * Generated from protobuf field string family_name_regex_filter = 5; + * @param string $var + * @return $this + */ + public function setFamilyNameRegexFilter($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Matches only cells from columns whose qualifiers satisfy the given RE2 + * regex. + * Note that, since column qualifiers can contain arbitrary bytes, the `\C` + * escape sequence must be used if a true wildcard is desired. The `.` + * character will not match the new line character `\n`, which may be + * present in a binary qualifier. + * + * Generated from protobuf field bytes column_qualifier_regex_filter = 6; + * @return string + */ + public function getColumnQualifierRegexFilter() + { + return $this->readOneof(6); + } + + public function hasColumnQualifierRegexFilter() + { + return $this->hasOneof(6); + } + + /** + * Matches only cells from columns whose qualifiers satisfy the given RE2 + * regex. + * Note that, since column qualifiers can contain arbitrary bytes, the `\C` + * escape sequence must be used if a true wildcard is desired. The `.` + * character will not match the new line character `\n`, which may be + * present in a binary qualifier. + * + * Generated from protobuf field bytes column_qualifier_regex_filter = 6; + * @param string $var + * @return $this + */ + public function setColumnQualifierRegexFilter($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Matches only cells from columns within the given range. + * + * Generated from protobuf field .google.bigtable.v2.ColumnRange column_range_filter = 7; + * @return \Google\Cloud\Bigtable\V2\ColumnRange|null + */ + public function getColumnRangeFilter() + { + return $this->readOneof(7); + } + + public function hasColumnRangeFilter() + { + return $this->hasOneof(7); + } + + /** + * Matches only cells from columns within the given range. + * + * Generated from protobuf field .google.bigtable.v2.ColumnRange column_range_filter = 7; + * @param \Google\Cloud\Bigtable\V2\ColumnRange $var + * @return $this + */ + public function setColumnRangeFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ColumnRange::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Matches only cells with timestamps within the given range. + * + * Generated from protobuf field .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + * @return \Google\Cloud\Bigtable\V2\TimestampRange|null + */ + public function getTimestampRangeFilter() + { + return $this->readOneof(8); + } + + public function hasTimestampRangeFilter() + { + return $this->hasOneof(8); + } + + /** + * Matches only cells with timestamps within the given range. + * + * Generated from protobuf field .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + * @param \Google\Cloud\Bigtable\V2\TimestampRange $var + * @return $this + */ + public function setTimestampRangeFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\TimestampRange::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Matches only cells with values that satisfy the given regular expression. + * Note that, since cell values can contain arbitrary bytes, the `\C` escape + * sequence must be used if a true wildcard is desired. The `.` character + * will not match the new line character `\n`, which may be present in a + * binary value. + * + * Generated from protobuf field bytes value_regex_filter = 9; + * @return string + */ + public function getValueRegexFilter() + { + return $this->readOneof(9); + } + + public function hasValueRegexFilter() + { + return $this->hasOneof(9); + } + + /** + * Matches only cells with values that satisfy the given regular expression. + * Note that, since cell values can contain arbitrary bytes, the `\C` escape + * sequence must be used if a true wildcard is desired. The `.` character + * will not match the new line character `\n`, which may be present in a + * binary value. + * + * Generated from protobuf field bytes value_regex_filter = 9; + * @param string $var + * @return $this + */ + public function setValueRegexFilter($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Matches only cells with values that fall within the given range. + * + * Generated from protobuf field .google.bigtable.v2.ValueRange value_range_filter = 15; + * @return \Google\Cloud\Bigtable\V2\ValueRange|null + */ + public function getValueRangeFilter() + { + return $this->readOneof(15); + } + + public function hasValueRangeFilter() + { + return $this->hasOneof(15); + } + + /** + * Matches only cells with values that fall within the given range. + * + * Generated from protobuf field .google.bigtable.v2.ValueRange value_range_filter = 15; + * @param \Google\Cloud\Bigtable\V2\ValueRange $var + * @return $this + */ + public function setValueRangeFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ValueRange::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Skips the first N cells of each row, matching all subsequent cells. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * + * Generated from protobuf field int32 cells_per_row_offset_filter = 10; + * @return int + */ + public function getCellsPerRowOffsetFilter() + { + return $this->readOneof(10); + } + + public function hasCellsPerRowOffsetFilter() + { + return $this->hasOneof(10); + } + + /** + * Skips the first N cells of each row, matching all subsequent cells. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * + * Generated from protobuf field int32 cells_per_row_offset_filter = 10; + * @param int $var + * @return $this + */ + public function setCellsPerRowOffsetFilter($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Matches only the first N cells of each row. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * + * Generated from protobuf field int32 cells_per_row_limit_filter = 11; + * @return int + */ + public function getCellsPerRowLimitFilter() + { + return $this->readOneof(11); + } + + public function hasCellsPerRowLimitFilter() + { + return $this->hasOneof(11); + } + + /** + * Matches only the first N cells of each row. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * + * Generated from protobuf field int32 cells_per_row_limit_filter = 11; + * @param int $var + * @return $this + */ + public function setCellsPerRowLimitFilter($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Matches only the most recent N cells within each column. For example, + * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9, + * skip all earlier cells in `foo:bar`, and then begin matching again in + * column `foo:bar2`. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * + * Generated from protobuf field int32 cells_per_column_limit_filter = 12; + * @return int + */ + public function getCellsPerColumnLimitFilter() + { + return $this->readOneof(12); + } + + public function hasCellsPerColumnLimitFilter() + { + return $this->hasOneof(12); + } + + /** + * Matches only the most recent N cells within each column. For example, + * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9, + * skip all earlier cells in `foo:bar`, and then begin matching again in + * column `foo:bar2`. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * + * Generated from protobuf field int32 cells_per_column_limit_filter = 12; + * @param int $var + * @return $this + */ + public function setCellsPerColumnLimitFilter($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Replaces each cell's value with the empty string. + * + * Generated from protobuf field bool strip_value_transformer = 13; + * @return bool + */ + public function getStripValueTransformer() + { + return $this->readOneof(13); + } + + public function hasStripValueTransformer() + { + return $this->hasOneof(13); + } + + /** + * Replaces each cell's value with the empty string. + * + * Generated from protobuf field bool strip_value_transformer = 13; + * @param bool $var + * @return $this + */ + public function setStripValueTransformer($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Applies the given label to all cells in the output row. This allows + * the client to determine which results were produced from which part of + * the filter. + * Values must be at most 15 characters in length, and match the RE2 + * pattern `[a-z0-9\\-]+` + * Due to a technical limitation, it is not currently possible to apply + * multiple labels to a cell. As a result, a Chain may have no more than + * one sub-filter which contains a `apply_label_transformer`. It is okay for + * an Interleave to contain multiple `apply_label_transformers`, as they + * will be applied to separate copies of the input. This may be relaxed in + * the future. + * + * Generated from protobuf field string apply_label_transformer = 19; + * @return string + */ + public function getApplyLabelTransformer() + { + return $this->readOneof(19); + } + + public function hasApplyLabelTransformer() + { + return $this->hasOneof(19); + } + + /** + * Applies the given label to all cells in the output row. This allows + * the client to determine which results were produced from which part of + * the filter. + * Values must be at most 15 characters in length, and match the RE2 + * pattern `[a-z0-9\\-]+` + * Due to a technical limitation, it is not currently possible to apply + * multiple labels to a cell. As a result, a Chain may have no more than + * one sub-filter which contains a `apply_label_transformer`. It is okay for + * an Interleave to contain multiple `apply_label_transformers`, as they + * will be applied to separate copies of the input. This may be relaxed in + * the future. + * + * Generated from protobuf field string apply_label_transformer = 19; + * @param string $var + * @return $this + */ + public function setApplyLabelTransformer($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(19, $var); + + return $this; + } + + /** + * @return string + */ + public function getFilter() + { + return $this->whichOneof("filter"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter/Chain.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter/Chain.php new file mode 100644 index 000000000000..5d9a60a3cea2 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter/Chain.php @@ -0,0 +1,78 @@ +google.bigtable.v2.RowFilter.Chain + */ +class Chain extends \Google\Protobuf\Internal\Message +{ + /** + * The elements of "filters" are chained together to process the input row: + * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + * The full chain is executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + */ + private $filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\V2\RowFilter>|\Google\Protobuf\Internal\RepeatedField $filters + * The elements of "filters" are chained together to process the input row: + * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + * The full chain is executed atomically. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The elements of "filters" are chained together to process the input row: + * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + * The full chain is executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilters() + { + return $this->filters; + } + + /** + * The elements of "filters" are chained together to process the input row: + * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + * The full chain is executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + * @param array<\Google\Cloud\Bigtable\V2\RowFilter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->filters = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Chain::class, \Google\Cloud\Bigtable\V2\RowFilter_Chain::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter/Condition.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter/Condition.php new file mode 100644 index 000000000000..f7e66bf81817 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter/Condition.php @@ -0,0 +1,189 @@ +google.bigtable.v2.RowFilter.Condition + */ +class Condition extends \Google\Protobuf\Internal\Message +{ + /** + * If `predicate_filter` outputs any cells, then `true_filter` will be + * evaluated on the input row. Otherwise, `false_filter` will be evaluated. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 1; + */ + protected $predicate_filter = null; + /** + * The filter to apply to the input row if `predicate_filter` returns any + * results. If not provided, no results will be returned in the true case. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter true_filter = 2; + */ + protected $true_filter = null; + /** + * The filter to apply to the input row if `predicate_filter` does not + * return any results. If not provided, no results will be returned in the + * false case. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter false_filter = 3; + */ + protected $false_filter = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\RowFilter $predicate_filter + * If `predicate_filter` outputs any cells, then `true_filter` will be + * evaluated on the input row. Otherwise, `false_filter` will be evaluated. + * @type \Google\Cloud\Bigtable\V2\RowFilter $true_filter + * The filter to apply to the input row if `predicate_filter` returns any + * results. If not provided, no results will be returned in the true case. + * @type \Google\Cloud\Bigtable\V2\RowFilter $false_filter + * The filter to apply to the input row if `predicate_filter` does not + * return any results. If not provided, no results will be returned in the + * false case. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * If `predicate_filter` outputs any cells, then `true_filter` will be + * evaluated on the input row. Otherwise, `false_filter` will be evaluated. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 1; + * @return \Google\Cloud\Bigtable\V2\RowFilter|null + */ + public function getPredicateFilter() + { + return $this->predicate_filter; + } + + public function hasPredicateFilter() + { + return isset($this->predicate_filter); + } + + public function clearPredicateFilter() + { + unset($this->predicate_filter); + } + + /** + * If `predicate_filter` outputs any cells, then `true_filter` will be + * evaluated on the input row. Otherwise, `false_filter` will be evaluated. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 1; + * @param \Google\Cloud\Bigtable\V2\RowFilter $var + * @return $this + */ + public function setPredicateFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->predicate_filter = $var; + + return $this; + } + + /** + * The filter to apply to the input row if `predicate_filter` returns any + * results. If not provided, no results will be returned in the true case. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter true_filter = 2; + * @return \Google\Cloud\Bigtable\V2\RowFilter|null + */ + public function getTrueFilter() + { + return $this->true_filter; + } + + public function hasTrueFilter() + { + return isset($this->true_filter); + } + + public function clearTrueFilter() + { + unset($this->true_filter); + } + + /** + * The filter to apply to the input row if `predicate_filter` returns any + * results. If not provided, no results will be returned in the true case. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter true_filter = 2; + * @param \Google\Cloud\Bigtable\V2\RowFilter $var + * @return $this + */ + public function setTrueFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->true_filter = $var; + + return $this; + } + + /** + * The filter to apply to the input row if `predicate_filter` does not + * return any results. If not provided, no results will be returned in the + * false case. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter false_filter = 3; + * @return \Google\Cloud\Bigtable\V2\RowFilter|null + */ + public function getFalseFilter() + { + return $this->false_filter; + } + + public function hasFalseFilter() + { + return isset($this->false_filter); + } + + public function clearFalseFilter() + { + unset($this->false_filter); + } + + /** + * The filter to apply to the input row if `predicate_filter` does not + * return any results. If not provided, no results will be returned in the + * false case. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter false_filter = 3; + * @param \Google\Cloud\Bigtable\V2\RowFilter $var + * @return $this + */ + public function setFalseFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->false_filter = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Condition::class, \Google\Cloud\Bigtable\V2\RowFilter_Condition::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter/Interleave.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter/Interleave.php new file mode 100644 index 000000000000..92485f18e91d --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowFilter/Interleave.php @@ -0,0 +1,159 @@ +google.bigtable.v2.RowFilter.Interleave + */ +class Interleave extends \Google\Protobuf\Internal\Message +{ + /** + * The elements of "filters" all process a copy of the input row, and the + * results are pooled, sorted, and combined into a single output row. + * If multiple cells are produced with the same column and timestamp, + * they will all appear in the output row in an unspecified mutual order. + * Consider the following example, with three filters: + * input row + * | + * ----------------------------------------------------- + * | | | + * f(0) f(1) f(2) + * | | | + * 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + * 2: foo,blah,11,z far,blah,5,x far,blah,5,x + * | | | + * ----------------------------------------------------- + * | + * 1: foo,bar,10,z // could have switched with #2 + * 2: foo,bar,10,x // could have switched with #1 + * 3: foo,blah,11,z + * 4: far,bar,7,a + * 5: far,blah,5,x // identical to #6 + * 6: far,blah,5,x // identical to #5 + * All interleaved filters are executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + */ + private $filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\V2\RowFilter>|\Google\Protobuf\Internal\RepeatedField $filters + * The elements of "filters" all process a copy of the input row, and the + * results are pooled, sorted, and combined into a single output row. + * If multiple cells are produced with the same column and timestamp, + * they will all appear in the output row in an unspecified mutual order. + * Consider the following example, with three filters: + * input row + * | + * ----------------------------------------------------- + * | | | + * f(0) f(1) f(2) + * | | | + * 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + * 2: foo,blah,11,z far,blah,5,x far,blah,5,x + * | | | + * ----------------------------------------------------- + * | + * 1: foo,bar,10,z // could have switched with #2 + * 2: foo,bar,10,x // could have switched with #1 + * 3: foo,blah,11,z + * 4: far,bar,7,a + * 5: far,blah,5,x // identical to #6 + * 6: far,blah,5,x // identical to #5 + * All interleaved filters are executed atomically. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The elements of "filters" all process a copy of the input row, and the + * results are pooled, sorted, and combined into a single output row. + * If multiple cells are produced with the same column and timestamp, + * they will all appear in the output row in an unspecified mutual order. + * Consider the following example, with three filters: + * input row + * | + * ----------------------------------------------------- + * | | | + * f(0) f(1) f(2) + * | | | + * 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + * 2: foo,blah,11,z far,blah,5,x far,blah,5,x + * | | | + * ----------------------------------------------------- + * | + * 1: foo,bar,10,z // could have switched with #2 + * 2: foo,bar,10,x // could have switched with #1 + * 3: foo,blah,11,z + * 4: far,bar,7,a + * 5: far,blah,5,x // identical to #6 + * 6: far,blah,5,x // identical to #5 + * All interleaved filters are executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilters() + { + return $this->filters; + } + + /** + * The elements of "filters" all process a copy of the input row, and the + * results are pooled, sorted, and combined into a single output row. + * If multiple cells are produced with the same column and timestamp, + * they will all appear in the output row in an unspecified mutual order. + * Consider the following example, with three filters: + * input row + * | + * ----------------------------------------------------- + * | | | + * f(0) f(1) f(2) + * | | | + * 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + * 2: foo,blah,11,z far,blah,5,x far,blah,5,x + * | | | + * ----------------------------------------------------- + * | + * 1: foo,bar,10,z // could have switched with #2 + * 2: foo,bar,10,x // could have switched with #1 + * 3: foo,blah,11,z + * 4: far,bar,7,a + * 5: far,blah,5,x // identical to #6 + * 6: far,blah,5,x // identical to #5 + * All interleaved filters are executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + * @param array<\Google\Cloud\Bigtable\V2\RowFilter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->filters = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Interleave::class, \Google\Cloud\Bigtable\V2\RowFilter_Interleave::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowRange.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowRange.php new file mode 100644 index 000000000000..f4782f92295a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowRange.php @@ -0,0 +1,183 @@ +google.bigtable.v2.RowRange + */ +class RowRange extends \Google\Protobuf\Internal\Message +{ + protected $start_key; + protected $end_key; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $start_key_closed + * Used when giving an inclusive lower bound for the range. + * @type string $start_key_open + * Used when giving an exclusive lower bound for the range. + * @type string $end_key_open + * Used when giving an exclusive upper bound for the range. + * @type string $end_key_closed + * Used when giving an inclusive upper bound for the range. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * Used when giving an inclusive lower bound for the range. + * + * Generated from protobuf field bytes start_key_closed = 1; + * @return string + */ + public function getStartKeyClosed() + { + return $this->readOneof(1); + } + + public function hasStartKeyClosed() + { + return $this->hasOneof(1); + } + + /** + * Used when giving an inclusive lower bound for the range. + * + * Generated from protobuf field bytes start_key_closed = 1; + * @param string $var + * @return $this + */ + public function setStartKeyClosed($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Used when giving an exclusive lower bound for the range. + * + * Generated from protobuf field bytes start_key_open = 2; + * @return string + */ + public function getStartKeyOpen() + { + return $this->readOneof(2); + } + + public function hasStartKeyOpen() + { + return $this->hasOneof(2); + } + + /** + * Used when giving an exclusive lower bound for the range. + * + * Generated from protobuf field bytes start_key_open = 2; + * @param string $var + * @return $this + */ + public function setStartKeyOpen($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Used when giving an exclusive upper bound for the range. + * + * Generated from protobuf field bytes end_key_open = 3; + * @return string + */ + public function getEndKeyOpen() + { + return $this->readOneof(3); + } + + public function hasEndKeyOpen() + { + return $this->hasOneof(3); + } + + /** + * Used when giving an exclusive upper bound for the range. + * + * Generated from protobuf field bytes end_key_open = 3; + * @param string $var + * @return $this + */ + public function setEndKeyOpen($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Used when giving an inclusive upper bound for the range. + * + * Generated from protobuf field bytes end_key_closed = 4; + * @return string + */ + public function getEndKeyClosed() + { + return $this->readOneof(4); + } + + public function hasEndKeyClosed() + { + return $this->hasOneof(4); + } + + /** + * Used when giving an inclusive upper bound for the range. + * + * Generated from protobuf field bytes end_key_closed = 4; + * @param string $var + * @return $this + */ + public function setEndKeyClosed($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getStartKey() + { + return $this->whichOneof("start_key"); + } + + /** + * @return string + */ + public function getEndKey() + { + return $this->whichOneof("end_key"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowSet.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowSet.php new file mode 100644 index 000000000000..5c8335823bb8 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/RowSet.php @@ -0,0 +1,101 @@ +google.bigtable.v2.RowSet + */ +class RowSet extends \Google\Protobuf\Internal\Message +{ + /** + * Single rows included in the set. + * + * Generated from protobuf field repeated bytes row_keys = 1; + */ + private $row_keys; + /** + * Contiguous row ranges included in the set. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + private $row_ranges; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $row_keys + * Single rows included in the set. + * @type array<\Google\Cloud\Bigtable\V2\RowRange>|\Google\Protobuf\Internal\RepeatedField $row_ranges + * Contiguous row ranges included in the set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * Single rows included in the set. + * + * Generated from protobuf field repeated bytes row_keys = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRowKeys() + { + return $this->row_keys; + } + + /** + * Single rows included in the set. + * + * Generated from protobuf field repeated bytes row_keys = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRowKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); + $this->row_keys = $arr; + + return $this; + } + + /** + * Contiguous row ranges included in the set. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowRange row_ranges = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRowRanges() + { + return $this->row_ranges; + } + + /** + * Contiguous row ranges included in the set. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowRange row_ranges = 2; + * @param array<\Google\Cloud\Bigtable\V2\RowRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRowRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\RowRange::class); + $this->row_ranges = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/SampleRowKeysRequest.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/SampleRowKeysRequest.php new file mode 100644 index 000000000000..de1a618ad0bc --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/SampleRowKeysRequest.php @@ -0,0 +1,196 @@ +google.bigtable.v2.SampleRowKeysRequest + */ +class SampleRowKeysRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique name of the table from which to sample row keys. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $table_name = ''; + /** + * Optional. The unique name of the AuthorizedView from which to sample row + * keys. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $authorized_view_name = ''; + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2; + */ + protected $app_profile_id = ''; + + /** + * @param string $tableName Optional. The unique name of the table from which to sample row keys. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * + * @return \Google\Cloud\Bigtable\V2\SampleRowKeysRequest + * + * @experimental + */ + public static function build(string $tableName): self + { + return (new self()) + ->setTableName($tableName); + } + + /** + * @param string $tableName Optional. The unique name of the table from which to sample row keys. + * + * Values are of the form + * `projects//instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $appProfileId This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * @return \Google\Cloud\Bigtable\V2\SampleRowKeysRequest + * + * @experimental + */ + public static function buildFromTableNameAppProfileId(string $tableName, string $appProfileId): self + { + return (new self()) + ->setTableName($tableName) + ->setAppProfileId($appProfileId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * Optional. The unique name of the table from which to sample row keys. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $authorized_view_name + * Optional. The unique name of the AuthorizedView from which to sample row + * keys. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique name of the table from which to sample row keys. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getTableName() + { + return $this->table_name; + } + + /** + * Optional. The unique name of the table from which to sample row keys. + * Values are of the form + * `projects//instances//tables/
`. + * + * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTableName($var) + { + GPBUtil::checkString($var, True); + $this->table_name = $var; + + return $this; + } + + /** + * Optional. The unique name of the AuthorizedView from which to sample row + * keys. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAuthorizedViewName() + { + return $this->authorized_view_name; + } + + /** + * Optional. The unique name of the AuthorizedView from which to sample row + * keys. + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * + * Generated from protobuf field string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAuthorizedViewName($var) + { + GPBUtil::checkString($var, True); + $this->authorized_view_name = $var; + + return $this; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/SampleRowKeysResponse.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/SampleRowKeysResponse.php new file mode 100644 index 000000000000..1c38c831d343 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/SampleRowKeysResponse.php @@ -0,0 +1,137 @@ +google.bigtable.v2.SampleRowKeysResponse + */ +class SampleRowKeysResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Sorted streamed sequence of sample row keys in the table. The table might + * have contents before the first row key in the list and after the last one, + * but a key containing the empty string indicates "end of table" and will be + * the last response given, if present. + * Note that row keys in this list may not have ever been written to or read + * from, and users should therefore not make any assumptions about the row key + * structure that are specific to their use case. + * + * Generated from protobuf field bytes row_key = 1; + */ + protected $row_key = ''; + /** + * Approximate total storage space used by all rows in the table which precede + * `row_key`. Buffering the contents of all rows between two subsequent + * samples would require space roughly equal to the difference in their + * `offset_bytes` fields. + * + * Generated from protobuf field int64 offset_bytes = 2; + */ + protected $offset_bytes = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $row_key + * Sorted streamed sequence of sample row keys in the table. The table might + * have contents before the first row key in the list and after the last one, + * but a key containing the empty string indicates "end of table" and will be + * the last response given, if present. + * Note that row keys in this list may not have ever been written to or read + * from, and users should therefore not make any assumptions about the row key + * structure that are specific to their use case. + * @type int|string $offset_bytes + * Approximate total storage space used by all rows in the table which precede + * `row_key`. Buffering the contents of all rows between two subsequent + * samples would require space roughly equal to the difference in their + * `offset_bytes` fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Sorted streamed sequence of sample row keys in the table. The table might + * have contents before the first row key in the list and after the last one, + * but a key containing the empty string indicates "end of table" and will be + * the last response given, if present. + * Note that row keys in this list may not have ever been written to or read + * from, and users should therefore not make any assumptions about the row key + * structure that are specific to their use case. + * + * Generated from protobuf field bytes row_key = 1; + * @return string + */ + public function getRowKey() + { + return $this->row_key; + } + + /** + * Sorted streamed sequence of sample row keys in the table. The table might + * have contents before the first row key in the list and after the last one, + * but a key containing the empty string indicates "end of table" and will be + * the last response given, if present. + * Note that row keys in this list may not have ever been written to or read + * from, and users should therefore not make any assumptions about the row key + * structure that are specific to their use case. + * + * Generated from protobuf field bytes row_key = 1; + * @param string $var + * @return $this + */ + public function setRowKey($var) + { + GPBUtil::checkString($var, False); + $this->row_key = $var; + + return $this; + } + + /** + * Approximate total storage space used by all rows in the table which precede + * `row_key`. Buffering the contents of all rows between two subsequent + * samples would require space roughly equal to the difference in their + * `offset_bytes` fields. + * + * Generated from protobuf field int64 offset_bytes = 2; + * @return int|string + */ + public function getOffsetBytes() + { + return $this->offset_bytes; + } + + /** + * Approximate total storage space used by all rows in the table which precede + * `row_key`. Buffering the contents of all rows between two subsequent + * samples would require space roughly equal to the difference in their + * `offset_bytes` fields. + * + * Generated from protobuf field int64 offset_bytes = 2; + * @param int|string $var + * @return $this + */ + public function setOffsetBytes($var) + { + GPBUtil::checkInt64($var); + $this->offset_bytes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/StreamContinuationToken.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/StreamContinuationToken.php new file mode 100644 index 000000000000..9a623c62ebaa --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/StreamContinuationToken.php @@ -0,0 +1,113 @@ +google.bigtable.v2.StreamContinuationToken + */ +class StreamContinuationToken extends \Google\Protobuf\Internal\Message +{ + /** + * The partition that this token applies to. + * + * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 1; + */ + protected $partition = null; + /** + * An encoded position in the stream to restart reading from. + * + * Generated from protobuf field string token = 2; + */ + protected $token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\StreamPartition $partition + * The partition that this token applies to. + * @type string $token + * An encoded position in the stream to restart reading from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The partition that this token applies to. + * + * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 1; + * @return \Google\Cloud\Bigtable\V2\StreamPartition|null + */ + public function getPartition() + { + return $this->partition; + } + + public function hasPartition() + { + return isset($this->partition); + } + + public function clearPartition() + { + unset($this->partition); + } + + /** + * The partition that this token applies to. + * + * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 1; + * @param \Google\Cloud\Bigtable\V2\StreamPartition $var + * @return $this + */ + public function setPartition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\StreamPartition::class); + $this->partition = $var; + + return $this; + } + + /** + * An encoded position in the stream to restart reading from. + * + * Generated from protobuf field string token = 2; + * @return string + */ + public function getToken() + { + return $this->token; + } + + /** + * An encoded position in the stream to restart reading from. + * + * Generated from protobuf field string token = 2; + * @param string $var + * @return $this + */ + public function setToken($var) + { + GPBUtil::checkString($var, True); + $this->token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/StreamContinuationTokens.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/StreamContinuationTokens.php new file mode 100644 index 000000000000..471a816ecaeb --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/StreamContinuationTokens.php @@ -0,0 +1,69 @@ +google.bigtable.v2.StreamContinuationTokens + */ +class StreamContinuationTokens extends \Google\Protobuf\Internal\Message +{ + /** + * List of continuation tokens. + * + * Generated from protobuf field repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + private $tokens; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\V2\StreamContinuationToken>|\Google\Protobuf\Internal\RepeatedField $tokens + * List of continuation tokens. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * List of continuation tokens. + * + * Generated from protobuf field repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTokens() + { + return $this->tokens; + } + + /** + * List of continuation tokens. + * + * Generated from protobuf field repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + * @param array<\Google\Cloud\Bigtable\V2\StreamContinuationToken>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTokens($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\StreamContinuationToken::class); + $this->tokens = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/StreamPartition.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/StreamPartition.php new file mode 100644 index 000000000000..2efb7f58fd23 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/StreamPartition.php @@ -0,0 +1,82 @@ +google.bigtable.v2.StreamPartition + */ +class StreamPartition extends \Google\Protobuf\Internal\Message +{ + /** + * The row range covered by this partition and is specified by + * [`start_key_closed`, `end_key_open`). + * + * Generated from protobuf field .google.bigtable.v2.RowRange row_range = 1; + */ + protected $row_range = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\RowRange $row_range + * The row range covered by this partition and is specified by + * [`start_key_closed`, `end_key_open`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The row range covered by this partition and is specified by + * [`start_key_closed`, `end_key_open`). + * + * Generated from protobuf field .google.bigtable.v2.RowRange row_range = 1; + * @return \Google\Cloud\Bigtable\V2\RowRange|null + */ + public function getRowRange() + { + return $this->row_range; + } + + public function hasRowRange() + { + return isset($this->row_range); + } + + public function clearRowRange() + { + unset($this->row_range); + } + + /** + * The row range covered by this partition and is specified by + * [`start_key_closed`, `end_key_open`). + * + * Generated from protobuf field .google.bigtable.v2.RowRange row_range = 1; + * @param \Google\Cloud\Bigtable\V2\RowRange $var + * @return $this + */ + public function setRowRange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowRange::class); + $this->row_range = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/TimestampRange.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/TimestampRange.php new file mode 100644 index 000000000000..ddd1bcea30d4 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/TimestampRange.php @@ -0,0 +1,101 @@ +google.bigtable.v2.TimestampRange + */ +class TimestampRange extends \Google\Protobuf\Internal\Message +{ + /** + * Inclusive lower bound. If left empty, interpreted as 0. + * + * Generated from protobuf field int64 start_timestamp_micros = 1; + */ + protected $start_timestamp_micros = 0; + /** + * Exclusive upper bound. If left empty, interpreted as infinity. + * + * Generated from protobuf field int64 end_timestamp_micros = 2; + */ + protected $end_timestamp_micros = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $start_timestamp_micros + * Inclusive lower bound. If left empty, interpreted as 0. + * @type int|string $end_timestamp_micros + * Exclusive upper bound. If left empty, interpreted as infinity. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * Inclusive lower bound. If left empty, interpreted as 0. + * + * Generated from protobuf field int64 start_timestamp_micros = 1; + * @return int|string + */ + public function getStartTimestampMicros() + { + return $this->start_timestamp_micros; + } + + /** + * Inclusive lower bound. If left empty, interpreted as 0. + * + * Generated from protobuf field int64 start_timestamp_micros = 1; + * @param int|string $var + * @return $this + */ + public function setStartTimestampMicros($var) + { + GPBUtil::checkInt64($var); + $this->start_timestamp_micros = $var; + + return $this; + } + + /** + * Exclusive upper bound. If left empty, interpreted as infinity. + * + * Generated from protobuf field int64 end_timestamp_micros = 2; + * @return int|string + */ + public function getEndTimestampMicros() + { + return $this->end_timestamp_micros; + } + + /** + * Exclusive upper bound. If left empty, interpreted as infinity. + * + * Generated from protobuf field int64 end_timestamp_micros = 2; + * @param int|string $var + * @return $this + */ + public function setEndTimestampMicros($var) + { + GPBUtil::checkInt64($var); + $this->end_timestamp_micros = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type.php new file mode 100644 index 000000000000..0000b3ed8eba --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type.php @@ -0,0 +1,458 @@ + INT64(-1)`, but `STRING("-00001") > STRING("00001)`. + * * Self-delimiting: If we concatenate two encoded values, can we always tell + * where the first one ends and the second one begins? + * - Example: If we encode INT64s to fixed-width STRINGs, the first value + * will always contain exactly N digits, possibly preceded by a sign. + * - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have + * no way to tell where the first one ends. + * * Compatibility: Which other systems have matching encoding schemes? For + * example, does this encoding have a GoogleSQL equivalent? HBase? Java? + * + * Generated from protobuf message google.bigtable.v2.Type + */ +class Type extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type\Bytes $bytes_type + * Bytes + * @type \Google\Cloud\Bigtable\V2\Type\PBString $string_type + * String + * @type \Google\Cloud\Bigtable\V2\Type\Int64 $int64_type + * Int64 + * @type \Google\Cloud\Bigtable\V2\Type\Float32 $float32_type + * Float32 + * @type \Google\Cloud\Bigtable\V2\Type\Float64 $float64_type + * Float64 + * @type \Google\Cloud\Bigtable\V2\Type\PBBool $bool_type + * Bool + * @type \Google\Cloud\Bigtable\V2\Type\Timestamp $timestamp_type + * Timestamp + * @type \Google\Cloud\Bigtable\V2\Type\Date $date_type + * Date + * @type \Google\Cloud\Bigtable\V2\Type\Aggregate $aggregate_type + * Aggregate + * @type \Google\Cloud\Bigtable\V2\Type\Struct $struct_type + * Struct + * @type \Google\Cloud\Bigtable\V2\Type\PBArray $array_type + * Array + * @type \Google\Cloud\Bigtable\V2\Type\Map $map_type + * Map + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Bytes + * + * Generated from protobuf field .google.bigtable.v2.Type.Bytes bytes_type = 1; + * @return \Google\Cloud\Bigtable\V2\Type\Bytes|null + */ + public function getBytesType() + { + return $this->readOneof(1); + } + + public function hasBytesType() + { + return $this->hasOneof(1); + } + + /** + * Bytes + * + * Generated from protobuf field .google.bigtable.v2.Type.Bytes bytes_type = 1; + * @param \Google\Cloud\Bigtable\V2\Type\Bytes $var + * @return $this + */ + public function setBytesType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Bytes::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * String + * + * Generated from protobuf field .google.bigtable.v2.Type.String string_type = 2; + * @return \Google\Cloud\Bigtable\V2\Type\PBString|null + */ + public function getStringType() + { + return $this->readOneof(2); + } + + public function hasStringType() + { + return $this->hasOneof(2); + } + + /** + * String + * + * Generated from protobuf field .google.bigtable.v2.Type.String string_type = 2; + * @param \Google\Cloud\Bigtable\V2\Type\PBString $var + * @return $this + */ + public function setStringType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\PBString::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Int64 + * + * Generated from protobuf field .google.bigtable.v2.Type.Int64 int64_type = 5; + * @return \Google\Cloud\Bigtable\V2\Type\Int64|null + */ + public function getInt64Type() + { + return $this->readOneof(5); + } + + public function hasInt64Type() + { + return $this->hasOneof(5); + } + + /** + * Int64 + * + * Generated from protobuf field .google.bigtable.v2.Type.Int64 int64_type = 5; + * @param \Google\Cloud\Bigtable\V2\Type\Int64 $var + * @return $this + */ + public function setInt64Type($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Int64::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Float32 + * + * Generated from protobuf field .google.bigtable.v2.Type.Float32 float32_type = 12; + * @return \Google\Cloud\Bigtable\V2\Type\Float32|null + */ + public function getFloat32Type() + { + return $this->readOneof(12); + } + + public function hasFloat32Type() + { + return $this->hasOneof(12); + } + + /** + * Float32 + * + * Generated from protobuf field .google.bigtable.v2.Type.Float32 float32_type = 12; + * @param \Google\Cloud\Bigtable\V2\Type\Float32 $var + * @return $this + */ + public function setFloat32Type($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Float32::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Float64 + * + * Generated from protobuf field .google.bigtable.v2.Type.Float64 float64_type = 9; + * @return \Google\Cloud\Bigtable\V2\Type\Float64|null + */ + public function getFloat64Type() + { + return $this->readOneof(9); + } + + public function hasFloat64Type() + { + return $this->hasOneof(9); + } + + /** + * Float64 + * + * Generated from protobuf field .google.bigtable.v2.Type.Float64 float64_type = 9; + * @param \Google\Cloud\Bigtable\V2\Type\Float64 $var + * @return $this + */ + public function setFloat64Type($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Float64::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Bool + * + * Generated from protobuf field .google.bigtable.v2.Type.Bool bool_type = 8; + * @return \Google\Cloud\Bigtable\V2\Type\PBBool|null + */ + public function getBoolType() + { + return $this->readOneof(8); + } + + public function hasBoolType() + { + return $this->hasOneof(8); + } + + /** + * Bool + * + * Generated from protobuf field .google.bigtable.v2.Type.Bool bool_type = 8; + * @param \Google\Cloud\Bigtable\V2\Type\PBBool $var + * @return $this + */ + public function setBoolType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\PBBool::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Timestamp + * + * Generated from protobuf field .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + * @return \Google\Cloud\Bigtable\V2\Type\Timestamp|null + */ + public function getTimestampType() + { + return $this->readOneof(10); + } + + public function hasTimestampType() + { + return $this->hasOneof(10); + } + + /** + * Timestamp + * + * Generated from protobuf field .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + * @param \Google\Cloud\Bigtable\V2\Type\Timestamp $var + * @return $this + */ + public function setTimestampType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Timestamp::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Date + * + * Generated from protobuf field .google.bigtable.v2.Type.Date date_type = 11; + * @return \Google\Cloud\Bigtable\V2\Type\Date|null + */ + public function getDateType() + { + return $this->readOneof(11); + } + + public function hasDateType() + { + return $this->hasOneof(11); + } + + /** + * Date + * + * Generated from protobuf field .google.bigtable.v2.Type.Date date_type = 11; + * @param \Google\Cloud\Bigtable\V2\Type\Date $var + * @return $this + */ + public function setDateType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Date::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Aggregate + * + * Generated from protobuf field .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + * @return \Google\Cloud\Bigtable\V2\Type\Aggregate|null + */ + public function getAggregateType() + { + return $this->readOneof(6); + } + + public function hasAggregateType() + { + return $this->hasOneof(6); + } + + /** + * Aggregate + * + * Generated from protobuf field .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + * @param \Google\Cloud\Bigtable\V2\Type\Aggregate $var + * @return $this + */ + public function setAggregateType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Aggregate::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Struct + * + * Generated from protobuf field .google.bigtable.v2.Type.Struct struct_type = 7; + * @return \Google\Cloud\Bigtable\V2\Type\Struct|null + */ + public function getStructType() + { + return $this->readOneof(7); + } + + public function hasStructType() + { + return $this->hasOneof(7); + } + + /** + * Struct + * + * Generated from protobuf field .google.bigtable.v2.Type.Struct struct_type = 7; + * @param \Google\Cloud\Bigtable\V2\Type\Struct $var + * @return $this + */ + public function setStructType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Struct::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Array + * + * Generated from protobuf field .google.bigtable.v2.Type.Array array_type = 3; + * @return \Google\Cloud\Bigtable\V2\Type\PBArray|null + */ + public function getArrayType() + { + return $this->readOneof(3); + } + + public function hasArrayType() + { + return $this->hasOneof(3); + } + + /** + * Array + * + * Generated from protobuf field .google.bigtable.v2.Type.Array array_type = 3; + * @param \Google\Cloud\Bigtable\V2\Type\PBArray $var + * @return $this + */ + public function setArrayType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\PBArray::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Map + * + * Generated from protobuf field .google.bigtable.v2.Type.Map map_type = 4; + * @return \Google\Cloud\Bigtable\V2\Type\Map|null + */ + public function getMapType() + { + return $this->readOneof(4); + } + + public function hasMapType() + { + return $this->hasOneof(4); + } + + /** + * Map + * + * Generated from protobuf field .google.bigtable.v2.Type.Map map_type = 4; + * @param \Google\Cloud\Bigtable\V2\Type\Map $var + * @return $this + */ + public function setMapType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Map::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate.php new file mode 100644 index 000000000000..efd66b84d05b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate.php @@ -0,0 +1,284 @@ +google.bigtable.v2.Type.Aggregate + */ +class Aggregate extends \Google\Protobuf\Internal\Message +{ + /** + * Type of the inputs that are accumulated by this `Aggregate`, which must + * specify a full encoding. + * Use `AddInput` mutations to accumulate new inputs. + * + * Generated from protobuf field .google.bigtable.v2.Type input_type = 1; + */ + protected $input_type = null; + /** + * Output only. Type that holds the internal accumulator state for the + * `Aggregate`. This is a function of the `input_type` and `aggregator` + * chosen, and will always specify a full encoding. + * + * Generated from protobuf field .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state_type = null; + protected $aggregator; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type $input_type + * Type of the inputs that are accumulated by this `Aggregate`, which must + * specify a full encoding. + * Use `AddInput` mutations to accumulate new inputs. + * @type \Google\Cloud\Bigtable\V2\Type $state_type + * Output only. Type that holds the internal accumulator state for the + * `Aggregate`. This is a function of the `input_type` and `aggregator` + * chosen, and will always specify a full encoding. + * @type \Google\Cloud\Bigtable\V2\Type\Aggregate\Sum $sum + * Sum aggregator. + * @type \Google\Cloud\Bigtable\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount $hllpp_unique_count + * HyperLogLogPlusPlusUniqueCount aggregator. + * @type \Google\Cloud\Bigtable\V2\Type\Aggregate\Max $max + * Max aggregator. + * @type \Google\Cloud\Bigtable\V2\Type\Aggregate\Min $min + * Min aggregator. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Type of the inputs that are accumulated by this `Aggregate`, which must + * specify a full encoding. + * Use `AddInput` mutations to accumulate new inputs. + * + * Generated from protobuf field .google.bigtable.v2.Type input_type = 1; + * @return \Google\Cloud\Bigtable\V2\Type|null + */ + public function getInputType() + { + return $this->input_type; + } + + public function hasInputType() + { + return isset($this->input_type); + } + + public function clearInputType() + { + unset($this->input_type); + } + + /** + * Type of the inputs that are accumulated by this `Aggregate`, which must + * specify a full encoding. + * Use `AddInput` mutations to accumulate new inputs. + * + * Generated from protobuf field .google.bigtable.v2.Type input_type = 1; + * @param \Google\Cloud\Bigtable\V2\Type $var + * @return $this + */ + public function setInputType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type::class); + $this->input_type = $var; + + return $this; + } + + /** + * Output only. Type that holds the internal accumulator state for the + * `Aggregate`. This is a function of the `input_type` and `aggregator` + * chosen, and will always specify a full encoding. + * + * Generated from protobuf field .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Bigtable\V2\Type|null + */ + public function getStateType() + { + return $this->state_type; + } + + public function hasStateType() + { + return isset($this->state_type); + } + + public function clearStateType() + { + unset($this->state_type); + } + + /** + * Output only. Type that holds the internal accumulator state for the + * `Aggregate`. This is a function of the `input_type` and `aggregator` + * chosen, and will always specify a full encoding. + * + * Generated from protobuf field .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Bigtable\V2\Type $var + * @return $this + */ + public function setStateType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type::class); + $this->state_type = $var; + + return $this; + } + + /** + * Sum aggregator. + * + * Generated from protobuf field .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + * @return \Google\Cloud\Bigtable\V2\Type\Aggregate\Sum|null + */ + public function getSum() + { + return $this->readOneof(4); + } + + public function hasSum() + { + return $this->hasOneof(4); + } + + /** + * Sum aggregator. + * + * Generated from protobuf field .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + * @param \Google\Cloud\Bigtable\V2\Type\Aggregate\Sum $var + * @return $this + */ + public function setSum($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Aggregate\Sum::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * HyperLogLogPlusPlusUniqueCount aggregator. + * + * Generated from protobuf field .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * @return \Google\Cloud\Bigtable\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount|null + */ + public function getHllppUniqueCount() + { + return $this->readOneof(5); + } + + public function hasHllppUniqueCount() + { + return $this->hasOneof(5); + } + + /** + * HyperLogLogPlusPlusUniqueCount aggregator. + * + * Generated from protobuf field .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * @param \Google\Cloud\Bigtable\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount $var + * @return $this + */ + public function setHllppUniqueCount($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Max aggregator. + * + * Generated from protobuf field .google.bigtable.v2.Type.Aggregate.Max max = 6; + * @return \Google\Cloud\Bigtable\V2\Type\Aggregate\Max|null + */ + public function getMax() + { + return $this->readOneof(6); + } + + public function hasMax() + { + return $this->hasOneof(6); + } + + /** + * Max aggregator. + * + * Generated from protobuf field .google.bigtable.v2.Type.Aggregate.Max max = 6; + * @param \Google\Cloud\Bigtable\V2\Type\Aggregate\Max $var + * @return $this + */ + public function setMax($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Aggregate\Max::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Min aggregator. + * + * Generated from protobuf field .google.bigtable.v2.Type.Aggregate.Min min = 7; + * @return \Google\Cloud\Bigtable\V2\Type\Aggregate\Min|null + */ + public function getMin() + { + return $this->readOneof(7); + } + + public function hasMin() + { + return $this->hasOneof(7); + } + + /** + * Min aggregator. + * + * Generated from protobuf field .google.bigtable.v2.Type.Aggregate.Min min = 7; + * @param \Google\Cloud\Bigtable\V2\Type\Aggregate\Min $var + * @return $this + */ + public function setMin($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Aggregate\Min::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getAggregator() + { + return $this->whichOneof("aggregator"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Aggregate::class, \Google\Cloud\Bigtable\V2\Type_Aggregate::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/HyperLogLogPlusPlusUniqueCount.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/HyperLogLogPlusPlusUniqueCount.php new file mode 100644 index 000000000000..4c4bfed012b3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/HyperLogLogPlusPlusUniqueCount.php @@ -0,0 +1,42 @@ +google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + */ +class HyperLogLogPlusPlusUniqueCount extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HyperLogLogPlusPlusUniqueCount::class, \Google\Cloud\Bigtable\V2\Type_Aggregate_HyperLogLogPlusPlusUniqueCount::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/Max.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/Max.php new file mode 100644 index 000000000000..eb735d381cdf --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/Max.php @@ -0,0 +1,38 @@ +google.bigtable.v2.Type.Aggregate.Max + */ +class Max extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Max::class, \Google\Cloud\Bigtable\V2\Type_Aggregate_Max::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/Min.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/Min.php new file mode 100644 index 000000000000..13500014fafb --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/Min.php @@ -0,0 +1,38 @@ +google.bigtable.v2.Type.Aggregate.Min + */ +class Min extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Min::class, \Google\Cloud\Bigtable\V2\Type_Aggregate_Min::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/Sum.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/Sum.php new file mode 100644 index 000000000000..df53d9cbe95f --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Aggregate/Sum.php @@ -0,0 +1,38 @@ +google.bigtable.v2.Type.Aggregate.Sum + */ +class Sum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Sum::class, \Google\Cloud\Bigtable\V2\Type_Aggregate_Sum::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Bytes.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Bytes.php new file mode 100644 index 000000000000..d917db5a3ce1 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Bytes.php @@ -0,0 +1,81 @@ +google.bigtable.v2.Type.Bytes + */ +class Bytes extends \Google\Protobuf\Internal\Message +{ + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + */ + protected $encoding = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding $encoding + * The encoding to use when converting to/from lower level types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + * @return \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding|null + */ + public function getEncoding() + { + return $this->encoding; + } + + public function hasEncoding() + { + return isset($this->encoding); + } + + public function clearEncoding() + { + unset($this->encoding); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + * @param \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding $var + * @return $this + */ + public function setEncoding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding::class); + $this->encoding = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Bytes::class, \Google\Cloud\Bigtable\V2\Type_Bytes::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Bytes/Encoding.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Bytes/Encoding.php new file mode 100644 index 000000000000..c42a574fe96a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Bytes/Encoding.php @@ -0,0 +1,78 @@ +google.bigtable.v2.Type.Bytes.Encoding + */ +class Encoding extends \Google\Protobuf\Internal\Message +{ + protected $encoding; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding\Raw $raw + * Use `Raw` encoding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Use `Raw` encoding. + * + * Generated from protobuf field .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + * @return \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding\Raw|null + */ + public function getRaw() + { + return $this->readOneof(1); + } + + public function hasRaw() + { + return $this->hasOneof(1); + } + + /** + * Use `Raw` encoding. + * + * Generated from protobuf field .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + * @param \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding\Raw $var + * @return $this + */ + public function setRaw($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding\Raw::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getEncoding() + { + return $this->whichOneof("encoding"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Encoding::class, \Google\Cloud\Bigtable\V2\Type_Bytes_Encoding::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Bytes/Encoding/Raw.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Bytes/Encoding/Raw.php new file mode 100644 index 000000000000..ac7f617bb59c --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Bytes/Encoding/Raw.php @@ -0,0 +1,39 @@ +google.bigtable.v2.Type.Bytes.Encoding.Raw + */ +class Raw extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Raw::class, \Google\Cloud\Bigtable\V2\Type_Bytes_Encoding_Raw::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Date.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Date.php new file mode 100644 index 000000000000..fdcf13439190 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Date.php @@ -0,0 +1,37 @@ +google.bigtable.v2.Type.Date + */ +class Date extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Date::class, \Google\Cloud\Bigtable\V2\Type_Date::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Float32.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Float32.php new file mode 100644 index 000000000000..fb0d845917a3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Float32.php @@ -0,0 +1,37 @@ +google.bigtable.v2.Type.Float32 + */ +class Float32 extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Float32::class, \Google\Cloud\Bigtable\V2\Type_Float32::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Float64.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Float64.php new file mode 100644 index 000000000000..d8e9770f447a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Float64.php @@ -0,0 +1,37 @@ +google.bigtable.v2.Type.Float64 + */ +class Float64 extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Float64::class, \Google\Cloud\Bigtable\V2\Type_Float64::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Int64.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Int64.php new file mode 100644 index 000000000000..f535202b8c73 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Int64.php @@ -0,0 +1,81 @@ +google.bigtable.v2.Type.Int64 + */ +class Int64 extends \Google\Protobuf\Internal\Message +{ + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + */ + protected $encoding = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type\Int64\Encoding $encoding + * The encoding to use when converting to/from lower level types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + * @return \Google\Cloud\Bigtable\V2\Type\Int64\Encoding|null + */ + public function getEncoding() + { + return $this->encoding; + } + + public function hasEncoding() + { + return isset($this->encoding); + } + + public function clearEncoding() + { + unset($this->encoding); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + * @param \Google\Cloud\Bigtable\V2\Type\Int64\Encoding $var + * @return $this + */ + public function setEncoding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Int64\Encoding::class); + $this->encoding = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Int64::class, \Google\Cloud\Bigtable\V2\Type_Int64::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Int64/Encoding.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Int64/Encoding.php new file mode 100644 index 000000000000..e9cf46b73553 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Int64/Encoding.php @@ -0,0 +1,78 @@ +google.bigtable.v2.Type.Int64.Encoding + */ +class Encoding extends \Google\Protobuf\Internal\Message +{ + protected $encoding; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type\Int64\Encoding\BigEndianBytes $big_endian_bytes + * Use `BigEndianBytes` encoding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Use `BigEndianBytes` encoding. + * + * Generated from protobuf field .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * @return \Google\Cloud\Bigtable\V2\Type\Int64\Encoding\BigEndianBytes|null + */ + public function getBigEndianBytes() + { + return $this->readOneof(1); + } + + public function hasBigEndianBytes() + { + return $this->hasOneof(1); + } + + /** + * Use `BigEndianBytes` encoding. + * + * Generated from protobuf field .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * @param \Google\Cloud\Bigtable\V2\Type\Int64\Encoding\BigEndianBytes $var + * @return $this + */ + public function setBigEndianBytes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Int64\Encoding\BigEndianBytes::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getEncoding() + { + return $this->whichOneof("encoding"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Encoding::class, \Google\Cloud\Bigtable\V2\Type_Int64_Encoding::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Int64/Encoding/BigEndianBytes.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Int64/Encoding/BigEndianBytes.php new file mode 100644 index 000000000000..50020d3b2248 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Int64/Encoding/BigEndianBytes.php @@ -0,0 +1,87 @@ +google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + */ +class BigEndianBytes extends \Google\Protobuf\Internal\Message +{ + /** + * Deprecated: ignored if set. + * + * Generated from protobuf field .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + protected $bytes_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type\Bytes $bytes_type + * Deprecated: ignored if set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Deprecated: ignored if set. + * + * Generated from protobuf field .google.bigtable.v2.Type.Bytes bytes_type = 1; + * @return \Google\Cloud\Bigtable\V2\Type\Bytes|null + */ + public function getBytesType() + { + return $this->bytes_type; + } + + public function hasBytesType() + { + return isset($this->bytes_type); + } + + public function clearBytesType() + { + unset($this->bytes_type); + } + + /** + * Deprecated: ignored if set. + * + * Generated from protobuf field .google.bigtable.v2.Type.Bytes bytes_type = 1; + * @param \Google\Cloud\Bigtable\V2\Type\Bytes $var + * @return $this + */ + public function setBytesType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Bytes::class); + $this->bytes_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BigEndianBytes::class, \Google\Cloud\Bigtable\V2\Type_Int64_Encoding_BigEndianBytes::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Map.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Map.php new file mode 100644 index 000000000000..3e1ca5948521 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Map.php @@ -0,0 +1,134 @@ +google.bigtable.v2.Type.Map + */ +class Map extends \Google\Protobuf\Internal\Message +{ + /** + * The type of a map key. + * Only `Bytes`, `String`, and `Int64` are allowed as key types. + * + * Generated from protobuf field .google.bigtable.v2.Type key_type = 1; + */ + protected $key_type = null; + /** + * The type of the values in a map. + * + * Generated from protobuf field .google.bigtable.v2.Type value_type = 2; + */ + protected $value_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type $key_type + * The type of a map key. + * Only `Bytes`, `String`, and `Int64` are allowed as key types. + * @type \Google\Cloud\Bigtable\V2\Type $value_type + * The type of the values in a map. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The type of a map key. + * Only `Bytes`, `String`, and `Int64` are allowed as key types. + * + * Generated from protobuf field .google.bigtable.v2.Type key_type = 1; + * @return \Google\Cloud\Bigtable\V2\Type|null + */ + public function getKeyType() + { + return $this->key_type; + } + + public function hasKeyType() + { + return isset($this->key_type); + } + + public function clearKeyType() + { + unset($this->key_type); + } + + /** + * The type of a map key. + * Only `Bytes`, `String`, and `Int64` are allowed as key types. + * + * Generated from protobuf field .google.bigtable.v2.Type key_type = 1; + * @param \Google\Cloud\Bigtable\V2\Type $var + * @return $this + */ + public function setKeyType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type::class); + $this->key_type = $var; + + return $this; + } + + /** + * The type of the values in a map. + * + * Generated from protobuf field .google.bigtable.v2.Type value_type = 2; + * @return \Google\Cloud\Bigtable\V2\Type|null + */ + public function getValueType() + { + return $this->value_type; + } + + public function hasValueType() + { + return isset($this->value_type); + } + + public function clearValueType() + { + unset($this->value_type); + } + + /** + * The type of the values in a map. + * + * Generated from protobuf field .google.bigtable.v2.Type value_type = 2; + * @param \Google\Cloud\Bigtable\V2\Type $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type::class); + $this->value_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Map::class, \Google\Cloud\Bigtable\V2\Type_Map::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBArray.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBArray.php new file mode 100644 index 000000000000..71bbb92cadac --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBArray.php @@ -0,0 +1,81 @@ +google.bigtable.v2.Type.Array + */ +class PBArray extends \Google\Protobuf\Internal\Message +{ + /** + * The type of the elements in the array. This must not be `Array`. + * + * Generated from protobuf field .google.bigtable.v2.Type element_type = 1; + */ + protected $element_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type $element_type + * The type of the elements in the array. This must not be `Array`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The type of the elements in the array. This must not be `Array`. + * + * Generated from protobuf field .google.bigtable.v2.Type element_type = 1; + * @return \Google\Cloud\Bigtable\V2\Type|null + */ + public function getElementType() + { + return $this->element_type; + } + + public function hasElementType() + { + return isset($this->element_type); + } + + public function clearElementType() + { + unset($this->element_type); + } + + /** + * The type of the elements in the array. This must not be `Array`. + * + * Generated from protobuf field .google.bigtable.v2.Type element_type = 1; + * @param \Google\Cloud\Bigtable\V2\Type $var + * @return $this + */ + public function setElementType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type::class); + $this->element_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBArray::class, \Google\Cloud\Bigtable\V2\Type_Array::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBBool.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBBool.php new file mode 100644 index 000000000000..9de6cd8f9cab --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBBool.php @@ -0,0 +1,37 @@ +google.bigtable.v2.Type.Bool + */ +class PBBool extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBBool::class, \Google\Cloud\Bigtable\V2\Type_Bool::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString.php new file mode 100644 index 000000000000..fbb2f0da8c4a --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString.php @@ -0,0 +1,81 @@ +google.bigtable.v2.Type.String + */ +class PBString extends \Google\Protobuf\Internal\Message +{ + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.v2.Type.String.Encoding encoding = 1; + */ + protected $encoding = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type\PBString\Encoding $encoding + * The encoding to use when converting to/from lower level types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.v2.Type.String.Encoding encoding = 1; + * @return \Google\Cloud\Bigtable\V2\Type\PBString\Encoding|null + */ + public function getEncoding() + { + return $this->encoding; + } + + public function hasEncoding() + { + return isset($this->encoding); + } + + public function clearEncoding() + { + unset($this->encoding); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.v2.Type.String.Encoding encoding = 1; + * @param \Google\Cloud\Bigtable\V2\Type\PBString\Encoding $var + * @return $this + */ + public function setEncoding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\PBString\Encoding::class); + $this->encoding = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBString::class, \Google\Cloud\Bigtable\V2\Type_String::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString/Encoding.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString/Encoding.php new file mode 100644 index 000000000000..a1c87729cc70 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString/Encoding.php @@ -0,0 +1,116 @@ +google.bigtable.v2.Type.String.Encoding + */ +class Encoding extends \Google\Protobuf\Internal\Message +{ + protected $encoding; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type\PBString\Encoding\Utf8Raw $utf8_raw + * Deprecated: if set, converts to an empty `utf8_bytes`. + * @type \Google\Cloud\Bigtable\V2\Type\PBString\Encoding\Utf8Bytes $utf8_bytes + * Use `Utf8Bytes` encoding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Deprecated: if set, converts to an empty `utf8_bytes`. + * + * Generated from protobuf field .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * @return \Google\Cloud\Bigtable\V2\Type\PBString\Encoding\Utf8Raw|null + * @deprecated + */ + public function getUtf8Raw() + { + @trigger_error('utf8_raw is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(1); + } + + public function hasUtf8Raw() + { + @trigger_error('utf8_raw is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(1); + } + + /** + * Deprecated: if set, converts to an empty `utf8_bytes`. + * + * Generated from protobuf field .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * @param \Google\Cloud\Bigtable\V2\Type\PBString\Encoding\Utf8Raw $var + * @return $this + * @deprecated + */ + public function setUtf8Raw($var) + { + @trigger_error('utf8_raw is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\PBString\Encoding\Utf8Raw::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Use `Utf8Bytes` encoding. + * + * Generated from protobuf field .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * @return \Google\Cloud\Bigtable\V2\Type\PBString\Encoding\Utf8Bytes|null + */ + public function getUtf8Bytes() + { + return $this->readOneof(2); + } + + public function hasUtf8Bytes() + { + return $this->hasOneof(2); + } + + /** + * Use `Utf8Bytes` encoding. + * + * Generated from protobuf field .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * @param \Google\Cloud\Bigtable\V2\Type\PBString\Encoding\Utf8Bytes $var + * @return $this + */ + public function setUtf8Bytes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\PBString\Encoding\Utf8Bytes::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getEncoding() + { + return $this->whichOneof("encoding"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Encoding::class, \Google\Cloud\Bigtable\V2\Type_String_Encoding::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString/Encoding/Utf8Bytes.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString/Encoding/Utf8Bytes.php new file mode 100644 index 000000000000..998216c290b9 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString/Encoding/Utf8Bytes.php @@ -0,0 +1,42 @@ +google.bigtable.v2.Type.String.Encoding.Utf8Bytes + */ +class Utf8Bytes extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Utf8Bytes::class, \Google\Cloud\Bigtable\V2\Type_String_Encoding_Utf8Bytes::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString/Encoding/Utf8Raw.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString/Encoding/Utf8Raw.php new file mode 100644 index 000000000000..22a1bf75dcaa --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/PBString/Encoding/Utf8Raw.php @@ -0,0 +1,37 @@ +google.bigtable.v2.Type.String.Encoding.Utf8Raw + */ +class Utf8Raw extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Utf8Raw::class, \Google\Cloud\Bigtable\V2\Type_String_Encoding_Utf8Raw::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Struct.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Struct.php new file mode 100644 index 000000000000..01b9fbc598fa --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Struct.php @@ -0,0 +1,73 @@ +google.bigtable.v2.Type.Struct + */ +class Struct extends \Google\Protobuf\Internal\Message +{ + /** + * The names and types of the fields in this struct. + * + * Generated from protobuf field repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + private $fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Bigtable\V2\Type\Struct\Field>|\Google\Protobuf\Internal\RepeatedField $fields + * The names and types of the fields in this struct. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The names and types of the fields in this struct. + * + * Generated from protobuf field repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * The names and types of the fields in this struct. + * + * Generated from protobuf field repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + * @param array<\Google\Cloud\Bigtable\V2\Type\Struct\Field>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Type\Struct\Field::class); + $this->fields = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Struct::class, \Google\Cloud\Bigtable\V2\Type_Struct::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Struct/Field.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Struct/Field.php new file mode 100644 index 000000000000..0aa221b2a746 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Struct/Field.php @@ -0,0 +1,118 @@ +google.bigtable.v2.Type.Struct.Field + */ +class Field extends \Google\Protobuf\Internal\Message +{ + /** + * The field name (optional). Fields without a `field_name` are considered + * anonymous and cannot be referenced by name. + * + * Generated from protobuf field string field_name = 1; + */ + protected $field_name = ''; + /** + * The type of values in this field. + * + * Generated from protobuf field .google.bigtable.v2.Type type = 2; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field_name + * The field name (optional). Fields without a `field_name` are considered + * anonymous and cannot be referenced by name. + * @type \Google\Cloud\Bigtable\V2\Type $type + * The type of values in this field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The field name (optional). Fields without a `field_name` are considered + * anonymous and cannot be referenced by name. + * + * Generated from protobuf field string field_name = 1; + * @return string + */ + public function getFieldName() + { + return $this->field_name; + } + + /** + * The field name (optional). Fields without a `field_name` are considered + * anonymous and cannot be referenced by name. + * + * Generated from protobuf field string field_name = 1; + * @param string $var + * @return $this + */ + public function setFieldName($var) + { + GPBUtil::checkString($var, True); + $this->field_name = $var; + + return $this; + } + + /** + * The type of values in this field. + * + * Generated from protobuf field .google.bigtable.v2.Type type = 2; + * @return \Google\Cloud\Bigtable\V2\Type|null + */ + public function getType() + { + return $this->type; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The type of values in this field. + * + * Generated from protobuf field .google.bigtable.v2.Type type = 2; + * @param \Google\Cloud\Bigtable\V2\Type $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type::class); + $this->type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Field::class, \Google\Cloud\Bigtable\V2\Type_Struct_Field::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Timestamp.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Timestamp.php new file mode 100644 index 000000000000..3c437f884597 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Type/Timestamp.php @@ -0,0 +1,37 @@ +google.bigtable.v2.Type.Timestamp + */ +class Timestamp extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Timestamp::class, \Google\Cloud\Bigtable\V2\Type_Timestamp::class); + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Value.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Value.php new file mode 100644 index 000000000000..d35a8ede4c5b --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/Value.php @@ -0,0 +1,477 @@ +google.bigtable.v2.Value + */ +class Value extends \Google\Protobuf\Internal\Message +{ + /** + * The verified `Type` of this `Value`, if it cannot be inferred. + * Read results will never specify the encoding for `type` since the value + * will already have been decoded by the server. Furthermore, the `type` will + * be omitted entirely if it can be inferred from a previous response. The + * exact semantics for inferring `type` will vary, and are therefore + * documented separately for each read method. + * When using composite types (Struct, Array, Map) only the outermost `Value` + * will specify the `type`. This top-level `type` will define the types for + * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs. + * If a nested `Value` provides a `type` on write, the request will be + * rejected with INVALID_ARGUMENT. + * + * Generated from protobuf field .google.bigtable.v2.Type type = 7; + */ + protected $type = null; + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Type $type + * The verified `Type` of this `Value`, if it cannot be inferred. + * Read results will never specify the encoding for `type` since the value + * will already have been decoded by the server. Furthermore, the `type` will + * be omitted entirely if it can be inferred from a previous response. The + * exact semantics for inferring `type` will vary, and are therefore + * documented separately for each read method. + * When using composite types (Struct, Array, Map) only the outermost `Value` + * will specify the `type`. This top-level `type` will define the types for + * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs. + * If a nested `Value` provides a `type` on write, the request will be + * rejected with INVALID_ARGUMENT. + * @type string $raw_value + * Represents a raw byte sequence with no type information. + * The `type` field must be omitted. + * @type int|string $raw_timestamp_micros + * Represents a raw cell timestamp with no type information. + * The `type` field must be omitted. + * @type string $bytes_value + * Represents a typed value transported as a byte sequence. + * @type string $string_value + * Represents a typed value transported as a string. + * @type int|string $int_value + * Represents a typed value transported as an integer. + * @type bool $bool_value + * Represents a typed value transported as a boolean. + * @type float $float_value + * Represents a typed value transported as a floating point number. + * @type \Google\Protobuf\Timestamp $timestamp_value + * Represents a typed value transported as a timestamp. + * @type \Google\Type\Date $date_value + * Represents a typed value transported as a date. + * @type \Google\Cloud\Bigtable\V2\ArrayValue $array_value + * Represents a typed value transported as a sequence of values. + * To differentiate between `Struct`, `Array`, and `Map`, the outermost + * `Value` must provide an explicit `type` on write. This `type` will + * apply recursively to the nested `Struct` fields, `Array` elements, + * or `Map` key/value pairs, which *must not* supply their own `type`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The verified `Type` of this `Value`, if it cannot be inferred. + * Read results will never specify the encoding for `type` since the value + * will already have been decoded by the server. Furthermore, the `type` will + * be omitted entirely if it can be inferred from a previous response. The + * exact semantics for inferring `type` will vary, and are therefore + * documented separately for each read method. + * When using composite types (Struct, Array, Map) only the outermost `Value` + * will specify the `type`. This top-level `type` will define the types for + * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs. + * If a nested `Value` provides a `type` on write, the request will be + * rejected with INVALID_ARGUMENT. + * + * Generated from protobuf field .google.bigtable.v2.Type type = 7; + * @return \Google\Cloud\Bigtable\V2\Type|null + */ + public function getType() + { + return $this->type; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The verified `Type` of this `Value`, if it cannot be inferred. + * Read results will never specify the encoding for `type` since the value + * will already have been decoded by the server. Furthermore, the `type` will + * be omitted entirely if it can be inferred from a previous response. The + * exact semantics for inferring `type` will vary, and are therefore + * documented separately for each read method. + * When using composite types (Struct, Array, Map) only the outermost `Value` + * will specify the `type`. This top-level `type` will define the types for + * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs. + * If a nested `Value` provides a `type` on write, the request will be + * rejected with INVALID_ARGUMENT. + * + * Generated from protobuf field .google.bigtable.v2.Type type = 7; + * @param \Google\Cloud\Bigtable\V2\Type $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Represents a raw byte sequence with no type information. + * The `type` field must be omitted. + * + * Generated from protobuf field bytes raw_value = 8; + * @return string + */ + public function getRawValue() + { + return $this->readOneof(8); + } + + public function hasRawValue() + { + return $this->hasOneof(8); + } + + /** + * Represents a raw byte sequence with no type information. + * The `type` field must be omitted. + * + * Generated from protobuf field bytes raw_value = 8; + * @param string $var + * @return $this + */ + public function setRawValue($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Represents a raw cell timestamp with no type information. + * The `type` field must be omitted. + * + * Generated from protobuf field int64 raw_timestamp_micros = 9; + * @return int|string + */ + public function getRawTimestampMicros() + { + return $this->readOneof(9); + } + + public function hasRawTimestampMicros() + { + return $this->hasOneof(9); + } + + /** + * Represents a raw cell timestamp with no type information. + * The `type` field must be omitted. + * + * Generated from protobuf field int64 raw_timestamp_micros = 9; + * @param int|string $var + * @return $this + */ + public function setRawTimestampMicros($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Represents a typed value transported as a byte sequence. + * + * Generated from protobuf field bytes bytes_value = 2; + * @return string + */ + public function getBytesValue() + { + return $this->readOneof(2); + } + + public function hasBytesValue() + { + return $this->hasOneof(2); + } + + /** + * Represents a typed value transported as a byte sequence. + * + * Generated from protobuf field bytes bytes_value = 2; + * @param string $var + * @return $this + */ + public function setBytesValue($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Represents a typed value transported as a string. + * + * Generated from protobuf field string string_value = 3; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(3); + } + + public function hasStringValue() + { + return $this->hasOneof(3); + } + + /** + * Represents a typed value transported as a string. + * + * Generated from protobuf field string string_value = 3; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Represents a typed value transported as an integer. + * + * Generated from protobuf field int64 int_value = 6; + * @return int|string + */ + public function getIntValue() + { + return $this->readOneof(6); + } + + public function hasIntValue() + { + return $this->hasOneof(6); + } + + /** + * Represents a typed value transported as an integer. + * + * Generated from protobuf field int64 int_value = 6; + * @param int|string $var + * @return $this + */ + public function setIntValue($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Represents a typed value transported as a boolean. + * + * Generated from protobuf field bool bool_value = 10; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(10); + } + + public function hasBoolValue() + { + return $this->hasOneof(10); + } + + /** + * Represents a typed value transported as a boolean. + * + * Generated from protobuf field bool bool_value = 10; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Represents a typed value transported as a floating point number. + * + * Generated from protobuf field double float_value = 11; + * @return float + */ + public function getFloatValue() + { + return $this->readOneof(11); + } + + public function hasFloatValue() + { + return $this->hasOneof(11); + } + + /** + * Represents a typed value transported as a floating point number. + * + * Generated from protobuf field double float_value = 11; + * @param float $var + * @return $this + */ + public function setFloatValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Represents a typed value transported as a timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 12; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTimestampValue() + { + return $this->readOneof(12); + } + + public function hasTimestampValue() + { + return $this->hasOneof(12); + } + + /** + * Represents a typed value transported as a timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 12; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTimestampValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Represents a typed value transported as a date. + * + * Generated from protobuf field .google.type.Date date_value = 13; + * @return \Google\Type\Date|null + */ + public function getDateValue() + { + return $this->readOneof(13); + } + + public function hasDateValue() + { + return $this->hasOneof(13); + } + + /** + * Represents a typed value transported as a date. + * + * Generated from protobuf field .google.type.Date date_value = 13; + * @param \Google\Type\Date $var + * @return $this + */ + public function setDateValue($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Represents a typed value transported as a sequence of values. + * To differentiate between `Struct`, `Array`, and `Map`, the outermost + * `Value` must provide an explicit `type` on write. This `type` will + * apply recursively to the nested `Struct` fields, `Array` elements, + * or `Map` key/value pairs, which *must not* supply their own `type`. + * + * Generated from protobuf field .google.bigtable.v2.ArrayValue array_value = 4; + * @return \Google\Cloud\Bigtable\V2\ArrayValue|null + */ + public function getArrayValue() + { + return $this->readOneof(4); + } + + public function hasArrayValue() + { + return $this->hasOneof(4); + } + + /** + * Represents a typed value transported as a sequence of values. + * To differentiate between `Struct`, `Array`, and `Map`, the outermost + * `Value` must provide an explicit `type` on write. This `type` will + * apply recursively to the nested `Struct` fields, `Array` elements, + * or `Map` key/value pairs, which *must not* supply their own `type`. + * + * Generated from protobuf field .google.bigtable.v2.ArrayValue array_value = 4; + * @param \Google\Cloud\Bigtable\V2\ArrayValue $var + * @return $this + */ + public function setArrayValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ArrayValue::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ValueRange.php b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ValueRange.php new file mode 100644 index 000000000000..a3dc913e427c --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/proto/src/Google/Cloud/Bigtable/V2/ValueRange.php @@ -0,0 +1,183 @@ +google.bigtable.v2.ValueRange + */ +class ValueRange extends \Google\Protobuf\Internal\Message +{ + protected $start_value; + protected $end_value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $start_value_closed + * Used when giving an inclusive lower bound for the range. + * @type string $start_value_open + * Used when giving an exclusive lower bound for the range. + * @type string $end_value_closed + * Used when giving an inclusive upper bound for the range. + * @type string $end_value_open + * Used when giving an exclusive upper bound for the range. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * Used when giving an inclusive lower bound for the range. + * + * Generated from protobuf field bytes start_value_closed = 1; + * @return string + */ + public function getStartValueClosed() + { + return $this->readOneof(1); + } + + public function hasStartValueClosed() + { + return $this->hasOneof(1); + } + + /** + * Used when giving an inclusive lower bound for the range. + * + * Generated from protobuf field bytes start_value_closed = 1; + * @param string $var + * @return $this + */ + public function setStartValueClosed($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Used when giving an exclusive lower bound for the range. + * + * Generated from protobuf field bytes start_value_open = 2; + * @return string + */ + public function getStartValueOpen() + { + return $this->readOneof(2); + } + + public function hasStartValueOpen() + { + return $this->hasOneof(2); + } + + /** + * Used when giving an exclusive lower bound for the range. + * + * Generated from protobuf field bytes start_value_open = 2; + * @param string $var + * @return $this + */ + public function setStartValueOpen($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Used when giving an inclusive upper bound for the range. + * + * Generated from protobuf field bytes end_value_closed = 3; + * @return string + */ + public function getEndValueClosed() + { + return $this->readOneof(3); + } + + public function hasEndValueClosed() + { + return $this->hasOneof(3); + } + + /** + * Used when giving an inclusive upper bound for the range. + * + * Generated from protobuf field bytes end_value_closed = 3; + * @param string $var + * @return $this + */ + public function setEndValueClosed($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Used when giving an exclusive upper bound for the range. + * + * Generated from protobuf field bytes end_value_open = 4; + * @return string + */ + public function getEndValueOpen() + { + return $this->readOneof(4); + } + + public function hasEndValueOpen() + { + return $this->hasOneof(4); + } + + /** + * Used when giving an exclusive upper bound for the range. + * + * Generated from protobuf field bytes end_value_open = 4; + * @param string $var + * @return $this + */ + public function setEndValueOpen($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getStartValue() + { + return $this->whichOneof("start_value"); + } + + /** + * @return string + */ + public function getEndValue() + { + return $this->whichOneof("end_value"); + } + +} + diff --git a/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/check_and_mutate_row.php b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/check_and_mutate_row.php new file mode 100644 index 000000000000..a82003186c39 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/check_and_mutate_row.php @@ -0,0 +1,79 @@ +/instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $rowKey The key of the row to which the conditional mutation should be + * applied. + */ +function check_and_mutate_row_sample(string $formattedTableName, string $rowKey): void +{ + // Create a client. + $bigtableClient = new BigtableClient(); + + // Prepare the request message. + $request = (new CheckAndMutateRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey); + + // Call the API and handle any network failures. + try { + /** @var CheckAndMutateRowResponse $response */ + $response = $bigtableClient->checkAndMutateRow($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTableName = BigtableClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $rowKey = '...'; + + check_and_mutate_row_sample($formattedTableName, $rowKey); +} +// [END bigtable_v2_generated_Bigtable_CheckAndMutateRow_sync] diff --git a/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/execute_query.php b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/execute_query.php new file mode 100644 index 000000000000..166de231d987 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/execute_query.php @@ -0,0 +1,83 @@ +/instances/` + * Please see {@see BigtableClient::instanceName()} for help formatting this field. + * @param string $query The query string. + */ +function execute_query_sample(string $formattedInstanceName, string $query): void +{ + // Create a client. + $bigtableClient = new BigtableClient(); + + // Prepare the request message. + $params = []; + $request = (new ExecuteQueryRequest()) + ->setInstanceName($formattedInstanceName) + ->setQuery($query) + ->setParams($params); + + // Call the API and handle any network failures. + try { + /** @var ServerStream $stream */ + $stream = $bigtableClient->executeQuery($request); + + /** @var ExecuteQueryResponse $element */ + foreach ($stream->readAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedInstanceName = BigtableClient::instanceName('[PROJECT]', '[INSTANCE]'); + $query = '[QUERY]'; + + execute_query_sample($formattedInstanceName, $query); +} +// [END bigtable_v2_generated_Bigtable_ExecuteQuery_sync] diff --git a/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/generate_initial_change_stream_partitions.php b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/generate_initial_change_stream_partitions.php new file mode 100644 index 000000000000..9c2f00e074a3 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/generate_initial_change_stream_partitions.php @@ -0,0 +1,82 @@ +/instances//tables/
`. + * Change streaming must be enabled on the table. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + */ +function generate_initial_change_stream_partitions_sample(string $formattedTableName): void +{ + // Create a client. + $bigtableClient = new BigtableClient(); + + // Prepare the request message. + $request = (new GenerateInitialChangeStreamPartitionsRequest()) + ->setTableName($formattedTableName); + + // Call the API and handle any network failures. + try { + /** @var ServerStream $stream */ + $stream = $bigtableClient->generateInitialChangeStreamPartitions($request); + + /** @var GenerateInitialChangeStreamPartitionsResponse $element */ + foreach ($stream->readAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTableName = BigtableClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + generate_initial_change_stream_partitions_sample($formattedTableName); +} +// [END bigtable_v2_generated_Bigtable_GenerateInitialChangeStreamPartitions_sync] diff --git a/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/mutate_row.php b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/mutate_row.php new file mode 100644 index 000000000000..68cd97f0b50e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/mutate_row.php @@ -0,0 +1,82 @@ +/instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $rowKey The key of the row to which the mutation should be applied. + */ +function mutate_row_sample(string $formattedTableName, string $rowKey): void +{ + // Create a client. + $bigtableClient = new BigtableClient(); + + // Prepare the request message. + $mutations = [new Mutation()]; + $request = (new MutateRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey) + ->setMutations($mutations); + + // Call the API and handle any network failures. + try { + /** @var MutateRowResponse $response */ + $response = $bigtableClient->mutateRow($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTableName = BigtableClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $rowKey = '...'; + + mutate_row_sample($formattedTableName, $rowKey); +} +// [END bigtable_v2_generated_Bigtable_MutateRow_sync] diff --git a/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/mutate_rows.php b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/mutate_rows.php new file mode 100644 index 000000000000..de9db55dbba0 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/mutate_rows.php @@ -0,0 +1,89 @@ +/instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + */ +function mutate_rows_sample(string $formattedTableName): void +{ + // Create a client. + $bigtableClient = new BigtableClient(); + + // Prepare the request message. + $entriesMutations = [new Mutation()]; + $entry = (new Entry()) + ->setMutations($entriesMutations); + $entries = [$entry,]; + $request = (new MutateRowsRequest()) + ->setTableName($formattedTableName) + ->setEntries($entries); + + // Call the API and handle any network failures. + try { + /** @var ServerStream $stream */ + $stream = $bigtableClient->mutateRows($request); + + /** @var MutateRowsResponse $element */ + foreach ($stream->readAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTableName = BigtableClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + mutate_rows_sample($formattedTableName); +} +// [END bigtable_v2_generated_Bigtable_MutateRows_sync] diff --git a/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/ping_and_warm.php b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/ping_and_warm.php new file mode 100644 index 000000000000..314ad63bb531 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/ping_and_warm.php @@ -0,0 +1,74 @@ +/instances/`. Please see + * {@see BigtableClient::instanceName()} for help formatting this field. + */ +function ping_and_warm_sample(string $formattedName): void +{ + // Create a client. + $bigtableClient = new BigtableClient(); + + // Prepare the request message. + $request = (new PingAndWarmRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var PingAndWarmResponse $response */ + $response = $bigtableClient->pingAndWarm($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = BigtableClient::instanceName('[PROJECT]', '[INSTANCE]'); + + ping_and_warm_sample($formattedName); +} +// [END bigtable_v2_generated_Bigtable_PingAndWarm_sync] diff --git a/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/read_change_stream.php b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/read_change_stream.php new file mode 100644 index 000000000000..243f166d9131 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/read_change_stream.php @@ -0,0 +1,82 @@ +/instances//tables/
`. + * Change streaming must be enabled on the table. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + */ +function read_change_stream_sample(string $formattedTableName): void +{ + // Create a client. + $bigtableClient = new BigtableClient(); + + // Prepare the request message. + $request = (new ReadChangeStreamRequest()) + ->setTableName($formattedTableName); + + // Call the API and handle any network failures. + try { + /** @var ServerStream $stream */ + $stream = $bigtableClient->readChangeStream($request); + + /** @var ReadChangeStreamResponse $element */ + foreach ($stream->readAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTableName = BigtableClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + read_change_stream_sample($formattedTableName); +} +// [END bigtable_v2_generated_Bigtable_ReadChangeStream_sync] diff --git a/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/read_modify_write_row.php b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/read_modify_write_row.php new file mode 100644 index 000000000000..9c80a76b634e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/read_modify_write_row.php @@ -0,0 +1,86 @@ +/instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + * @param string $rowKey The key of the row to which the read/modify/write rules should be + * applied. + */ +function read_modify_write_row_sample(string $formattedTableName, string $rowKey): void +{ + // Create a client. + $bigtableClient = new BigtableClient(); + + // Prepare the request message. + $rules = [new ReadModifyWriteRule()]; + $request = (new ReadModifyWriteRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey) + ->setRules($rules); + + // Call the API and handle any network failures. + try { + /** @var ReadModifyWriteRowResponse $response */ + $response = $bigtableClient->readModifyWriteRow($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTableName = BigtableClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $rowKey = '...'; + + read_modify_write_row_sample($formattedTableName, $rowKey); +} +// [END bigtable_v2_generated_Bigtable_ReadModifyWriteRow_sync] diff --git a/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/read_rows.php b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/read_rows.php new file mode 100644 index 000000000000..1811a00c41f5 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/read_rows.php @@ -0,0 +1,83 @@ +/instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + */ +function read_rows_sample(string $formattedTableName): void +{ + // Create a client. + $bigtableClient = new BigtableClient(); + + // Prepare the request message. + $request = (new ReadRowsRequest()) + ->setTableName($formattedTableName); + + // Call the API and handle any network failures. + try { + /** @var ServerStream $stream */ + $stream = $bigtableClient->readRows($request); + + /** @var ReadRowsResponse $element */ + foreach ($stream->readAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTableName = BigtableClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + read_rows_sample($formattedTableName); +} +// [END bigtable_v2_generated_Bigtable_ReadRows_sync] diff --git a/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/sample_row_keys.php b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/sample_row_keys.php new file mode 100644 index 000000000000..f15be7dc6929 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/samples/V2/BigtableClient/sample_row_keys.php @@ -0,0 +1,82 @@ +/instances//tables/
`. Please see + * {@see BigtableClient::tableName()} for help formatting this field. + */ +function sample_row_keys_sample(string $formattedTableName): void +{ + // Create a client. + $bigtableClient = new BigtableClient(); + + // Prepare the request message. + $request = (new SampleRowKeysRequest()) + ->setTableName($formattedTableName); + + // Call the API and handle any network failures. + try { + /** @var ServerStream $stream */ + $stream = $bigtableClient->sampleRowKeys($request); + + /** @var SampleRowKeysResponse $element */ + foreach ($stream->readAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedTableName = BigtableClient::tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + + sample_row_keys_sample($formattedTableName); +} +// [END bigtable_v2_generated_Bigtable_SampleRowKeys_sync] diff --git a/owl-bot-staging/Bigtable/v2/src/V2/Client/BigtableClient.php b/owl-bot-staging/Bigtable/v2/src/V2/Client/BigtableClient.php new file mode 100644 index 000000000000..112861d5b3e6 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/src/V2/Client/BigtableClient.php @@ -0,0 +1,563 @@ + checkAndMutateRowAsync(CheckAndMutateRowRequest $request, array $optionalArgs = []) + * @method PromiseInterface mutateRowAsync(MutateRowRequest $request, array $optionalArgs = []) + * @method PromiseInterface pingAndWarmAsync(PingAndWarmRequest $request, array $optionalArgs = []) + * @method PromiseInterface readModifyWriteRowAsync(ReadModifyWriteRowRequest $request, array $optionalArgs = []) + */ +final class BigtableClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.bigtable.v2.Bigtable'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'bigtable.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'bigtable.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/bigtable.data', + 'https://www.googleapis.com/auth/bigtable.data.readonly', + 'https://www.googleapis.com/auth/cloud-bigtable.data', + 'https://www.googleapis.com/auth/cloud-bigtable.data.readonly', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/bigtable_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/bigtable_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/bigtable_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/bigtable_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * authorized_view resource. + * + * @param string $project + * @param string $instance + * @param string $table + * @param string $authorizedView + * + * @return string The formatted authorized_view resource. + */ + public static function authorizedViewName(string $project, string $instance, string $table, string $authorizedView): string + { + return self::getPathTemplate('authorizedView')->render([ + 'project' => $project, + 'instance' => $instance, + 'table' => $table, + 'authorized_view' => $authorizedView, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $instance + * + * @return string The formatted instance resource. + */ + public static function instanceName(string $project, string $instance): string + { + return self::getPathTemplate('instance')->render([ + 'project' => $project, + 'instance' => $instance, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a table + * resource. + * + * @param string $project + * @param string $instance + * @param string $table + * + * @return string The formatted table resource. + */ + public static function tableName(string $project, string $instance, string $table): string + { + return self::getPathTemplate('table')->render([ + 'project' => $project, + 'instance' => $instance, + 'table' => $table, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - authorizedView: projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view} + * - instance: projects/{project}/instances/{instance} + * - table: projects/{project}/instances/{instance}/tables/{table} + * + * 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 + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * Setting the "BIGTABLE_EMULATOR_HOST" environment variable will automatically set + * the API Endpoint to the value specified in the variable, as well as ensure that + * empty credentials are used in the transport layer. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'bigtable.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $options = $this->setDefaultEmulatorConfig($options); + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Mutates a row atomically based on the output of a predicate Reader filter. + * + * The async variant is {@see BigtableClient::checkAndMutateRowAsync()} . + * + * @example samples/V2/BigtableClient/check_and_mutate_row.php + * + * @param CheckAndMutateRowRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CheckAndMutateRowResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function checkAndMutateRow(CheckAndMutateRowRequest $request, array $callOptions = []): CheckAndMutateRowResponse + { + return $this->startApiCall('CheckAndMutateRow', $request, $callOptions)->wait(); + } + + /** + * Executes a BTQL query against a particular Cloud Bigtable instance. + * + * @example samples/V2/BigtableClient/execute_query.php + * + * @param ExecuteQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return ServerStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function executeQuery(ExecuteQueryRequest $request, array $callOptions = []): ServerStream + { + return $this->startApiCall('ExecuteQuery', $request, $callOptions); + } + + /** + * NOTE: This API is intended to be used by Apache Beam BigtableIO. + * Returns the current list of partitions that make up the table's + * change stream. The union of partitions will cover the entire keyspace. + * Partitions can be read with `ReadChangeStream`. + * + * @example samples/V2/BigtableClient/generate_initial_change_stream_partitions.php + * + * @param GenerateInitialChangeStreamPartitionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return ServerStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateInitialChangeStreamPartitions(GenerateInitialChangeStreamPartitionsRequest $request, array $callOptions = []): ServerStream + { + return $this->startApiCall('GenerateInitialChangeStreamPartitions', $request, $callOptions); + } + + /** + * Mutates a row atomically. Cells already present in the row are left + * unchanged unless explicitly changed by `mutation`. + * + * The async variant is {@see BigtableClient::mutateRowAsync()} . + * + * @example samples/V2/BigtableClient/mutate_row.php + * + * @param MutateRowRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MutateRowResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function mutateRow(MutateRowRequest $request, array $callOptions = []): MutateRowResponse + { + return $this->startApiCall('MutateRow', $request, $callOptions)->wait(); + } + + /** + * Mutates multiple rows in a batch. Each individual row is mutated + * atomically as in MutateRow, but the entire batch is not executed + * atomically. + * + * @example samples/V2/BigtableClient/mutate_rows.php + * + * @param MutateRowsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return ServerStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function mutateRows(MutateRowsRequest $request, array $callOptions = []): ServerStream + { + return $this->startApiCall('MutateRows', $request, $callOptions); + } + + /** + * Warm up associated instance metadata for this connection. + * This call is not required but may be useful for connection keep-alive. + * + * The async variant is {@see BigtableClient::pingAndWarmAsync()} . + * + * @example samples/V2/BigtableClient/ping_and_warm.php + * + * @param PingAndWarmRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PingAndWarmResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function pingAndWarm(PingAndWarmRequest $request, array $callOptions = []): PingAndWarmResponse + { + return $this->startApiCall('PingAndWarm', $request, $callOptions)->wait(); + } + + /** + * NOTE: This API is intended to be used by Apache Beam BigtableIO. + * Reads changes from a table's change stream. Changes will + * reflect both user-initiated mutations and mutations that are caused by + * garbage collection. + * + * @example samples/V2/BigtableClient/read_change_stream.php + * + * @param ReadChangeStreamRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return ServerStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function readChangeStream(ReadChangeStreamRequest $request, array $callOptions = []): ServerStream + { + return $this->startApiCall('ReadChangeStream', $request, $callOptions); + } + + /** + * Modifies a row atomically on the server. The method reads the latest + * existing timestamp and value from the specified columns and writes a new + * entry based on pre-defined read/modify/write rules. The new value for the + * timestamp is the greater of the existing timestamp or the current server + * time. The method returns the new contents of all modified cells. + * + * The async variant is {@see BigtableClient::readModifyWriteRowAsync()} . + * + * @example samples/V2/BigtableClient/read_modify_write_row.php + * + * @param ReadModifyWriteRowRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ReadModifyWriteRowResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function readModifyWriteRow(ReadModifyWriteRowRequest $request, array $callOptions = []): ReadModifyWriteRowResponse + { + return $this->startApiCall('ReadModifyWriteRow', $request, $callOptions)->wait(); + } + + /** + * Streams back the contents of all requested rows in key order, optionally + * applying the same Reader filter to each. Depending on their size, + * rows and cells may be broken up across multiple responses, but + * atomicity of each row will still be preserved. See the + * ReadRowsResponse documentation for details. + * + * @example samples/V2/BigtableClient/read_rows.php + * + * @param ReadRowsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return ServerStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function readRows(ReadRowsRequest $request, array $callOptions = []): ServerStream + { + return $this->startApiCall('ReadRows', $request, $callOptions); + } + + /** + * Returns a sample of row keys in the table. The returned row keys will + * delimit contiguous sections of the table of approximately equal size, + * which can be used to break up the data for distributed tasks like + * mapreduces. + * + * @example samples/V2/BigtableClient/sample_row_keys.php + * + * @param SampleRowKeysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return ServerStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function sampleRowKeys(SampleRowKeysRequest $request, array $callOptions = []): ServerStream + { + return $this->startApiCall('SampleRowKeys', $request, $callOptions); + } + + /** Configure the gapic configuration to use a service emulator. */ + private function setDefaultEmulatorConfig(array $options): array + { + $emulatorHost = getenv('BIGTABLE_EMULATOR_HOST'); + if (empty($emulatorHost)) { + return $options; + } + + if ($scheme = parse_url($emulatorHost, PHP_URL_SCHEME)) { + $search = $scheme . '://'; + $emulatorHost = str_replace($search, '', $emulatorHost); + } + + $options['apiEndpoint'] ??= $emulatorHost; + $options['transportConfig']['grpc']['stubOpts']['credentials'] ??= ChannelCredentials::createInsecure(); + $options['credentials'] ??= new InsecureCredentialsWrapper(); + return $options; + } +} diff --git a/owl-bot-staging/Bigtable/v2/src/V2/gapic_metadata.json b/owl-bot-staging/Bigtable/v2/src/V2/gapic_metadata.json new file mode 100644 index 000000000000..fe7b9844ea9d --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/src/V2/gapic_metadata.json @@ -0,0 +1,68 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.bigtable.v2", + "libraryPackage": "Google\\Cloud\\Bigtable\\V2", + "services": { + "Bigtable": { + "clients": { + "grpc": { + "libraryClient": "BigtableGapicClient", + "rpcs": { + "CheckAndMutateRow": { + "methods": [ + "checkAndMutateRow" + ] + }, + "ExecuteQuery": { + "methods": [ + "executeQuery" + ] + }, + "GenerateInitialChangeStreamPartitions": { + "methods": [ + "generateInitialChangeStreamPartitions" + ] + }, + "MutateRow": { + "methods": [ + "mutateRow" + ] + }, + "MutateRows": { + "methods": [ + "mutateRows" + ] + }, + "PingAndWarm": { + "methods": [ + "pingAndWarm" + ] + }, + "ReadChangeStream": { + "methods": [ + "readChangeStream" + ] + }, + "ReadModifyWriteRow": { + "methods": [ + "readModifyWriteRow" + ] + }, + "ReadRows": { + "methods": [ + "readRows" + ] + }, + "SampleRowKeys": { + "methods": [ + "sampleRowKeys" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Bigtable/v2/src/V2/resources/bigtable_client_config.json b/owl-bot-staging/Bigtable/v2/src/V2/resources/bigtable_client_config.json new file mode 100644 index 000000000000..ee5dae96485d --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/src/V2/resources/bigtable_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.bigtable.v2.Bigtable": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CheckAndMutateRow": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExecuteQuery": { + "timeout_millis": 60000 + }, + "GenerateInitialChangeStreamPartitions": { + "timeout_millis": 60000 + }, + "MutateRow": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MutateRows": { + "timeout_millis": 60000 + }, + "PingAndWarm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadChangeStream": { + "timeout_millis": 60000 + }, + "ReadModifyWriteRow": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadRows": { + "timeout_millis": 60000 + }, + "SampleRowKeys": { + "timeout_millis": 60000 + } + } + } + } +} diff --git a/owl-bot-staging/Bigtable/v2/src/V2/resources/bigtable_descriptor_config.php b/owl-bot-staging/Bigtable/v2/src/V2/resources/bigtable_descriptor_config.php new file mode 100644 index 000000000000..77b7d119b420 --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/src/V2/resources/bigtable_descriptor_config.php @@ -0,0 +1,297 @@ + [ + 'google.bigtable.v2.Bigtable' => [ + 'CheckAndMutateRow' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\V2\CheckAndMutateRowResponse', + 'headerParams' => [ + [ + 'keyName' => 'table_name', + 'fieldAccessors' => [ + 'getTableName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', + ], + ], + [ + 'keyName' => 'app_profile_id', + 'fieldAccessors' => [ + 'getAppProfileId', + ], + ], + [ + 'keyName' => 'authorized_view_name', + 'fieldAccessors' => [ + 'getAuthorizedViewName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', + ], + ], + ], + ], + 'ExecuteQuery' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'ServerStreaming', + ], + 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Bigtable\V2\ExecuteQueryResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getInstanceName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+)$/', + ], + ], + [ + 'keyName' => 'app_profile_id', + 'fieldAccessors' => [ + 'getAppProfileId', + ], + ], + ], + ], + 'GenerateInitialChangeStreamPartitions' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'ServerStreaming', + ], + 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Bigtable\V2\GenerateInitialChangeStreamPartitionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'table_name', + 'fieldAccessors' => [ + 'getTableName', + ], + ], + ], + ], + 'MutateRow' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\V2\MutateRowResponse', + 'headerParams' => [ + [ + 'keyName' => 'table_name', + 'fieldAccessors' => [ + 'getTableName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', + ], + ], + [ + 'keyName' => 'app_profile_id', + 'fieldAccessors' => [ + 'getAppProfileId', + ], + ], + [ + 'keyName' => 'authorized_view_name', + 'fieldAccessors' => [ + 'getAuthorizedViewName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', + ], + ], + ], + ], + 'MutateRows' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'ServerStreaming', + ], + 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Bigtable\V2\MutateRowsResponse', + 'headerParams' => [ + [ + 'keyName' => 'table_name', + 'fieldAccessors' => [ + 'getTableName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', + ], + ], + [ + 'keyName' => 'app_profile_id', + 'fieldAccessors' => [ + 'getAppProfileId', + ], + ], + [ + 'keyName' => 'authorized_view_name', + 'fieldAccessors' => [ + 'getAuthorizedViewName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', + ], + ], + ], + ], + 'PingAndWarm' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\V2\PingAndWarmResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+)$/', + ], + ], + [ + 'keyName' => 'app_profile_id', + 'fieldAccessors' => [ + 'getAppProfileId', + ], + ], + ], + ], + 'ReadChangeStream' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'ServerStreaming', + ], + 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Bigtable\V2\ReadChangeStreamResponse', + 'headerParams' => [ + [ + 'keyName' => 'table_name', + 'fieldAccessors' => [ + 'getTableName', + ], + ], + ], + ], + 'ReadModifyWriteRow' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Bigtable\V2\ReadModifyWriteRowResponse', + 'headerParams' => [ + [ + 'keyName' => 'table_name', + 'fieldAccessors' => [ + 'getTableName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', + ], + ], + [ + 'keyName' => 'app_profile_id', + 'fieldAccessors' => [ + 'getAppProfileId', + ], + ], + [ + 'keyName' => 'authorized_view_name', + 'fieldAccessors' => [ + 'getAuthorizedViewName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', + ], + ], + ], + ], + 'ReadRows' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'ServerStreaming', + ], + 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Bigtable\V2\ReadRowsResponse', + 'headerParams' => [ + [ + 'keyName' => 'table_name', + 'fieldAccessors' => [ + 'getTableName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', + ], + ], + [ + 'keyName' => 'app_profile_id', + 'fieldAccessors' => [ + 'getAppProfileId', + ], + ], + [ + 'keyName' => 'authorized_view_name', + 'fieldAccessors' => [ + 'getAuthorizedViewName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', + ], + ], + ], + ], + 'SampleRowKeys' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'ServerStreaming', + ], + 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Bigtable\V2\SampleRowKeysResponse', + 'headerParams' => [ + [ + 'keyName' => 'table_name', + 'fieldAccessors' => [ + 'getTableName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', + ], + ], + [ + 'keyName' => 'app_profile_id', + 'fieldAccessors' => [ + 'getAppProfileId', + ], + ], + [ + 'keyName' => 'authorized_view_name', + 'fieldAccessors' => [ + 'getAuthorizedViewName', + ], + 'matchers' => [ + '/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', + ], + ], + ], + ], + 'templateMap' => [ + 'authorizedView' => 'projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}', + 'instance' => 'projects/{project}/instances/{instance}', + 'table' => 'projects/{project}/instances/{instance}/tables/{table}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Bigtable/v2/src/V2/resources/bigtable_rest_client_config.php b/owl-bot-staging/Bigtable/v2/src/V2/resources/bigtable_rest_client_config.php new file mode 100644 index 000000000000..33dbd11ee56e --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/src/V2/resources/bigtable_rest_client_config.php @@ -0,0 +1,219 @@ + [ + 'google.bigtable.v2.Bigtable' => [ + 'CheckAndMutateRow' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:checkAndMutateRow', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'authorized_view_name' => [ + 'getters' => [ + 'getAuthorizedViewName', + ], + ], + 'table_name' => [ + 'getters' => [ + 'getTableName', + ], + ], + ], + ], + 'ExecuteQuery' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{instance_name=projects/*/instances/*}:executeQuery', + 'body' => '*', + 'placeholders' => [ + 'instance_name' => [ + 'getters' => [ + 'getInstanceName', + ], + ], + ], + ], + 'GenerateInitialChangeStreamPartitions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{table_name=projects/*/instances/*/tables/*}:generateInitialChangeStreamPartitions', + 'body' => '*', + 'placeholders' => [ + 'table_name' => [ + 'getters' => [ + 'getTableName', + ], + ], + ], + ], + 'MutateRow' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRow', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'authorized_view_name' => [ + 'getters' => [ + 'getAuthorizedViewName', + ], + ], + 'table_name' => [ + 'getters' => [ + 'getTableName', + ], + ], + ], + ], + 'MutateRows' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRows', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'authorized_view_name' => [ + 'getters' => [ + 'getAuthorizedViewName', + ], + ], + 'table_name' => [ + 'getters' => [ + 'getTableName', + ], + ], + ], + ], + 'PingAndWarm' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/instances/*}:ping', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ReadChangeStream' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{table_name=projects/*/instances/*/tables/*}:readChangeStream', + 'body' => '*', + 'placeholders' => [ + 'table_name' => [ + 'getters' => [ + 'getTableName', + ], + ], + ], + ], + 'ReadModifyWriteRow' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readModifyWriteRow', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'authorized_view_name' => [ + 'getters' => [ + 'getAuthorizedViewName', + ], + ], + 'table_name' => [ + 'getters' => [ + 'getTableName', + ], + ], + ], + ], + 'ReadRows' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{table_name=projects/*/instances/*/tables/*}:readRows', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readRows', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'authorized_view_name' => [ + 'getters' => [ + 'getAuthorizedViewName', + ], + ], + 'table_name' => [ + 'getters' => [ + 'getTableName', + ], + ], + ], + ], + 'SampleRowKeys' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:sampleRowKeys', + ], + ], + 'placeholders' => [ + 'authorized_view_name' => [ + 'getters' => [ + 'getAuthorizedViewName', + ], + ], + 'table_name' => [ + 'getters' => [ + 'getTableName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Bigtable/v2/tests/Unit/V2/Client/BigtableClientTest.php b/owl-bot-staging/Bigtable/v2/tests/Unit/V2/Client/BigtableClientTest.php new file mode 100644 index 000000000000..087592d15bce --- /dev/null +++ b/owl-bot-staging/Bigtable/v2/tests/Unit/V2/Client/BigtableClientTest.php @@ -0,0 +1,881 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BigtableClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BigtableClient($options); + } + + /** @test */ + public function checkAndMutateRowTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $predicateMatched = true; + $expectedResponse = new CheckAndMutateRowResponse(); + $expectedResponse->setPredicateMatched($predicateMatched); + $transport->addResponse($expectedResponse); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $rowKey = '122'; + $request = (new CheckAndMutateRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey); + $response = $gapicClient->checkAndMutateRow($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/CheckAndMutateRow', $actualFuncCall); + $actualValue = $actualRequestObject->getTableName(); + $this->assertProtobufEquals($formattedTableName, $actualValue); + $actualValue = $actualRequestObject->getRowKey(); + $this->assertProtobufEquals($rowKey, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function checkAndMutateRowExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $rowKey = '122'; + $request = (new CheckAndMutateRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey); + try { + $gapicClient->checkAndMutateRow($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function executeQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ExecuteQueryResponse(); + $transport->addResponse($expectedResponse); + $expectedResponse2 = new ExecuteQueryResponse(); + $transport->addResponse($expectedResponse2); + $expectedResponse3 = new ExecuteQueryResponse(); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedInstanceName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $query = 'query107944136'; + $paramsValue = new Value(); + $params = [ + 'paramsKey' => $paramsValue, + ]; + $request = (new ExecuteQueryRequest()) + ->setInstanceName($formattedInstanceName) + ->setQuery($query) + ->setParams($params); + $serverStream = $gapicClient->executeQuery($request); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/ExecuteQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceName(); + $this->assertProtobufEquals($formattedInstanceName, $actualValue); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $actualValue = $actualRequestObject->getParams(); + $this->assertProtobufEquals($params, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function executeQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $formattedInstanceName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $query = 'query107944136'; + $paramsValue = new Value(); + $params = [ + 'paramsKey' => $paramsValue, + ]; + $request = (new ExecuteQueryRequest()) + ->setInstanceName($formattedInstanceName) + ->setQuery($query) + ->setParams($params); + $serverStream = $gapicClient->executeQuery($request); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateInitialChangeStreamPartitionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GenerateInitialChangeStreamPartitionsResponse(); + $transport->addResponse($expectedResponse); + $expectedResponse2 = new GenerateInitialChangeStreamPartitionsResponse(); + $transport->addResponse($expectedResponse2); + $expectedResponse3 = new GenerateInitialChangeStreamPartitionsResponse(); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new GenerateInitialChangeStreamPartitionsRequest()) + ->setTableName($formattedTableName); + $serverStream = $gapicClient->generateInitialChangeStreamPartitions($request); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/GenerateInitialChangeStreamPartitions', $actualFuncCall); + $actualValue = $actualRequestObject->getTableName(); + $this->assertProtobufEquals($formattedTableName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateInitialChangeStreamPartitionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new GenerateInitialChangeStreamPartitionsRequest()) + ->setTableName($formattedTableName); + $serverStream = $gapicClient->generateInitialChangeStreamPartitions($request); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function mutateRowTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new MutateRowResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $rowKey = '122'; + $mutations = []; + $request = (new MutateRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey) + ->setMutations($mutations); + $response = $gapicClient->mutateRow($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/MutateRow', $actualFuncCall); + $actualValue = $actualRequestObject->getTableName(); + $this->assertProtobufEquals($formattedTableName, $actualValue); + $actualValue = $actualRequestObject->getRowKey(); + $this->assertProtobufEquals($rowKey, $actualValue); + $actualValue = $actualRequestObject->getMutations(); + $this->assertProtobufEquals($mutations, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function mutateRowExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $rowKey = '122'; + $mutations = []; + $request = (new MutateRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey) + ->setMutations($mutations); + try { + $gapicClient->mutateRow($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function mutateRowsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new MutateRowsResponse(); + $transport->addResponse($expectedResponse); + $expectedResponse2 = new MutateRowsResponse(); + $transport->addResponse($expectedResponse2); + $expectedResponse3 = new MutateRowsResponse(); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $entries = []; + $request = (new MutateRowsRequest()) + ->setTableName($formattedTableName) + ->setEntries($entries); + $serverStream = $gapicClient->mutateRows($request); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/MutateRows', $actualFuncCall); + $actualValue = $actualRequestObject->getTableName(); + $this->assertProtobufEquals($formattedTableName, $actualValue); + $actualValue = $actualRequestObject->getEntries(); + $this->assertProtobufEquals($entries, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function mutateRowsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $entries = []; + $request = (new MutateRowsRequest()) + ->setTableName($formattedTableName) + ->setEntries($entries); + $serverStream = $gapicClient->mutateRows($request); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pingAndWarmTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new PingAndWarmResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new PingAndWarmRequest()) + ->setName($formattedName); + $response = $gapicClient->pingAndWarm($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/PingAndWarm', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pingAndWarmExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); + $request = (new PingAndWarmRequest()) + ->setName($formattedName); + try { + $gapicClient->pingAndWarm($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function readChangeStreamTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ReadChangeStreamResponse(); + $transport->addResponse($expectedResponse); + $expectedResponse2 = new ReadChangeStreamResponse(); + $transport->addResponse($expectedResponse2); + $expectedResponse3 = new ReadChangeStreamResponse(); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new ReadChangeStreamRequest()) + ->setTableName($formattedTableName); + $serverStream = $gapicClient->readChangeStream($request); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/ReadChangeStream', $actualFuncCall); + $actualValue = $actualRequestObject->getTableName(); + $this->assertProtobufEquals($formattedTableName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function readChangeStreamExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new ReadChangeStreamRequest()) + ->setTableName($formattedTableName); + $serverStream = $gapicClient->readChangeStream($request); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function readModifyWriteRowTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ReadModifyWriteRowResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $rowKey = '122'; + $rules = []; + $request = (new ReadModifyWriteRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey) + ->setRules($rules); + $response = $gapicClient->readModifyWriteRow($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/ReadModifyWriteRow', $actualFuncCall); + $actualValue = $actualRequestObject->getTableName(); + $this->assertProtobufEquals($formattedTableName, $actualValue); + $actualValue = $actualRequestObject->getRowKey(); + $this->assertProtobufEquals($rowKey, $actualValue); + $actualValue = $actualRequestObject->getRules(); + $this->assertProtobufEquals($rules, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function readModifyWriteRowExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $rowKey = '122'; + $rules = []; + $request = (new ReadModifyWriteRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey) + ->setRules($rules); + try { + $gapicClient->readModifyWriteRow($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function readRowsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $lastScannedRowKey = '-126'; + $expectedResponse = new ReadRowsResponse(); + $expectedResponse->setLastScannedRowKey($lastScannedRowKey); + $transport->addResponse($expectedResponse); + $lastScannedRowKey2 = '-75'; + $expectedResponse2 = new ReadRowsResponse(); + $expectedResponse2->setLastScannedRowKey($lastScannedRowKey2); + $transport->addResponse($expectedResponse2); + $lastScannedRowKey3 = '-74'; + $expectedResponse3 = new ReadRowsResponse(); + $expectedResponse3->setLastScannedRowKey($lastScannedRowKey3); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new ReadRowsRequest()) + ->setTableName($formattedTableName); + $serverStream = $gapicClient->readRows($request); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/ReadRows', $actualFuncCall); + $actualValue = $actualRequestObject->getTableName(); + $this->assertProtobufEquals($formattedTableName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function readRowsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new ReadRowsRequest()) + ->setTableName($formattedTableName); + $serverStream = $gapicClient->readRows($request); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function sampleRowKeysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $rowKey = '122'; + $offsetBytes = 889884095; + $expectedResponse = new SampleRowKeysResponse(); + $expectedResponse->setRowKey($rowKey); + $expectedResponse->setOffsetBytes($offsetBytes); + $transport->addResponse($expectedResponse); + $rowKey2 = '-83'; + $offsetBytes2 = 480126386; + $expectedResponse2 = new SampleRowKeysResponse(); + $expectedResponse2->setRowKey($rowKey2); + $expectedResponse2->setOffsetBytes($offsetBytes2); + $transport->addResponse($expectedResponse2); + $rowKey3 = '-82'; + $offsetBytes3 = 480126387; + $expectedResponse3 = new SampleRowKeysResponse(); + $expectedResponse3->setRowKey($rowKey3); + $expectedResponse3->setOffsetBytes($offsetBytes3); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new SampleRowKeysRequest()) + ->setTableName($formattedTableName); + $serverStream = $gapicClient->sampleRowKeys($request); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/SampleRowKeys', $actualFuncCall); + $actualValue = $actualRequestObject->getTableName(); + $this->assertProtobufEquals($formattedTableName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function sampleRowKeysExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $request = (new SampleRowKeysRequest()) + ->setTableName($formattedTableName); + $serverStream = $gapicClient->sampleRowKeys($request); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function checkAndMutateRowAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $predicateMatched = true; + $expectedResponse = new CheckAndMutateRowResponse(); + $expectedResponse->setPredicateMatched($predicateMatched); + $transport->addResponse($expectedResponse); + // Mock request + $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); + $rowKey = '122'; + $request = (new CheckAndMutateRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey); + $response = $gapicClient->checkAndMutateRowAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/CheckAndMutateRow', $actualFuncCall); + $actualValue = $actualRequestObject->getTableName(); + $this->assertProtobufEquals($formattedTableName, $actualValue); + $actualValue = $actualRequestObject->getRowKey(); + $this->assertProtobufEquals($rowKey, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +}